/* ============================================================
   DIL AUTHENTICATION — One stylesheet for login, signup and reset
   Responsive, accessible, and intentionally easy to maintain.
   ============================================================ */
:root {
    color-scheme: dark;
    --navy-950: #050d1a;
    --navy-900: #07172d;
    --navy-800: #092448;
    --surface: rgba(9, 27, 52, 0.72);
    --surface-raised: #0b1c35;
    --line: rgba(151, 190, 240, 0.18);
    --line-strong: rgba(142, 190, 255, 0.54);
    --blue: #8ebeff;
    --blue-bright: #1e90ff;
    --text: #f8fafc;
    --text-soft: #a9bad1;
    --text-muted: #849bb7;
    --error: #ffb3be;
    --success: #acf5d6;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy-950); }
body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: linear-gradient(157deg, var(--navy-950) 3%, var(--navy-900) 53%, var(--navy-800));
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 13% 9%, rgba(40, 127, 246, 0.13), transparent 33%),
                radial-gradient(circle at 89% 88%, rgba(25, 133, 221, 0.12), transparent 35%);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid #b7d8ff;
    outline-offset: 3px;
}
.skip-link {
    position: fixed;
    top: -80px;
    left: 12px;
    z-index: 30;
    padding: 10px 16px;
    border-radius: 8px;
    background: #fff;
    color: #061426;
}
.skip-link:focus { top: 12px; }
.shell {
    position: relative;
    z-index: 1;
    width: min(100%, 530px);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    padding: 18px 24px max(24px, env(safe-area-inset-bottom));
}
.site-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 48px;
}
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.site-logo {
    display: block;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    object-fit: cover;
    border: 1px solid rgba(142, 190, 255, .22);
    border-radius: 13px;
    background: #061326;
}
.site-brand-copy { display: grid; gap: 1px; min-width: 0; }
.site-brand-copy strong { font-size: 13.5px; line-height: 1.3; font-weight: 700; }
.site-brand-copy small { color: var(--text-muted); font-size: 10.5px; letter-spacing: .012em; }
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 8px 0;
    color: #b1c8e8;
    font-size: 12px;
    font-weight: 600;
}
.topbar-link:hover, .inline-link:hover { color: #fff; }
.icon {
    display: inline-block;
    width: 19px;
    height: 19px;
    flex: none;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.main {
    width: 100%;
    flex: 1;
    margin: 0 auto;
    padding: clamp(40px, 8vh, 86px) 0 55px;
}
.auth-panel { padding: 0; }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 21px; height: 2px; background: var(--blue); border-radius: 3px; }
h1 { margin: 13px 0 8px; font-size: clamp(22px, 3vw, 26px); line-height: 1.19; letter-spacing: -.045em; font-weight: 700; }
h2 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 28px); line-height: 1.25; letter-spacing: -.035em; }
.description { max-width: 490px; margin: 0 0 29px; color: var(--text-soft); font-size: 13px; line-height: 1.77; }
.panel-heading { margin-bottom: 25px; }
.name-fields { display: grid; grid-template-columns: 1fr; gap: 0; }
.field { position: relative; display: block; min-width: 0; margin-bottom: 14px; }
.field-box {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    background: rgba(255, 255, 255, .034);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.field:focus-within .field-box { border-color: var(--line-strong); background: rgba(142, 190, 255, .05); box-shadow: 0 0 0 3px rgba(142, 190, 255, .06); }
.field-icon { position: absolute; left: 15px; width: 18px; height: 18px; color: #7c96b3; pointer-events: none; }
.field:focus-within .field-icon { color: var(--blue); }
.field-name {
    position: absolute;
    z-index: 2;
    left: 44px;
    top: 18px;
    color: #8b9fba;
    font-size: 14px;
    line-height: 1.45;
    cursor: text;
    transition: top .17s ease, left .17s ease, font-size .17s ease, color .17s ease;
}
.field:focus-within .field-name,
.field.has-value .field-name {
    top: -9px;
    left: 13px;
    padding: 1px 7px;
    background: var(--navy-900);
    border-radius: 5px;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 600;
}
.field:focus-within .field-name { color: var(--blue); }
.field input {
    display: block;
    width: 100%;
    height: 54px;
    min-width: 0;
    padding: 13px 14px 5px 44px;
    border: 0;
    outline: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    caret-color: var(--blue);
    font-size: 14px;
}
.field input:focus-visible { outline: none; }
.field input::placeholder { color: transparent; }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--text); transition: background-color 999999s; }
.field input[type=password], .field input.password-input { padding-right: 58px; }
.eye-button {
    position: absolute;
    top: 7px;
    right: 7px;
    bottom: 7px;
    display: grid;
    place-items: center;
    width: 43px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #b0c9e8;
}
.eye-button:hover { background: rgba(142, 190, 255, .09); }
.helper-row { display: flex; justify-content: flex-end; margin: -1px 0 22px; }
.inline-link { color: #add0ff; font-size: 12px; font-weight: 600; }
.small-note { margin: 5px 0 22px; color: var(--text-muted); font-size: 11.5px; line-height: 1.65; }
.primary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;
    border: 1px solid rgba(166, 207, 255, .4);
    border-radius: 12px;
    background: linear-gradient(115deg, #166bcb, #2188db 65%, #278bcd);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 12px 32px rgba(27, 115, 219, .2), inset 0 1px 0 rgba(255,255,255,.13);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.primary-action:hover:not(:disabled) { transform: translateY(-1px); background: linear-gradient(115deg,#257bdf,#2d96ed 65%,#2999da); box-shadow: 0 18px 36px rgba(27,115,219,.26); }
.primary-action .spinner { display: none; }
.primary-action.is-busy .spinner { display: inline-block; }
.primary-action.is-busy .action-icon { display: none; }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.33); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.secondary-action {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 47px;
    border: 1px solid rgba(151,190,240,.19);
    border-radius: 11px;
    background: rgba(255,255,255,.035);
    color: #dbe8fb;
    font-weight: 600;
    font-size: 12.5px;
}
.secondary-action:hover { background: rgba(142,190,255,.075); border-color: rgba(142,190,255,.34); }
.account-area { margin-top: 25px; padding-top: 19px; border-top: 1px solid rgba(151,190,240,.14); }
.account-label { display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 11px; }
.action-stack { display: grid; gap: 11px; }
/* High-contrast, responsive feedback toast for login, signup and reset. */
.toast-notification {
    position: fixed;
    z-index: 9999;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: min(440px, calc(100vw - 28px));
    max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    padding: 12px 16px;
    border: 1px solid #fa6178;
    border-radius: 12px;
    background: linear-gradient(135deg, #831b32 0%, #621529 100%);
    box-shadow: 0 12px 32px rgba(29, 3, 12, .45), inset 0 1px 0 rgba(255, 255, 255, .10);
    color: #fff4f5;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
    white-space: normal;
    pointer-events: none;
}
.toast-notification::before {
    content: "!";
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}
/* Success keeps a distinct green appearance. */
.toast-notification.success {
    border-color: #43dba7;
    background: linear-gradient(135deg, #105a45, #0d4239);
    color: #eafff5;
    box-shadow: 0 12px 32px rgba(2, 35, 26, .4);
}
.toast-notification.success::before {
    content: "✓";
    background: rgba(255, 255, 255, .13);
}
.toast-notification[hidden] { display: none !important; }
@media (max-width: 480px) {
    .toast-notification {
        top: max(12px, env(safe-area-inset-top));
        max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
        padding: 12px 14px;
        gap: 9px;
        font-size: 12.5px;
    }
}
@media (max-width: 350px) {
    .toast-notification { max-width: calc(100vw - 20px); padding: 11px 12px; gap: 7px; font-size: 12px; }
    .toast-notification::before { flex-basis: 20px; width: 20px; height: 20px; }
}

/* Signup and reset keep the same native-style top row, not a site-wide navigation. */
.flow-header { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 5px; width: 100%; min-height: 46px; }
.flow-back { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(151,190,240,.14); border-radius: 10px; color: #dce8f7; background: rgba(255,255,255,.05); }
.flow-back:hover { background: rgba(142,190,255,.12); }
.flow-back .icon { width: 20px; height: 20px; }
.flow-back[hidden] { visibility: hidden !important; display: grid !important; }
.flow-title { text-align: center; color: #dce8f7; font-size: 13px; font-weight: 600; }
.eyebrow-logo { width: 25px; height: 25px; object-fit: contain; border-radius: 6px; flex: none; }
.eyebrow { font-size: 9px; letter-spacing: .12em; }
.eyebrow:has(.eyebrow-logo)::before { display: none; }
.legal-note { color: var(--text-muted); font-size: 11px; line-height: 1.7; margin: 21px 0 0; }

.step-bar { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; margin: 0 0 29px; }
.step-bar span { height: 3px; border-radius: 99px; background: rgba(142,190,255,.17); transition: background .25s ease; }
.step-bar span.done { background: #8ebeff; }
.step-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: #a5bad5; font-size: 11px; font-weight: 600; }
.step-meta strong { color: #b4d6ff; }
.subtle-box { margin: 0 0 23px; padding: 13px 15px; border: 1px solid rgba(142,190,255,.17); border-radius: 11px; background: rgba(142,190,255,.052); color: #b9cce2; font-size: 12px; line-height: 1.7; }
.masked-email { color: #f0f6ff; font-weight: 600; overflow-wrap: anywhere; }
.code-input {
    width: 100%;
    height: 61px;
    margin: 0 0 15px;
    padding: 8px 15px;
    border: 1px solid rgba(142,190,255,.32);
    border-radius: 12px;
    outline: none;
    background: rgba(255,255,255,.04);
    color: #fff;
    text-align: center;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: .55em;
    font-variant-numeric: tabular-nums;
}
.code-input:focus { border-color: #a7d0ff; box-shadow: 0 0 0 3px rgba(142,190,255,.09); }
.code-input::placeholder { color: #58708f; }
.resend-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: center; margin-top: 19px; color: #91a7c0; font-size: 11.5px; }
.resend-button { border: 0; background: none; color: #add2ff; font-size: 11.5px; font-weight: 700; padding: 6px; }
.resend-button:hover:not(:disabled) { text-decoration: underline; }
.resend-button:disabled { opacity: .55; }
.form-actions { display: grid; gap: 12px; }
.back-inline { display: inline-flex; gap: 7px; align-items: center; border: 0; background: none; color: #a6beda; padding: 12px 1px; font-size: 12px; font-weight: 600; }
.back-inline:hover { color: white; }
.success-mark { display: grid; place-items: center; width: 75px; height: 75px; margin-bottom: 23px; border: 1px solid rgba(52,211,153,.34); border-radius: 22px; color: #83eabf; background: rgba(52,211,153,.11); }
.success-mark .icon { width: 36px; height: 36px; }
.page-footer { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 5px 0; color: #7189a8; font-size: 9px; letter-spacing: .12em; font-weight: 600; text-align: center; text-transform: uppercase; }
.page-footer::before { content: ""; display: inline-block; width: 19px; height: 1px; background: rgba(142,190,255,.4); }
@media (min-width: 900px) {
    /* Never put the form in a desktop-only card: match the native full-screen layout. */
    .auth-panel { padding: 0; border: 0; background: none; box-shadow: none; }
}
@media (max-width: 600px) {
    .shell { padding: 18px 20px max(20px, env(safe-area-inset-bottom)); }
    .main { width: 100%; padding: 52px 0 38px; }
    .site-logo { width: 41px; height: 41px; border-radius: 11px; }
    .site-brand-copy strong { font-size: 12px; }
    .site-brand-copy small { font-size: 9.5px; }
    .topbar-link { font-size: 11px; }
    .description { margin-bottom: 27px; }
}
@media (max-width: 385px) {
    .shell { padding-right: 16px; padding-left: 16px; }
    .site-brand { gap: 7px; }
    .site-brand-copy strong { font-size: 10.5px; }
    .site-brand-copy small { font-size: 8px; }
    .topbar-link { font-size: 10px; }
    .code-input { font-size: 22px; letter-spacing: .4em; }
}
@media (max-height: 660px) {
    .main { padding-top: 24px; padding-bottom: 25px; }
    .step-bar { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* Step headings receive programmatic focus for screen readers; no visual focus rectangle. */
.main h1:focus { outline: none; }

/* The app shows a clean form with no surrounding panel on all screen sizes. */
.auth-panel { padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; }
@media (max-width: 385px) { .eyebrow { font-size: 8px; } .flow-title { font-size: 12px; } }
@media (max-width: 350px) { .shell { padding-left: 15px; padding-right: 15px; } .toast-notification { font-size: 11px; } }

/* Native-style individual verification boxes. Responsive down to 320px. */
.otp-grid { display:grid; grid-template-columns:repeat(var(--otp-count),minmax(0,1fr)); gap:clamp(6px,1vw,11px); width:100%; margin:12px 0 19px; }
.otp-cell { width:100%; min-width:0; height:clamp(48px,6vw,60px); text-align:center; color:#f8fafc; font-size:clamp(17px,2.8vw,23px); font-weight:700; font-variant-numeric:tabular-nums; text-transform:uppercase; border:1px solid rgba(142,190,255,.23); border-radius:11px; background:rgba(255,255,255,.038); outline:none; caret-color:#8ebeff; }
.otp-cell:focus { border-color:#8ebeff; background:rgba(142,190,255,.07); box-shadow:0 0 0 2px rgba(142,190,255,.09); }
@media (max-width:350px) { .otp-cell {height:47px;border-radius:9px;font-size:17px;} }
/* Signup success screen only: accessible, responsive post-verification state. */
[data-signup-step="success"].signup-success {
    width: 100%;
    min-height: min(660px, calc(100dvh - 210px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 0 38px;
    text-align: center;
}
.signup-success-inner { width: min(100%, 430px); margin-inline: auto; }
.signup-success-icon {
    width: 90px; height: 90px; margin: 0 auto 26px;
    display: grid; place-items: center;
    background: radial-gradient(circle at 30% 25%, #174d4d, #0a3439);
    color: #b6ffe2;
    border: 1px solid rgba(118, 240, 187, .4);
    border-radius: 26px;
    box-shadow: 0 0 0 8px rgba(48, 204, 150, .05), 0 18px 48px rgba(0, 0, 0, .22);
}
.signup-success-icon .icon { width: 44px; height: 44px; stroke-width: 2.4; }
.signup-success-status {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 7px 12px; border: 1px solid rgba(108, 220, 173, .22);
    border-radius: 100px; color: #a8ebd0; background: rgba(62, 197, 147, .075);
    font-size: 11px; font-weight: 700; letter-spacing: .01em;
}
.signup-success-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #78e3b4; }
.signup-success h1 { margin: 19px 0 13px; font-size: clamp(29px, 6vw, 39px); line-height: 1.14; letter-spacing: -.05em; }
.signup-success-description { max-width: 390px; margin: 0 auto; color: var(--text-soft); font-size: 13.5px; line-height: 1.85; }
.signup-success-actions { margin: 35px 0 0; gap: 11px; }
.signup-success-actions .primary-action { min-height: 54px; }
.signup-success-actions .primary-action .icon { margin-left: 3px; }
.signup-success-redirect { margin: 20px auto 0; max-width: 355px; color: var(--text-muted); font-size: 11px; line-height: 1.65; }
@media (max-width: 480px) {
    [data-signup-step="success"].signup-success { min-height: calc(100dvh - 205px); padding: 18px 0 24px; }
    .signup-success-icon { width: 78px; height: 78px; border-radius: 23px; margin-bottom: 22px; }
    .signup-success-icon .icon { width: 38px; height: 38px; }
    .signup-success-description { font-size: 12.5px; line-height: 1.8; }
    .signup-success-actions { margin-top: 29px; }
}
@media (max-height: 640px) {
    [data-signup-step="success"].signup-success { min-height: 0; padding: 6px 0 16px; }
    .signup-success-icon { width: 68px; height: 68px; margin-bottom: 14px; border-radius: 20px; }
    .signup-success-icon .icon { width: 34px; height: 34px; }
    .signup-success h1 { margin: 11px 0 8px; }
    .signup-success-actions { margin-top: 22px; }
    .signup-success-redirect { margin-top: 11px; }
}
