/**
 * auth.css — login and signup pages. Loaded on top of site.css.
 * Mobile-first: the brand panel is hidden below 1024px so the form gets the
 * full viewport, inputs are 16px (prevents iOS zoom-on-focus), and touch
 * targets are at least 44px.
 */

.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 70px); }

/* ── Brand panel ── */
.auth__panel {
    background: linear-gradient(160deg, #1a1030 0%, #2b1a4a 45%, #3d1f2e 100%);
    padding: 3rem; display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden;
}
.auth__panel::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(40rem 20rem at 20% 10%, rgba(124,58,237,.28), transparent 60%),
                radial-gradient(34rem 18rem at 85% 85%, rgba(234,88,12,.22), transparent 60%);
    pointer-events: none;
}
.auth__panel > div { position: relative; max-width: 27rem; }
.auth__status {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px; padding: .45rem 1rem; margin-bottom: 2rem;
    color: rgba(255,255,255,.82); font-size: .82rem; font-weight: 500;
}
.auth__status .dot {
    width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
    animation: authPulse 1.8s ease-in-out infinite;
}
@keyframes authPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.5); }
    50%     { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}
.auth__headline { color: #fff; font-size: 2rem; line-height: 1.2; margin-bottom: .6rem; }
.auth__headline .grad {
    background: linear-gradient(135deg,#a78bfa,#fb923c);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth__sub { color: rgba(255,255,255,.6); margin-bottom: 2rem; }

.auth__channels { display: flex; gap: .75rem; margin-bottom: 2.25rem; flex-wrap: wrap; }
.auth__channel {
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px; padding: .85rem 1rem; text-align: center; flex: 1; min-width: 118px;
}
.auth__channel .channel-badge { margin-bottom: .45rem; }
.auth__channel strong { display: block; color: #fff; font-size: .8rem; }
.auth__channel span   { display: block; color: rgba(255,255,255,.45); font-size: .72rem; }

.auth__features { display: flex; flex-direction: column; gap: 1.1rem; }
.auth__features li { display: flex; gap: .85rem; align-items: flex-start; }
.auth__ficon {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    background: rgba(255,255,255,.1); display: flex; align-items: center;
    justify-content: center; font-size: 1.05rem;
}
.auth__features strong { display: block; color: #fff; font-size: .87rem; }
.auth__features em { display: block; font-style: normal; color: rgba(255,255,255,.5); font-size: .78rem; }

/* ── Form side ── */
.auth__main {
    display: flex; align-items: center; justify-content: center;
    padding: 2.5rem 1.25rem;
    background: linear-gradient(180deg, #faf8ff 0%, #fff 45%, #fff8f3 100%);
}
.auth__card-wrap { width: 100%; max-width: 26rem; }
.auth__mobile-brand { display: none; text-align: center; margin-bottom: 1.5rem; }
.auth__mobile-brand p { color: var(--ink-faint); font-size: .85rem; margin-bottom: .5rem; }
.auth__mobile-brand .channel-badges { justify-content: center; }

.auth__card {
    background: #fff; border: 1px solid var(--line); border-radius: 20px;
    padding: 2rem; box-shadow: var(--shadow-lg);
}
.auth__card-head { text-align: center; margin-bottom: 1.75rem; }
.auth__card-head h2 { font-size: 1.75rem; margin-bottom: .35rem; }
.auth__card-head p  { color: var(--ink-faint); font-size: .88rem; margin: 0; }

.auth__form { display: flex; flex-direction: column; gap: 1.15rem; }
.auth__form .field { margin-bottom: 0; }

/* 16px inputs stop iOS Safari zooming on focus */
.auth__card input[type="text"], .auth__card input[type="email"],
.auth__card input[type="password"], .auth__card input[type="tel"],
.modal input {
    font-size: 16px; padding: .8rem .95rem; min-height: 48px;
}

.input-affix { position: relative; }
.input-affix input { padding-right: 3rem; }
.input-affix__btn {
    position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--ink-faint); cursor: pointer; border-radius: 8px;
}
.input-affix__btn:hover { color: var(--brand); background: var(--brand-soft); }
.input-affix__btn svg { width: 20px; height: 20px; }

.hp-field { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; }

.caps-warning { color: #b45309; font-size: .78rem; margin: .35rem 0 0; font-weight: 600; }

.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .86rem; color: var(--ink-soft); }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand); }
.linkish {
    background: none; border: none; padding: .25rem 0; cursor: pointer;
    color: var(--brand); font-weight: 600; font-size: .86rem; font-family: inherit;
}
.linkish:hover { text-decoration: underline; }

.auth__divider { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0; }
.auth__divider::before, .auth__divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth__divider span { font-size: .72rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.auth__fineprint { text-align: center; font-size: .76rem; color: var(--ink-faint); margin: .6rem 0 0; }

.auth__security {
    margin-top: 1.5rem; padding-top: 1.15rem; border-top: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    color: var(--ink-faint); font-size: .74rem; flex-wrap: wrap;
}
.auth__security svg { width: 15px; height: 15px; }
.auth__security i { color: var(--line); font-style: normal; }

/* ── Alerts ── */
.alert {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .9rem 1rem; border-radius: 12px; margin-bottom: 1.35rem;
}
.alert strong { display: block; font-size: .87rem; }
.alert p { margin: .25rem 0 0; font-size: .79rem; }
.alert--error { background: var(--red-soft); border-left: 4px solid var(--red); color: #991b1b; }
.alert--lock  { background: var(--red-soft); border-left: 4px solid var(--red); color: #991b1b; }
.alert--ok    { background: var(--green-soft); border-left: 4px solid var(--green); color: #065f46; }
.alert__icon { font-size: 1.15rem; line-height: 1; }

/* ── Modal ── */
.modal {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 1.25rem;
    animation: modalIn .16s ease-out;
}
.modal[hidden] { display: none; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal__box {
    background: #fff; border-radius: 18px; padding: 2rem;
    width: 100%; max-width: 26rem; position: relative;
    box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.modal__close {
    position: absolute; right: .75rem; top: .75rem;
    width: 40px; height: 40px; border: none; background: none;
    font-size: 1.8rem; line-height: 1; color: var(--ink-faint); cursor: pointer; border-radius: 10px;
}
.modal__close:hover { color: var(--red); background: var(--red-soft); }
.modal__box h3 { font-size: 1.4rem; margin-bottom: .3rem; }
.modal__lead { color: var(--ink-faint); font-size: .86rem; margin-bottom: 1.35rem; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .auth { grid-template-columns: 1fr; min-height: auto; }
    .auth__panel { display: none; }
    .auth__mobile-brand { display: block; }
    .auth__main { padding: 2rem 1rem 3rem; }
}
@media (max-width: 480px) {
    .auth__card { padding: 1.5rem 1.25rem; border-radius: 16px; }
    .auth__card-head h2 { font-size: 1.5rem; }
    .auth__row { flex-direction: row; }
    .modal__box { padding: 1.5rem 1.25rem; }
}

/* ── Signup-specific ── */
.auth__card-wrap--wide { max-width: 30rem; }
.feedback { font-size: .78rem; margin: .35rem 0 0; min-height: 1em; }
.feedback--ok  { color: var(--green); }
.feedback--err { color: var(--red); }

.strength { margin-top: .5rem; }
.strength__bar { height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; }
.strength__bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .25s, background .25s; }
.strength[data-level="1"] .strength__bar span { width: 20%; background: #ef4444; }
.strength[data-level="2"] .strength__bar span { width: 40%; background: #f59e0b; }
.strength[data-level="3"] .strength__bar span { width: 60%; background: #eab308; }
.strength[data-level="4"] .strength__bar span { width: 80%; background: #22c55e; }
.strength[data-level="5"] .strength__bar span { width: 100%; background: var(--green); }
.strength__label { font-size: .74rem; color: var(--ink-faint); margin: .3rem 0 0; }

.checkbox--terms { align-items: flex-start; gap: .6rem; font-size: .84rem; line-height: 1.5; }
.checkbox--terms input { margin-top: .15rem; flex-shrink: 0; }
.checkbox--terms a { color: var(--brand); font-weight: 600; }
.checkbox--terms a:hover { text-decoration: underline; }

.otp-input {
    text-align: center; font-size: 1.6rem !important; font-weight: 700;
    letter-spacing: .5em; text-indent: .5em; font-variant-numeric: tabular-nums;
}
.resend { display: block; width: 100%; text-align: center; margin-top: .9rem; }

/* intl-tel-input fits the field styling */
.iti { width: 100%; }
.iti__flag-container { z-index: 3; }
.iti--separate-dial-code .iti__selected-flag { background: transparent; border-radius: 10px 0 0 10px; }
