/* =========================================================
   Forgot Password Page
   ========================================================= */

.auth-body {
    margin: 0;
    background: var(--c-bg);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    background: var(--c-bg);
}

/* ---------- Panel ---------- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-8) var(--sp-6);
}

.auth-box {
    width: 100%;
    max-width: 440px;
    animation: forgotFade .5s ease both;
}
@keyframes forgotFade {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    width: 68px; height: 68px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-700));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 28px;
    margin-bottom: var(--sp-5);
    box-shadow: 0 8px 20px rgba(61,95,143,.28);
}

.auth-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--c-text);
}
.auth-sub {
    color: var(--c-text-muted);
    font-size: var(--fs-md);
    margin: 0 0 var(--sp-6);
    line-height: 1.9;
}
.phone-strong {
    color: var(--c-primary-700);
    direction: ltr;
    display: inline-block;
    font-weight: 700;
}

/* Steps */
.auth-step { display: block; }
.auth-step[hidden] { display: none; }

/* فیلد */
.auth-box .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--sp-5);
}
.auth-box label {
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
    font-weight: 500;
}
.auth-box label .req { color: var(--c-danger); }

.control { position: relative; }
.control > i.field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color var(--t-fast);
}
.control:focus-within > i.field-icon { color: var(--c-primary-600); }
.control .form-input {
    height: 48px;
    padding-right: 42px;
    font-size: var(--fs-md);
}
.control .toggle-pass {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    color: var(--c-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--t-fast);
}
.control .toggle-pass:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
}

.field-error {
    color: var(--c-danger);
    font-size: var(--fs-xs);
    min-height: 14px;
}
.field.has-error .form-input {
    border-color: var(--c-danger);
    box-shadow: 0 0 0 3px rgba(194,90,84,.10);
}

/* OTP */
.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
    margin-top: 8px;
}
.otp-input {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text);
    background: var(--c-surface-2);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--t-fast);
    font-family: inherit;
}
.otp-input:focus {
    border-color: var(--c-primary-500);
    background: var(--c-surface);
    box-shadow: 0 0 0 3px rgba(61,95,143,.15);
}

.otp-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: var(--fs-sm);
}
.otp-timer { color: var(--c-text-muted); }
.otp-timer strong { color: var(--c-primary-700); font-weight: 700; }

.resend-link {
    background: none;
    border: none;
    color: var(--c-primary-600);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--t-fast);
}
.resend-link:hover:not(:disabled) { color: var(--c-primary-800); text-decoration: underline; }
.resend-link:disabled { opacity: .5; cursor: not-allowed; text-decoration: none; }

/* دکمه */
.btn-auth {
    width: 100%;
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-700));
    color: #fff;
    font-size: var(--fs-lg);
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(61,95,143,.28);
    border: none;
    cursor: pointer;
    transition: all var(--t-base);
}
.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(61,95,143,.35);
}
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

/* فوتر فرم */
.auth-footer {
    margin-top: var(--sp-5);
    text-align: center;
}
.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    color: var(--c-text-muted);
    font-weight: 500;
    transition: color var(--t-fast);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.auth-link:hover { color: var(--c-primary-600); }

/* ---------- Brand ---------- */
.auth-brand {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #2f4a72 0%, #1d2d46 100%);
    color: #fff;
    padding: var(--sp-10);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.auth-brand::before {
    width: 420px; height: 420px;
    top: -140px; left: -120px;
    background: radial-gradient(circle, rgba(255,255,255,.06), transparent 70%);
}
.auth-brand::after {
    width: 520px; height: 520px;
    bottom: -200px; right: -140px;
    background: radial-gradient(circle, rgba(201,164,90,.10), transparent 70%);
}

.brand-head {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.brand-head .logo {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    display: grid;
    place-items: center;
    font-size: 22px;
}
.brand-head .txt strong { display: block; font-size: var(--fs-lg); font-weight: 700; }
.brand-head .txt small {
    color: rgba(255,255,255,.7);
    font-size: var(--fs-xs);
}

.brand-body {
    position: relative;
    z-index: 1;
    max-width: 440px;
}
.brand-body h2 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.5;
    margin: 0 0 var(--sp-4);
}
.brand-body h2 .hl { color: var(--c-accent); }
.brand-body p {
    color: rgba(255,255,255,.78);
    font-size: var(--fs-md);
    line-height: 1.9;
    margin: 0 0 var(--sp-8);
}

.brand-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
}
.feat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    color: rgba(255,255,255,.85);
    transition: all var(--t-fast);
}
.feat:hover { background: rgba(255,255,255,.09); transform: translateY(-2px); }
.feat i {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(201,164,90,.15);
    color: var(--c-accent);
    display: grid;
    place-items: center;
    font-size: 12px;
    flex-shrink: 0;
}

.brand-foot {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,.55);
    font-size: var(--fs-xs);
}
/* =========================================================
   OTP — Single hidden input + visual boxes
   (Best for mobile autofill / WebOTP)
   ========================================================= */

.otp-code-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    cursor: text;
    margin-top: 4px;
}

/* input مخفی واقعی — مرورگر این را autofill می‌کند */
.otp-code-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: none;
    background: transparent;
    font-size: 16px;    /* جلوگیری از zoom iOS */
    color: transparent;
    caret-color: transparent;
    cursor: text;
    z-index: 2;
    outline: none;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* باکس‌های نمایشی */
.otp-boxes {
    display: flex;
    gap: 8px;
    pointer-events: none;
    direction: ltr;
    justify-content: center;
    width: 100%;
}
.otp-box {
    width: 48px;
    height: 56px;
    border: 2px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-surface);
    color: var(--c-text);
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Yekan Bakh', sans-serif;
    transition: all .15s;
}
.otp-box.filled {
    border-color: var(--c-primary-300);
    background: var(--c-primary-50);
}
.otp-box.active {
    border-color: var(--c-primary-500);
    box-shadow: 0 0 0 3px rgba(61,95,143,.15);
}

/* فوکوس روی wrapper برای has-error */
.field.has-error .otp-box {
    border-color: var(--c-danger);
    box-shadow: 0 0 0 3px rgba(194,90,84,.10);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-panel { padding: var(--sp-6) var(--sp-4); }
    .auth-logo { width: 58px; height: 58px; font-size: 24px; }
    .auth-title { font-size: 22px; }
    .otp-input { width: 40px; height: 48px; font-size: 18px; }
    .otp-timer-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 400px) {
    .otp-boxes { gap: 6px; }
    .otp-box {
        width: 40px;
        height: 50px;
        font-size: 18px;
        border-radius: 8px;
    }
}
@media (max-width: 340px) {
    .otp-boxes { gap: 4px; }
    .otp-box {
        width: 34px;
        height: 44px;
        font-size: 16px;
    }
}