body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

.form-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.company-logo {
    max-width: 150px;
    height: auto;
    margin-top: 15px;
    transition: transform .3s ease;
}
.company-logo:hover { transform: scale(1.05); }

.login-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    text-align: right;
}

.form-group {
    margin-bottom: 18px;
    text-align: right;
}
.form-group label,
.captcha-input-wrap label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}
.form-group input[type="text"],
.form-group input[type="password"],
.captcha-input-wrap input {
    width: 100%;
    height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    direction: rtl;
}
.form-group input:focus,
.captcha-input-wrap input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.captcha-box {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    margin: 4px 0 18px;
    padding: 12px;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    background: #f8fafc;
}
.captcha-question {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e8eef5;
    color: #102A43;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
    user-select: none;
}
.captcha-input-wrap { min-width: 0; }
.captcha-input-wrap input { background: #fff; }

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.btn {
    flex: 1;
    min-height: 44px;
    padding: 11px 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .16s ease;
}
.btn-login { background: #1e3a8a; color: #fff; }
.btn-login:hover { background: #1d4ed8; }
.btn-reset { background: #94a3b8; color: #fff; }
.btn-reset:hover { background: #64748b; }

.forgot-pass {
    display: block;
    margin-top: 15px;
    text-align: center;
    color: #1e3a8a;
    text-decoration: none;
    font-size: 14px;
}
.forgot-pass:hover { text-decoration: underline; }

@media (max-width: 576px) {
    .form-box { padding: 24px 18px; border-radius: 12px; }
    .buttons { flex-direction: column; }
    .btn { width: 100%; }
    .captcha-box { grid-template-columns: 1fr; }
}


.login-modal { display:none; position:fixed; inset:0; z-index:1000; background:rgba(15,23,42,.65); align-items:center; justify-content:center; padding:20px; }
.login-modal.is-open { display:flex; }
.login-modal-content { width:100%; max-width:460px; box-sizing:border-box; background:#fff; border-radius:16px; padding:30px; box-shadow:0 20px 50px rgba(0,0,0,.3); position:relative; }
.login-modal-header { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:15px; }
.login-modal-header h2 { margin:0; color:#102A43; font-size:21px; }
.login-modal-close { border:0; background:transparent; color:#64748b; font-size:28px; cursor:pointer; line-height:1; }
.forgot-password-intro { color:#64748b; font-size:14px; line-height:1.8; margin:0 0 20px; }
.forgot-disabled-field { opacity:.62; }
.forgot-disabled-field .form-control { background:#f1f5f9; cursor:not-allowed; }
.locked-label { font-size:12px; color:#94a3b8; font-weight:500; margin-right:5px; }
.forgot-password-alert { padding:10px 12px; border-radius:8px; margin-bottom:16px; font-size:14px; line-height:1.7; }
.forgot-password-alert-error { background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }
.forgot-password-alert-success { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.forgot-password-field-error { display:block; color:#dc2626; font-size:12px; margin-top:6px; }
.login-modal-actions { display:flex; gap:10px; margin-top:20px; }
.login-modal-actions .btn { flex:1; }
@media (max-width:576px) { .login-modal-content { padding:24px 18px; border-radius:12px; } .login-modal-actions { flex-direction:column; } }
