/* =========================================================
   SecureVault - Login (Indigo / Aurora redesign)
   Light / dark follows the system theme (prefers-color-scheme).
   Same class names as before, so login.php and master_login.php
   work without any markup change.
   ========================================================= */

:root {
    color-scheme: light dark;

    --bg: #f5f6fb;
    --bg-blob-1: #e3e6ff;
    --bg-blob-2: #f0e4ff;
    --bg-blob-3: #dcf3ff;

    --surface: #ffffff;
    --surface-2: #f6f7fc;
    --line: #e2e5f0;
    --text: #151a33;
    --muted: #646b8a;
    --accent: #4f46e5;
    --focus: #6366f1;

    --btn-from: #4f46e5;
    --btn-to: #7c5cf0;
    --btn-text: #ffffff;
    --btn-shadow: rgba(79, 70, 229, .32);

    --side-1: #0b0d24;
    --side-2: #14115a;
    --side-3: #2a1670;
    --side-text: #f1f3ff;
    --side-muted: #aab0d8;
    --row-bg: rgba(255, 255, 255, .06);
    --row-line: rgba(255, 255, 255, .13);
    --row-shadow: rgba(8, 8, 40, .38);
    --pill-bg: #d9f7ea;
    --pill-text: #167a52;
    --icon-bg: #e9e8ff;

    --ok-bg: #dcf6ea;
    --ok-line: #a9e3c6;
    --ok-text: #1d6a46;
    --danger-bg: #fff0ef;
    --danger-line: #f5c2bd;
    --danger-text: #a3302a;
    --info-bg: #ecebff;
    --info-line: #cfcdfb;

    --shadow: 0 1px 2px rgba(30, 30, 90, .06), 0 24px 60px rgba(60, 55, 160, .16);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0e1a;
        --bg-blob-1: #131a38;
        --bg-blob-2: #181a44;
        --bg-blob-3: #0a2a3c;

        --surface: #131a2f;
        --surface-2: #0b1122;
        --line: #2a3358;
        --text: #eef1fd;
        --muted: #9aa4c8;
        --accent: #a9b6ff;
        --focus: #8b98ff;

        --btn-from: #6366f1;
        --btn-to: #8b5cf6;
        --btn-text: #ffffff;
        --btn-shadow: rgba(110, 100, 255, .3);

        --pill-bg: rgba(110, 231, 183, .14);
        --pill-text: #aeeccf;
        --icon-bg: rgba(165, 180, 252, .14);

        --ok-bg: rgba(110, 231, 183, .12);
        --ok-line: rgba(110, 231, 183, .35);
        --ok-text: #b7f0d6;
        --danger-bg: rgba(248, 113, 113, .12);
        --danger-line: rgba(248, 113, 113, .4);
        --danger-text: #fecaca;
        --info-bg: rgba(139, 147, 255, .13);
        --info-line: rgba(139, 147, 255, .32);

        --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 24px 60px rgba(0, 0, 0, .55);
    }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (min-width: 881px) {
    html { font-size: clamp(13px, min(1.75vh, 1.1vw), 17px); }
}

body, h1, h2, h3, p, ul { margin: 0; padding: 0; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input  { font: inherit; color: inherit; margin: 0; outline: none; }
a { color: inherit; }

input::placeholder { color: var(--muted); opacity: .6; }

.hidden { display: none !important; }

.default-submit, .sv-default-submit {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); opacity: 0; pointer-events: none; border: 0;
}

/* ---------- Page ---------- */
body {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
    background-image:
        radial-gradient(55rem 38rem at 100% 0%, var(--bg-blob-2), transparent 60%),
        radial-gradient(50rem 36rem at 0% 100%, var(--bg-blob-3), transparent 60%),
        radial-gradient(40rem 30rem at 60% 40%, var(--bg-blob-1), transparent 65%);
    background-attachment: fixed;
}

button, input { font-family: inherit; }

/* =========================================================
   LAYOUT
   ========================================================= */
