/* ═══════════════════════════════════════════════════════════════
   login.css — صفحه ورود (مستقل - شامل Design System)
   ═══════════════════════════════════════════════════════════════ */

@font-face {
    font-family: Yekan;
    src: url(../font/Yekan.woff);
}

:root {
    --primary:        #2c6db4;
    --primary-dark:   #0d47a1;
    --primary-light:  #e8f0fb;
    --danger:         #e74c3c;
    --danger-light:   #fdecea;
    --success:        #2ecc71;
    --text:           #1e293b;
    --text-soft:      #475569;
    --text-muted:     #64748b;
    --text-faint:     #94a3b8;
    --border:         #eef2f7;
    --border-strong:  #e2e8f0;
    --ease:           cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Yekan, Tahoma, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 10% 10%, rgba(44, 109, 180, 0.12), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(76, 201, 240, 0.10), transparent 45%),
        linear-gradient(135deg, #f5f7fa 0%, #e8f0fb 100%);
    padding: 20px;
    overflow-x: hidden;
}

/* ─── Container ─── */
.login-container {
    background: #fff;
    border-radius: 24px;
    box-shadow:
        0 25px 60px rgba(15, 23, 42, 0.12),
        0 4px 16px rgba(15, 23, 42, 0.06);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    animation: loginIn 0.5s var(--ease);
}
@keyframes loginIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-container.loading { pointer-events: none; opacity: 0.85; }

/* ─── Logo ─── */
.logo {
    text-align: center;
    position: relative;
    z-index: 1;
}
.logo-image {
    width: 195px;
}

/* ─── Header ─── */
.form-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}
.form-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.form-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
}
.form-header .text-muted {
    color: var(--text-muted);
    font-size: 12.5px;
}

/* ─── Form ─── */
#login-form { position: relative; z-index: 1; }

.form-group { margin-bottom: 18px; }

.input-container {
    position: relative;
    width: 100%;
}

.form-control {
    width: 100%;
    height: 54px;
    padding: 20px 16px 6px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s var(--ease);
    outline: none;
}
.form-control:hover { border-color: #cbd5e1; }
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(44, 109, 180, 0.1);
}

.floating-label {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 13px;
    color: var(--text-faint);
    font-weight: 500;
    pointer-events: none;
    transition: all 0.2s var(--ease);
    background: transparent;
}
.form-control:focus ~ .floating-label,
.form-control:not(:placeholder-shown) ~ .floating-label {
    top: 2px;
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
}

/* ─── Password Toggle ─── */
.password-toggle {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    width: 34px; height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    font-size: 14px;
    z-index: 2;
}
.password-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ─── Error Messages ─── */
.error-message {
    display: none;
    font-size: 11.5px;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 500;
    padding-right: 4px;
}
.error-message.text-center { text-align: center; padding-right: 0; }

/* ─── Captcha ─── */
.captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}
.captcha-image {
    flex: 1;
    height: 52px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    user-select: none;
    background: #f8fafc;
}
.captcha-image:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(44, 109, 180, 0.08);
}
.refresh-captcha {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1.5px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
}
.refresh-captcha:hover {
    background: var(--primary);
    color: #fff;
    transform: rotate(180deg);
    box-shadow: 0 4px 12px rgba(44, 109, 180, 0.28);
}
.refresh-captcha.loading {
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(44, 109, 180, 0.32);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(44, 109, 180, 0.42);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
    background: #fff;
    color: var(--text-soft);
    border: 1.5px solid var(--border-strong);
    height: 46px;
}
.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--text-faint);
    color: var(--text);
}

.button-group {
    margin-top: 12px;
}

/* ─── OTP Section ─── */
.otp-section {
    display: none;
    position: relative;
    z-index: 1;
}
.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
    direction: ltr;
}
.otp-box {
    width: 46px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: all 0.2s var(--ease);
    font-variant-numeric: tabular-nums;
}
.otp-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(44, 109, 180, 0.15);
    transform: translateY(-2px);
}
.otp-box:not(:placeholder-shown) {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 22px;
        border-radius: 20px;
    }
    .logo-text { font-size: 22px; }
    .form-header h3 { font-size: 15.5px; }
    .form-control { height: 50px; font-size: 13.5px; }
    .btn { height: 46px; font-size: 13px; }
    .otp-box {
        width: 42px;
        height: 52px;
        font-size: 20px;
    }
    .otp-inputs { gap: 6px; }
    .captcha-image { height: 48px; }
    .refresh-captcha { width: 48px; height: 48px; }
}