/* ═══════════════════════════════════════════════════════════════════════════
   auth.css — Professional split-screen auth design
   Loaded AFTER style.css so overrides take effect.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Body override ───────────────────────────────────────────────────────── */
body.auth-body {
    display: block;
    overflow: hidden;
    background: #080c14;
    animation: none;
    height: 100vh;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.auth-page {
    display: flex;
    height: 100vh;
    direction: ltr;
}

/* ════════════════════════════════════════════════════════════════════════════
   BRAND PANEL (left)
   ════════════════════════════════════════════════════════════════════════════ */
.auth-brand {
    flex: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #0d0b26 0%, #1a1060 45%, #251d7a 100%);
    display: flex;
    align-items: center;
    padding: 4rem;
}

/* Background grid */
.ab-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Glowing orbs */
.ab-glow-1 {
    position: absolute;
    width: 450px; height: 450px;
    top: -120px; left: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.22) 0%, transparent 65%);
    pointer-events: none;
}
.ab-glow-2 {
    position: absolute;
    width: 320px; height: 320px;
    bottom: -60px; right: -60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168,85,247,0.18) 0%, transparent 65%);
    pointer-events: none;
}
.ab-glow-3 {
    position: absolute;
    width: 200px; height: 200px;
    top: 50%; left: 55%;
    transform: translate(-50%,-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(129,140,248,0.1) 0%, transparent 65%);
    pointer-events: none;
}

/* Brand content */
.ab-inner {
    position: relative;
    z-index: 1;
    direction: rtl;
    max-width: 420px;
}

.ab-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}
.ab-logo-icon {
    width: 46px; height: 46px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 28px rgba(99,102,241,0.45);
    flex-shrink: 0;
}
.ab-logo-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.01em;
}

.ab-headline {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.3;
    color: white;
    margin-bottom: 0.85rem;
}
.ab-headline span {
    background: linear-gradient(135deg, #818cf8, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ab-tagline {
    font-size: 0.93rem;
    color: rgba(255,255,255,0.48);
    line-height: 1.75;
    margin-bottom: 2.75rem;
}

.ab-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.ab-features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    direction: rtl;
}
.ab-feat-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(99,102,241,0.14);
    border: 1px solid rgba(99,102,241,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.ab-feat-text {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.62);
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════════════════════
   FORM PANEL (right)
   ════════════════════════════════════════════════════════════════════════════ */
.auth-form-panel {
    width: 490px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    background: #0d1117;
    border-left: 1px solid rgba(255,255,255,0.055);
    direction: rtl;
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.3) transparent;
}
.auth-form-panel::-webkit-scrollbar { width: 4px; }
.auth-form-panel::-webkit-scrollbar-track { background: transparent; }
.auth-form-panel::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 2px; }

/* Inner wrapper — flex column that centers when content < 100vh,
   and grows naturally when content overflows (enabling scroll) */
.afp-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2.75rem;
}

/* reCAPTCHA: always invisible, never takes space */
#recaptcha-container {
    position: fixed;
    bottom: 0; left: 0;
    width: 0; height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ── Step track ──────────────────────────────────────────────────────────── */
.step-track {
    display: flex;
    align-items: center;
    margin-bottom: 2.25rem;
    direction: ltr;
}
.step-node {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.11);
    color: rgba(255,255,255,0.28);
    font-size: 0.77rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    background: transparent;
    position: relative;
}
.step-node.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.1);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.step-node.done {
    border-color: var(--success);
    background: var(--success);
    color: white;
}
.step-node.done::after {
    content: '✓';
    font-size: 0.8rem;
}
.step-connector {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.07);
    transition: background 0.5s ease;
    margin: 0 4px;
}
.step-connector.done { background: var(--success); }

/* ── Form headings ───────────────────────────────────────────────────────── */
.form-head {
    margin-bottom: 1.75rem;
}
.form-head-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}
.form-head-sub {
    font-size: 0.86rem;
    color: rgba(255,255,255,0.38);
    line-height: 1.65;
}