.sv-shell {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    gap: 1rem;
    padding: 1rem;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ----- Side panel (always dark, both themes) ----- */
.sv-side {
    --accent: #b4bfff;
    --text: #f1f3ff;
    --muted: #aab0d8;
    --pill-text: #8ff0c9;

    position: relative;
    overflow: hidden;
    padding: 2.25rem 2.5rem;
    border-radius: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--side-text);
    background:
        radial-gradient(34rem 26rem at 90% -8%, rgba(124, 92, 240, .55), transparent 62%),
        radial-gradient(30rem 24rem at -10% 105%, rgba(34, 197, 220, .28), transparent 62%),
        linear-gradient(160deg, var(--side-1) 0%, var(--side-2) 58%, var(--side-3) 100%);
    box-shadow: 0 30px 70px rgba(30, 20, 120, .3);
}

/* fine grid texture */
.sv-side::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 2.5rem 2.5rem;
    -webkit-mask-image: radial-gradient(75% 70% at 55% 45%, #000, transparent 85%);
    mask-image: radial-gradient(75% 70% at 55% 45%, #000, transparent 85%);
    pointer-events: none;
}
/* soft glow */
.sv-side::after {
    content: '';
    position: absolute;
    width: 22rem; height: 22rem; right: -7rem; bottom: -9rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, .45), transparent 68%);
    pointer-events: none;
}

.sv-brand {
    position: relative; z-index: 2;
    display: flex; align-items: center; gap: 0;
    font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif;
    font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em;
}
.sv-brand span { color: var(--accent); }
.sv-mobile-brand span { color: var(--accent); }
.sv-brand-mark {
    width: 2.5rem; height: 2.5rem; border-radius: .875rem;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
    color: var(--btn-text);
    font-size: 1.0625rem;
    box-shadow: 0 6px 18px var(--btn-shadow);
}

.sv-side-body {
    position: relative; z-index: 2;
    margin: auto 0;
    padding: 1rem 0;
    display: grid; gap: 2rem;
}

.sv-pitch { max-width: 100%; }