/* ── Alert box ───────────────────────────────────────────────────────────── */
.af-alert {
    display: none;
    padding: 0.7rem 1rem;
    border-radius: 9px;
    font-size: 0.84rem;
    margin-bottom: 1.1rem;
    border: 1px solid;
    line-height: 1.5;
}
.af-alert.danger  { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.25);  color: #fca5a5; }
.af-alert.success { background: rgba(34,197,94,0.08);  border-color: rgba(34,197,94,0.25);  color: #86efac; }
.af-alert.info    { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.25); color: #a5b4fc; }
.af-alert.show    { display: block; animation: alertIn 0.2s ease; }
@keyframes alertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.af-field { margin-bottom: 1rem; }

.af-label {
    display: block;
    font-size: 0.81rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.42rem;
}
.af-label .opt {
    font-weight: 400;
    color: rgba(255,255,255,0.25);
    font-size: 0.74rem;
}

.af-input {
    width: 100%;
    padding: 0.72rem 1rem;
    background: rgba(255,255,255,0.035);
    border: 1.5px solid rgba(255,255,255,0.085);
    border-radius: 10px;
    color: white;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    font-family: 'Alexandria', sans-serif;
}
.af-input::placeholder { color: rgba(255,255,255,0.17); }
.af-input:focus {
    border-color: rgba(99,102,241,0.7);
    background: rgba(99,102,241,0.045);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.af-input.err  { border-color: rgba(239,68,68,0.5);  background: rgba(239,68,68,0.04); }
.af-input.ok   { border-color: rgba(34,197,94,0.4); }

.af-err {
    font-size: 0.76rem;
    color: #f87171;
    margin-top: 0.3rem;
    display: none;
}
.af-err.show { display: block; }

.af-hint {
    font-size: 0.74rem;
    color: rgba(255,255,255,0.25);
    margin-top: 0.3rem;
}

/* ── Password strength ───────────────────────────────────────────────────── */
.strength-wrap { margin-top: 0.45rem; }
.strength-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 0.28rem;
}
.strength-seg {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.07);
    transition: background 0.3s;
}
.str-weak   .strength-seg:nth-child(-n+1) { background: #ef4444; }
.str-fair   .strength-seg:nth-child(-n+2) { background: #f97316; }
.str-good   .strength-seg:nth-child(-n+3) { background: #eab308; }
.str-strong .strength-seg:nth-child(-n+4) { background: #10b981; }

.strength-lbl {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    transition: color 0.3s;
}
.str-weak   .strength-lbl { color: #ef4444; }
.str-fair   .strength-lbl { color: #f97316; }
.str-good   .strength-lbl { color: #eab308; }
.str-strong .strength-lbl { color: #10b981; }

/* ── OTP boxes ───────────────────────────────────────────────────────────── */
.otp-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    direction: ltr;
    margin: 1.25rem 0 0.75rem;
}
.otp-cell {
    width: 50px; height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid rgba(255,255,255,0.09);
    border-radius: 12px;
    color: white;
    outline: none;
    caret-color: var(--primary);
    padding: 0;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
    font-family: 'Alexandria', sans-serif;
}
.otp-cell:focus {
    border-color: var(--primary);
    background: rgba(99,102,241,0.07);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.13);
    transform: scale(1.06);
}
.otp-cell.filled {
    border-color: rgba(34,197,94,0.5);
    background: rgba(34,197,94,0.06);
}

/* ── Resend row ──────────────────────────────────────────────────────────── */
.resend-row {
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.32);
    margin: 0.5rem 0 1rem;
}
.resend-row button {
    background: none; border: none;
    color: var(--accent);
    cursor: pointer; font-size: inherit;
    font-weight: 600; padding: 0; width: auto;
    font-family: 'Alexandria', sans-serif;
    display: inline; transform: none !important;
}
.resend-row button:disabled { color: rgba(255,255,255,0.22); cursor: not-allowed; }
.resend-row button:hover:not(:disabled) { text-decoration: underline; }

/* ── Method tabs ─────────────────────────────────────────────────────────── */
.method-tabs {
    display: flex;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 1.35rem;
}
.method-tab {
    flex: 1; padding: 0.58rem;
    border: none; border-radius: 7px;
    background: transparent;
    color: rgba(255,255,255,0.38);
    font-size: 0.84rem; font-weight: 600;
    cursor: pointer; transition: all 0.22s;
    font-family: 'Alexandria', sans-serif;
    width: auto; transform: none !important;
}
.method-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(99,102,241,0.4);
}
.method-tab:not(.active):hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-auth {
    width: 100%;
    padding: 0.82rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.22s;
    margin-top: 0.4rem;
    font-family: 'Alexandria', sans-serif;
    letter-spacing: 0.01em;
}
.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px rgba(99,102,241,0.42);
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}
.btn-auth:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.btn-auth:disabled { opacity: 0.58; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-auth-ghost {
    width: 100%;
    padding: 0.72rem;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    color: rgba(255,255,255,0.38);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.4rem;
    font-family: 'Alexandria', sans-serif;
    width: 100%;
}
.btn-auth-ghost:hover {
    border-color: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.03);
    transform: none;
}

/* ── Step panels ─────────────────────────────────────────────────────────── */
.step-panel { display: none; }
.step-panel.active {
    display: block;
    animation: panelIn 0.32s cubic-bezier(0.4,0,0.2,1);
}
@keyframes panelIn {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Success screen ──────────────────────────────────────────────────────── */
.success-screen { text-align: center; padding: 0.5rem 0; }
.success-circle {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: rgba(34,197,94,0.1);
    border: 2px solid rgba(34,197,94,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1.5rem;
    animation: popIn 0.45s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.success-screen h2 { font-size: 1.4rem; font-weight: 800; color: white; margin-bottom: 0.45rem; }
.success-screen p  { font-size: 0.87rem; color: rgba(255,255,255,0.4); margin-bottom: 1.75rem; }

/* ── Footer / switch link ────────────────────────────────────────────────── */
.auth-switch {
    text-align: center;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.33);
    margin-top: 1.5rem;
}
.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── Forgot password link ────────────────────────────────────────────────── */
.forgot-link {
    text-align: left;
    margin-top: 0.3rem;
    margin-bottom: 0.1rem;
}
.forgot-link a {
    font-size: 0.79rem;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.2s;
}
.forgot-link a:hover { color: var(--accent); }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spin {
    display: inline-block;
    width: 17px; height: 17px;
    border: 2.5px solid rgba(255,255,255,0.28);
    border-top-color: white;
    border-radius: 50%;
    animation: spinning 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes spinning { to { transform: rotate(360deg); } }

/* ── Phone picker override ───────────────────────────────────────────────── */
.af-phone-wrap .phone-picker-container,
.af-phone-wrap > div {
    background: rgba(255,255,255,0.035) !important;
    border: 1.5px solid rgba(255,255,255,0.085) !important;
    border-radius: 10px !important;
}
.af-phone-wrap input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
    body.auth-body {
        overflow-y: auto;
        height: auto;
    }

    .auth-page {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .auth-brand {
        height: auto;
        padding: 2rem 1.75rem 1.75rem;
        flex: none;
    }
    .ab-inner { max-width: 100%; }
    .ab-headline { font-size: 1.5rem; }
    .ab-tagline, .ab-features { display: none; }
    .ab-logo { margin-bottom: 0; }

    .auth-form-panel {
        width: 100%;
        height: auto;
        flex: 1;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.055);
    }
    .afp-inner {
        min-height: auto;
        padding: 2rem 1.5rem 2.5rem;
    }
}

@media (max-width: 480px) {
    .afp-inner  { padding: 1.75rem 1.25rem 2rem; }
    .otp-cell   { width: 44px; height: 52px; font-size: 1.35rem; }
}