.sv-pitch h2 {
    font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif;
    font-size: clamp(1.75rem, 2.2vw, 2.65rem);
    line-height: 1.06; font-weight: 700; letter-spacing: -.025em;
    background: linear-gradient(120deg, #ffffff 25%, #c4b5fd 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

.sv-pitch p { margin-top: .9rem; max-width: 30rem; font-size: 1rem; color: var(--side-muted); }

/* product preview */
.sv-vault {
    position: absolute;
    left: 0; top: 1.75rem;
    width: min(30rem, 100%); max-width: 100%;
    margin: 0;
    z-index: 1;
    padding: 1rem;
    border-radius: 1.25rem;
    background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04));
    border: 1px solid var(--row-line);
    box-shadow: 0 24px 56px var(--row-shadow), inset 0 1px 0 rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.sv-vault-head {
    display: flex; align-items: center; gap: .625rem;
    padding: .125rem .25rem .875rem;
    font-weight: 600; font-size: .9375rem;
}
.sv-vault-head i { color: var(--accent); }
.sv-dots { display: inline-flex; gap: .375rem; margin-right: .25rem; }
.sv-dots i { width: .625rem; height: .625rem; border-radius: 50%; }
.sv-dots i:nth-child(1) { background: #ff7a8a; }
.sv-dots i:nth-child(2) { background: #ffcf6b; }
.sv-dots i:nth-child(3) { background: #5be3a8; }
.sv-search {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .25rem .75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    font-size: .75rem; font-weight: 500; color: var(--side-muted);
}
.sv-search i { color: var(--side-muted); font-size: .6875rem; }
.sv-vault-head em {
    margin-left: auto;
    font-style: normal; font-weight: 500; font-size: .75rem;
    color: var(--side-muted);
}

.sv-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .625rem .5rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.sv-tile {
    flex-shrink: 0;
    width: 2.25rem; height: 2.25rem; border-radius: .625rem;
    display: grid; place-items: center;
    font-size: .875rem;
}
.sv-tile.t1 { background: rgba(96, 165, 250, .2);  color: #93c5fd; }
.sv-tile.t2 { background: rgba(52, 211, 153, .2);  color: #6ee7b7; }
.sv-tile.t3 { background: rgba(167, 139, 250, .22); color: #c4b5fd; }
.sv-tile.t4 { background: rgba(251, 191, 36, .2);  color: #fcd34d; }

.sv-item-txt { min-width: 0; }
.sv-item-txt b { display: block; font-size: .875rem; font-weight: 600; }
.sv-item-txt span { display: block; font-size: .75rem; color: var(--side-muted); }
.sv-item code {
    margin-left: auto;
    font-family: inherit; font-size: .875rem; letter-spacing: .12rem;
    color: var(--side-muted);
}

.sv-toast {
    position: absolute;
    right: -.75rem; bottom: -1.5rem;
    display: flex; align-items: center; gap: .75rem;
    padding: .625rem .875rem .625rem .625rem;
    border-radius: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(5, 5, 40, .45);
    color: var(--text);
}
.sv-toast, .sv-chip, .sv-health, .sv-recent {
    --text: #151a33; --muted: #646b8a; --accent: #4f46e5; --line: #e2e5f0; --surface: #ffffff;
}
@media (prefers-color-scheme: dark) {
    .sv-toast, .sv-chip, .sv-health, .sv-recent {
        --text: #eceffd; --muted: #98a0c4; --accent: #a5b4fc; --line: #2b3157; --surface: #161a35;
    }
}
.sv-toast-ico {
    width: 2rem; height: 2rem; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--pill-bg); color: var(--pill-text);
    font-size: .8125rem;
}
.sv-toast b { display: block; font-size: .8125rem; font-weight: 600; }
.sv-toast span:last-child { display: block; font-size: .75rem; color: var(--muted); }

.sv-chip {
    position: absolute;
    right: 1.25rem; top: -1.5rem;
    display: flex; align-items: center; gap: .625rem;
    padding: .5rem .875rem .5rem .5rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 14px 30px rgba(5, 5, 40, .4);
    color: var(--text);
    font-size: .8125rem;
}
.sv-chip i {
    width: 1.75rem; height: 1.75rem; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--icon-bg); color: var(--accent); font-size: .75rem;
}
.sv-chip span { color: var(--muted); }

.sv-stage { position: relative; height: 22.5rem; }
.sv-stage::before {
    content: '';
    position: absolute; inset: -1rem -2rem;
    background-image: radial-gradient(rgba(255, 255, 255, .28) 1px, transparent 1.6px);
    background-size: 1.375rem 1.375rem;
    -webkit-mask-image: radial-gradient(70% 80% at 72% 45%, #000, transparent 75%);
    mask-image: radial-gradient(70% 80% at 72% 45%, #000, transparent 75%);
    pointer-events: none;
}

.sv-health, .sv-recent {
    position: absolute; z-index: 2;
    display: flex; align-items: center; gap: .875rem;
    padding: .875rem 1rem;
    border-radius: 1.125rem;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(5, 5, 40, .4);
    color: var(--text);
}
.sv-health { right: 0; top: 0; width: 15.5rem; }
.sv-recent { right: 2.5rem; bottom: 1.25rem; width: 17rem; }

.sv-ring {
    flex-shrink: 0;
    width: 3.25rem; height: 3.25rem; border-radius: 50%;
    display: grid; place-items: center;
    background: conic-gradient(#34d399 0 100%);
    position: relative;
    color: var(--pill-text);
}
.sv-ring::before {
    content: '';
    position: absolute; inset: .3125rem;
    border-radius: 50%;
    background: var(--surface);
}
.sv-ring i { position: relative; font-size: 1rem; }

.sv-health b, .sv-recent b { display: block; font-size: .875rem; font-weight: 600; }
.sv-health div span, .sv-recent div span { display: block; font-size: .8125rem; color: var(--muted); }

.sv-avatar {
    flex-shrink: 0;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
    color: var(--btn-text); font-size: .875rem;
}

@media (max-width: 1440px) {
    .sv-health, .sv-recent { display: none; }
}

/* trust row */
.sv-trust {
    position: relative; z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: .875rem;
    max-width: 46rem;
}
.sv-trust-item {
    display: flex; align-items: center; gap: .75rem;
    min-width: 0;
    padding: .75rem .875rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--row-line);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.sv-trust-item .sv-tile { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.sv-trust-item b {
    display: block;
    font-size: .875rem; font-weight: 600; line-height: 1.25;
    color: var(--side-text);
}
.sv-trust-item code {
    display: flex; align-items: center; gap: .4375rem;
    margin-top: .25rem;
    font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: .6875rem; font-weight: 500;
    color: var(--pill-text);
}
.sv-trust-item code::before {
    content: '';
    flex-shrink: 0;
    width: .4375rem; height: .4375rem; border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 .1875rem rgba(52, 211, 153, .25), 0 0 .75rem rgba(52, 211, 153, .7);
}

/* ----- Form side ----- */
.sv-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.sv-help { margin-top: 1.25rem; font-size: .8125rem; color: var(--muted); text-align: center; }

.sv-card {
    position: relative;
    width: 100%; max-width: 31rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.75rem;
    padding: 2.75rem 2.75rem 1.75rem;
    box-shadow: var(--shadow);
}
/* gradient accent line on top of the card */
.sv-card::before {
    content: '';
    position: absolute; left: 2.75rem; right: 2.75rem; top: -1px; height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--btn-from), var(--btn-to), #22d3ee);
}

.sv-card .sv-head h1 { font-size: 2.375rem; }
.sv-card .sv-head p  { font-size: 1.0625rem; margin-top: .625rem; }
.sv-card .sv-form    { margin-top: 1.75rem; gap: 1.25rem; }
.sv-card .sv-label   { font-size: .9375rem; margin-bottom: .4375rem; }
.sv-card .sv-input   { padding: .875rem 1.0625rem; font-size: 1.0625rem; border-radius: 1rem; }
.sv-card .sv-pass .sv-input { padding-right: 3rem; }
.sv-card .sv-btn     { padding: 1rem 1.25rem; font-size: 1.0625rem; border-radius: 1rem; }
.sv-card .sv-ghost   { padding: .8125rem 1rem; border-radius: 1rem; }
.sv-card .sv-code    { font-size: 1.75rem; }

.sv-mobile-brand { display: none; }

.sv-head h1 {
    font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif;
    font-size: 1.75rem; line-height: 1.12; font-weight: 700; letter-spacing: -.03em;
}
.sv-head p { margin-top: .5rem; color: var(--muted); font-size: .9375rem; }

.sv-form { margin-top: 1.5rem; display: grid; gap: 1.125rem; }

.sv-label { display: block; margin-bottom: .375rem; font-size: .875rem; font-weight: 600; }

.sv-input,
.cyber-input {
    display: block; width: 100%;
    padding: .72rem .95rem;
    border-radius: .875rem;
    border: 1.5px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sv-input:hover,
.cyber-input:hover { border-color: color-mix(in srgb, var(--focus) 45%, var(--line)); }
.sv-input:focus,
.cyber-input:focus {
    border-color: var(--focus);
    background: var(--surface);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent);
}

.sv-pass, .password-wrap { position: relative; }
.sv-pass .sv-input, .password-wrap .cyber-input { padding-right: 2.75rem; }

.sv-eye, .toggle-password {
    position: absolute; top: 50%; right: .375rem; transform: translateY(-50%);
    width: 2.25rem; height: 2.25rem; border-radius: .625rem;
    display: grid; place-items: center;
    color: var(--muted);
    transition: color .15s ease, background .15s ease;
}
.sv-eye:hover, .toggle-password:hover { color: var(--accent); background: color-mix(in srgb, var(--focus) 12%, transparent); }

:is(.sv-eye, .sv-btn, .sv-ghost, .sv-text-btn, .sv-switch, .cyber-btn, .master-link, .toggle-password):focus-visible {
    outline: 2px solid var(--focus); outline-offset: 2px;
}

/* ----- reCAPTCHA ----- */
.captcha-wrap { width: 100%; height: 78px; }
.g-recaptcha  { width: 304px; transform-origin: left top; }
.g-recaptcha iframe { border-radius: 12px !important; }

/* ----- Buttons ----- */
.sv-btn,
.cyber-btn {
    position: relative; overflow: hidden;
    width: 100%;
    padding: .85rem 1rem;
    border-radius: .875rem;
    font-weight: 700; letter-spacing: .01em;
    color: var(--btn-text);
    background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
    box-shadow: 0 10px 26px var(--btn-shadow), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.sv-btn::after,
.cyber-btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s ease;
    pointer-events: none;
}
.sv-btn:hover,
.cyber-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 32px var(--btn-shadow), inset 0 1px 0 rgba(255, 255, 255, .25); }
.sv-btn:hover::after,
.cyber-btn:hover::after { transform: translateX(120%); }
.sv-btn:active,
.cyber-btn:active { transform: translateY(1px); }

.sv-divider, .or-divider {
    display: flex; align-items: center; gap: .75rem;
    color: var(--muted); font-size: .8125rem;
}
.sv-divider::before, .sv-divider::after,
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.sv-ghost,
.master-link {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .75rem 1rem;
    border-radius: .875rem;
    border: 1.5px solid var(--line);
    font-size: .9375rem; font-weight: 600;
    text-decoration: none;
    color: var(--text);
    background: transparent;
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.sv-ghost:hover,
.master-link:hover { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 10%, var(--surface)); }
.sv-ghost i, .master-link i { color: var(--accent); }

/* ---------- Back buttons ---------- */
.sv-back,
.master-link.plain {
    display: flex;
    width: 100%;
    margin: .5rem 0 0;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    padding: .8125rem 1rem;
    border-radius: 1rem;
    border: 1.5px solid var(--line);
    background: transparent;
    color: var(--text);
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.sv-back i,
.master-link.plain i {
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--icon-bg);
    color: var(--accent);
    font-size: .6875rem;
    transition: transform .18s ease, background .18s ease, color .18s ease;
}
.sv-back:hover,
.master-link.plain:hover {
    color: var(--text);
    border-color: var(--focus);
    background: color-mix(in srgb, var(--focus) 10%, var(--surface));
}
.sv-back:hover i,
.master-link.plain:hover i {
    transform: translateX(-3px);
    background: var(--focus);
    color: #fff;
}
.sv-back:active,
.master-link.plain:active { transform: translateY(1px); }
.sv-back:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sv-form .sv-back { margin-top: 0; }

/* ----- Messages ----- */
.sv-error, .error-box {
    display: flex; gap: .625rem; align-items: flex-start;
    margin-top: 1.25rem;
    padding: .75rem .875rem;
    border-radius: .875rem;
    border: 1px solid var(--danger-line);
    border-left-width: 4px;
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: .875rem; line-height: 1.35;
    overflow-wrap: anywhere;
    animation: sv-shake .4s ease;
}
.sv-error i, .error-box > i { margin-top: .15rem; }
.error-box > div { display: grid; gap: .125rem; }

@keyframes sv-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.ok-box {
    margin-bottom: 1rem; padding: .75rem .875rem; border-radius: .875rem;
    border: 1px solid var(--ok-line); background: var(--ok-bg); color: var(--ok-text);
    font-size: .875rem;
}

.info-note {
    display: flex; gap: .75rem; padding: .875rem 1rem; border-radius: .875rem;
    background: var(--info-bg); border: 1px solid var(--info-line);
    color: var(--text); font-size: .8125rem; line-height: 1.25rem;
}
.info-note i { color: var(--accent); margin-top: .2rem; }

/* ----- Verification step ----- */
.sv-step {
    display: grid; gap: 1rem;
    padding: 1.125rem;
    border-radius: 1.125rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.sv-step-top { display: flex; gap: .875rem; align-items: flex-start; }
.sv-step-ico {
    flex-shrink: 0;
    width: 2.75rem; height: 2.75rem; border-radius: .875rem;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
    color: var(--btn-text);
    box-shadow: 0 8px 20px var(--btn-shadow);
}
.sv-step-top h3 { font-size: 1rem; font-weight: 600; }
.sv-step-top p  { margin-top: .125rem; font-size: .8125rem; color: var(--muted); }

.sv-code {
    text-align: center;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: 1.5rem; font-weight: 500;
    letter-spacing: .55rem;
    padding: .75rem .5rem .75rem 1rem;
}

.sv-otp-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 1.5rem; font-size: .875rem; color: var(--muted); }
.sv-text-btn { color: var(--accent); font-weight: 600; }
.sv-text-btn:hover { text-decoration: underline; }

.sv-switch {
    justify-self: start;
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .875rem; font-weight: 500; color: var(--muted);
}
.sv-switch:hover { color: var(--text); }

.sv-foot, .footer-text { margin-top: 1.5rem; text-align: center; font-size: .75rem; color: var(--muted); }

/* =========================================================
   LEGACY CENTERED CARD (used by master_login.php etc.)
   ========================================================= */
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.field-label { display: block; margin-bottom: .375rem; font-size: .875rem; font-weight: 600; }
.field-label.light { color: var(--muted); }

.glass {
    position: relative;
    width: calc(100% - 2rem);
    max-width: 28rem;
    margin: 1.5rem 1rem;
    padding: 2.25rem 2rem 1.75rem;
    border-radius: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.glass::before {
    content: '';
    position: absolute; left: 2rem; right: 2rem; top: -1px; height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--btn-from), var(--btn-to), #22d3ee);
}
.scan-line { display: none; }

.brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 2rem; }
.logo {
    width: 4.25rem; height: 4.25rem; border-radius: 1.25rem; margin-bottom: 1rem;
    display: grid; place-items: center;
    font-size: 1.625rem;
    color: var(--btn-text);
    background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
    box-shadow: 0 10px 26px var(--btn-shadow);
}
.brand-title {
    font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif;
    font-size: 2rem; line-height: 2.25rem; font-weight: 700; letter-spacing: -.02em; text-align: center;
}
.brand-title span { color: var(--accent); }
.brand-tagline { margin-top: .5rem; font-size: .875rem; color: var(--muted); text-align: center; }

.glass .brand .logo, .brand .logo { display: none !important; }

/* ---------- master_login.php: "check your inbox" state ---------- */
.mr-sent { text-align: center; }
.mr-sent h2 {
    margin: 0 0 .5rem;
    font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif;
    font-size: 1.625rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em;
    color: var(--text) !important;
}
.mr-sent p { margin: 0; color: var(--muted) !important; font-size: .9375rem; }
.mr-sent p strong, .mr-sent strong { color: var(--text) !important; font-weight: 600; }

.mr-sent-ico {
    width: 4rem; height: 4rem; margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.5rem;
    background: var(--ok-bg) !important;
    border: 1px solid var(--ok-line) !important;
    color: var(--ok-text) !important;
}

.mr-steps {
    list-style: none;
    margin: 1.5rem 0 1.25rem; padding: 1rem 1.125rem;
    display: grid; gap: .875rem;
    text-align: left;
    background: var(--surface-2) !important;
    border: 1px solid var(--line) !important;
    border-radius: 1rem;
}
.mr-steps li {
    display: flex; align-items: center; gap: .75rem;
    margin: 0; padding: 0;
    color: var(--text) !important;
    font-size: .9375rem;
    background: none !important;
}
.mr-steps li b {
    flex-shrink: 0;
    width: 1.625rem; height: 1.625rem; border-radius: 50%;
    display: grid; place-items: center;
    font-size: .8125rem; font-weight: 700;
    background: color-mix(in srgb, var(--accent) 16%, transparent) !important;
    color: var(--accent) !important;
}
.mr-steps li span, .mr-steps li strong { color: var(--text) !important; }

.mr-expire {
    display: inline-flex; align-items: center; gap: .5rem;
    margin: 0 auto 1rem; padding: .5rem .875rem;
    border-radius: 999px;
    font-size: .8125rem;
    background: var(--info-bg) !important;
    border: 1px solid var(--info-line) !important;
    color: var(--text) !important;
}
.mr-expire i { color: var(--accent) !important; }

.mr-small { margin-top: .25rem !important; font-size: .8125rem !important; color: var(--muted) !important; }
.mr-small a { color: var(--accent) !important; font-weight: 600; text-decoration: none; }
.mr-small a:hover { text-decoration: underline; }

.mr-limit > div strong { color: inherit !important; }
.mr-limit > div span { color: inherit !important; opacity: .9; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
    .sv-side { padding: 2.25rem 2rem; }
    .sv-toast { right: -.25rem; }
}

@media (max-width: 880px) {
    .sv-shell { grid-template-columns: 1fr; padding: 0; gap: 0; }
    .sv-side { display: none; }
    .sv-main { padding: 1.25rem 1rem; justify-content: flex-start; }
    .sv-card { margin-top: .5rem; padding: 1.75rem 1.25rem 1.25rem; }
    .sv-card::before { left: 1.25rem; right: 1.25rem; }
    .sv-card .sv-head h1 { font-size: 1.875rem; }
    .sv-card .sv-head p  { font-size: .9375rem; }
    .sv-card .sv-input   { font-size: 1rem; }
    .sv-mobile-brand {
        display: flex; align-items: center; gap: 0;
        margin-bottom: 1.5rem;
        font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif;
        font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em;
    }
    .sv-mobile-brand .sv-brand-mark { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
}

@media (max-width: 480px) {
    .glass { padding: 1.75rem 1.25rem 1.25rem; }
    .brand-title { font-size: 1.75rem; }
}

@media (max-width: 340px) {
    .sv-code { letter-spacing: .25rem; font-size: 1.25rem; }
}

@media (max-height: 520px) {
    body { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .sv-input, .cyber-input, .sv-btn, .cyber-btn, .sv-ghost, .master-link { transition: none; }
    .sv-btn::after, .cyber-btn::after { display: none; }
    .sv-error, .error-box { animation: none; }
}

/* ---------- OTP / authenticator step: single centered card ---------- */
.sv-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    margin-bottom: 1rem;
    padding: .375rem .875rem;
    border-radius: 999px;
    background: var(--info-bg);
    border: 1px solid var(--info-line);
    color: var(--accent);
    font-size: .6875rem; font-weight: 600; letter-spacing: .08em;
}

.sv-shell--center { grid-template-columns: 1fr; }
.sv-shell--center .sv-side { display: none; }
.sv-shell--center .sv-mobile-brand {
    display: flex; justify-content: center;
    margin-bottom: 1.5rem;
}
.sv-shell--center .sv-head { text-align: center; }

@media (min-width: 881px) {
    html.sv-center { font-size: 16px; }
    .sv-shell--center .sv-card { max-width: 33rem; padding: 2.5rem 2.5rem 1.75rem; }
    .sv-shell--center .sv-mobile-brand { font-size: 1.5rem; margin-bottom: 1.75rem; }
    .sv-shell--center .sv-card .sv-head h1 { font-size: 2.125rem; }
    .sv-shell--center .sv-card .sv-head p { max-width: 26rem; margin: .625rem auto 0; font-size: .9375rem; }
    .sv-shell--center .sv-card .sv-form { margin-top: 1.75rem; }
    .sv-shell--center .sv-card .sv-label { font-size: .875rem; }
    .sv-shell--center .sv-card .sv-input { font-size: 1rem; }
    .sv-shell--center .sv-card .sv-code { font-size: 1.625rem; }
    .sv-shell--center .sv-card .sv-btn { font-size: 1rem; }
}

/* =========================================================
   DARK THEME REFINEMENTS
   ========================================================= */
@media (prefers-color-scheme: dark) {

    body {
        background-image:
            radial-gradient(48rem 34rem at 100% 0%, rgba(79, 70, 229, .16), transparent 62%),
            radial-gradient(46rem 34rem at 0% 100%, rgba(14, 165, 200, .12), transparent 62%),
            radial-gradient(60rem 40rem at 60% 50%, rgba(30, 41, 100, .35), transparent 70%);
    }

    /* side panel: deep navy with indigo + teal glow (less purple-heavy) */
    .sv-side {
        background:
            radial-gradient(30rem 24rem at 92% -6%, rgba(99, 102, 241, .38), transparent 62%),
            radial-gradient(28rem 22rem at -8% 108%, rgba(20, 184, 208, .22), transparent 62%),
            linear-gradient(160deg, #0d1330 0%, #121847 60%, #1a1a52 100%);
        border: 1px solid rgba(255, 255, 255, .08);
        box-shadow: 0 30px 70px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
    }
    .sv-side::after {
        background: radial-gradient(circle, rgba(99, 102, 241, .3), transparent 68%);
    }

    /* card: lifted from the background, soft indigo glow */
    .sv-card,
    .glass {
        background: linear-gradient(180deg, #19224a 0%, var(--surface) 34%);
        border-color: #2e3866;
        box-shadow:
            0 0 0 1px rgba(139, 152, 255, .06),
            0 30px 70px rgba(0, 0, 0, .55),
            0 0 100px rgba(99, 102, 241, .14);
    }

    /* inputs: clearly darker than the card, visible border */
    .sv-input,
    .cyber-input {
        background: var(--surface-2);
        border-color: #2e3866;
    }
    .sv-input:hover,
    .cyber-input:hover { border-color: #4a57a0; }
    .sv-input:focus,
    .cyber-input:focus {
        background: #0e1530;
        border-color: var(--focus);
        box-shadow: 0 0 0 4px rgba(139, 152, 255, .22);
    }

    /* secondary buttons */
    .sv-ghost,
    .master-link,
    .sv-back,
    .master-link.plain {
        background: rgba(255, 255, 255, .03);
        border-color: #323d70;
    }
    .sv-ghost:hover,
    .master-link:hover,
    .sv-back:hover,
    .master-link.plain:hover {
        background: rgba(139, 152, 255, .12);
        border-color: var(--focus);
    }

    .sv-btn,
    .cyber-btn {
        box-shadow: 0 10px 30px rgba(99, 102, 241, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
    }

    .sv-step {
        background: rgba(8, 12, 30, .55);
        border-color: #2e3866;
    }

    .sv-divider::before, .sv-divider::after,
    .or-divider::before, .or-divider::after { background: #2a3358; }

    .sv-badge { background: rgba(139, 152, 255, .12); border-color: rgba(139, 152, 255, .3); }
    .sv-error, .error-box { background: rgba(248, 113, 113, .1); }
}

/* ---------- reCAPTCHA: remove white edge in dark mode ---------- */
@media (prefers-color-scheme: dark) {
    .captcha-wrap { height: 78px; }
    .g-recaptcha {
        width: 300px;
        height: 74px;
        overflow: hidden;            /* crops the iframe's white margin */
        border-radius: 12px;
        background: #222222;         /* same as the dark reCAPTCHA body */
        box-shadow: 0 0 0 1px #323d70, 0 8px 22px rgba(0, 0, 0, .35);
    }
    .g-recaptcha iframe {
        display: block;
        border-radius: 0 !important;
        color-scheme: dark;
    }
}