/* ══════════════════════════════════════════════════════════════════════════
   Vehicly Login / Register Page Styles — v3 (perfected)
   ──────────────────────────────────────────────────────────────────────────
   Import AFTER app.css and ux-consistency.css.
   Features: blur-to-sharp card entrance, crossfade tabs, inline validation
   with shake, password strength meter, shimmer buttons, social brand colors,
   confetti, mobile dvh + keyboard handling, focus-visible, reduced-motion,
   forced-colors, loading states.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ─────────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--vh-font-body);
    color: var(--vh-text);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--vh-bg);
    overflow-x: hidden;
    opacity: 0;
    animation: vh-pageIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@media (prefers-reduced-motion: reduce) {
    body { opacity: 1 !important; animation: none !important; }
}

/* ── Animated background with floating shapes ─────────────────────────── */
body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(var(--vh-primary-rgb),.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(var(--vh-primary-rgb),.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(var(--vh-primary-rgb),.03) 0%, transparent 50%);
    animation: bgShift 15s ease-in-out infinite alternate;
    pointer-events: none; z-index: 0;
}
body::after {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(circle at 15% 80%, rgba(var(--vh-primary-rgb),.025) 0%, transparent 40%),
        radial-gradient(circle at 85% 60%, rgba(var(--vh-primary-rgb),.02) 0%, transparent 35%);
    animation: bgShift2 20s ease-in-out infinite alternate-reverse;
    pointer-events: none; z-index: 0;
}
@keyframes bgShift {
    0%   { opacity: .5; transform: scale(1) translate(0, 0); }
    50%  { opacity: 1; transform: scale(1.06) translate(1%, -1%); }
    100% { opacity: .6; transform: scale(1) translate(-1%, 1%); }
}
@keyframes bgShift2 {
    0%   { opacity: .4; transform: translate(0, 0) rotate(0deg); }
    100% { opacity: .7; transform: translate(-2%, 2%) rotate(1deg); }
}

/* Dot grid pattern overlay */
.L::before {
    content: '';
    position: fixed; inset: 0;
    background-image: radial-gradient(circle, rgba(var(--vh-primary-rgb),.035) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none; z-index: 0;
    opacity: .6;
}

/* ── LAYOUT ────────────────────────────────────────────────────────────── */
.L { display: flex; min-height: 100vh; min-height: 100dvh; position: relative; }

/* ── SIDE PANEL ────────────────────────────────────────────────────────── */
.S {
    flex: 0 0 44%;
    background: #1F1F1F;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 2rem 2.5rem 2rem;
}

/* Animated mesh gradient */
.S-mesh { position: absolute; inset: 0; z-index: 0; }
.S-mesh canvas { width: 100%; height: 100%; opacity: .35; }

/* Overlay grain */
.S::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E");
    z-index: 1;
    pointer-events: none;
}

.sz { position: relative; z-index: 2; }

/* Top bar */
.S-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; }
.S-logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.S-logo:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 4px; border-radius: var(--radius-xs); }
.logo-v { flex-shrink: 0; }
.ltxt { font-weight: 700; font-size: 1.05rem; color: rgba(255, 255, 255, .85); }

/* Lang button */
.lsw { position: relative; }
.lbtn {
    display: flex; align-items: center; gap: .3rem;
    padding: .3rem .55rem;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--radius-xs, 8px);
    cursor: pointer;
    font: 600 .66rem/1 var(--vh-font-body);
    color: rgba(255, 255, 255, .35);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    letter-spacing: .04em;
}
.lbtn:hover, .lbtn.on { background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .55); }
.lbtn:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }
.lbtn svg { width: 10px; height: 10px; opacity: .4; transition: transform .25s cubic-bezier(.4, 0, .2, 1); }
.lbtn.on svg { transform: rotate(180deg); }

.ldd {
    position: absolute; top: calc(100% + 4px); right: 0;
    min-width: 128px;
    background: #2A2A2A;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--radius-sm, 10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    padding: 3px;
    opacity: 0; visibility: hidden;
    transform: translateY(-4px) scale(.97);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    z-index: 100;
}
.ldd.on { opacity: 1; visibility: visible; transform: none; }

.lop {
    display: flex; align-items: center; gap: .5rem;
    width: 100%; padding: .4rem .55rem;
    border: none; background: 0; border-radius: var(--radius-xs, 8px);
    cursor: pointer;
    font: 500 .72rem/1 var(--vh-font-body);
    color: rgba(255, 255, 255, .35);
    transition: all .12s; text-align: left;
}
.lop:hover { background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .6); }
.lop.on { background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .8); }
.lop:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: -2px; border-radius: var(--radius-xs, 8px); }
.lop b { font-weight: 700; min-width: 18px; }
.lchk { margin-left: auto; opacity: 0; color: var(--vh-surface); font-size: .65rem; }
.lop.on .lchk { opacity: 1; }

/* Mobile lang */
.mlang .lbtn { background: rgba(var(--vh-primary-rgb),.04); border-color: var(--vh-border); color: var(--vh-text-tertiary); }
.mlang .lbtn:hover, .mlang .lbtn.on { background: rgba(var(--vh-primary-rgb),.06); color: var(--vh-text-muted); }
.mlang .ldd { background: var(--vh-surface); border-color: var(--vh-border); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.mlang .lop { color: var(--vh-text-muted); }
.mlang .lop:hover { background: rgba(var(--vh-primary-rgb),.04); color: var(--vh-text); }
.mlang .lop.on { background: var(--vh-highlight, #fffcf0); color: var(--vh-text); }

/* ── Side panel content ────────────────────────────────────────────────── */
.S-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2.5rem 0; }
.S-h {
    font-family: var(--vh-font-display);
    font-weight: 700;
    font-size: clamp(1.85rem, 3.2vw, 2.65rem);
    color: rgba(255, 255, 255, .88);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: .9rem;
    opacity: 0;
    animation: sideHeadIn .7s cubic-bezier(.22, 1, .36, 1) .2s both;
}
@keyframes sideHeadIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.S-h em {
    font-style: normal;
    color: var(--vh-primary);
    position: relative;
}
.S-h em::after {
    content: '';
    position: absolute; bottom: 1px; left: 0; right: 0;
    height: 2px; background: var(--vh-primary);
    opacity: .3; border-radius: var(--radius-xs);
}
.S-p {
    font-size: .86rem;
    color: rgba(255, 255, 255, .28);
    line-height: 1.6;
    max-width: 340px;
    margin-bottom: 2.25rem;
    opacity: 0;
    animation: sideHeadIn .6s cubic-bezier(.22, 1, .36, 1) .35s both;
}

/* Stats */
.S-stats { display: flex; gap: 1.75rem; margin-bottom: 2.25rem; }
.S-st { display: flex; flex-direction: column; gap: .1rem; }
.st-n { font-size: 1.35rem; font-weight: 700; color: var(--vh-surface); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st-l { font-size: .6rem; font-weight: 500; color: rgba(255, 255, 255, .2); text-transform: uppercase; letter-spacing: .07em; }

/* Features */
.S-feats { display: flex; flex-direction: column; gap: .5rem; }
.S-ft {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .7rem;
    background: rgba(255, 255, 255, .025);
    border: 1px solid rgba(255, 255, 255, .035);
    border-radius: var(--radius-sm, 10px);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    opacity: 0;
    animation: vh-formItemIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.S-ft:hover { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); transform: translateX(3px); }
.S-ft:nth-child(1) { animation-delay: 0.3s; }
.S-ft:nth-child(2) { animation-delay: 0.4s; }
.S-ft:nth-child(3) { animation-delay: 0.5s; }
.S-ft:nth-child(4) { animation-delay: 0.6s; }
.ft-i {
    width: 28px; height: 28px; border-radius: var(--radius-xs, 8px);
    background: rgba(255, 255, 255, .07);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ft-i svg { width: 13px; height: 13px; color: var(--vh-surface); }
.ft-t { font-size: .76rem; color: rgba(255, 255, 255, .4); font-weight: 500; }

/* ── RIGHT PANEL ───────────────────────────────────────────────────────── */
.R {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2rem 2.5rem;
    position: relative;
    overflow-y: auto;
    z-index: 1;
}
.R::before {
    content: '';
    position: absolute; top: -20%; right: -10%;
    width: 40%; height: 45%;
    background: radial-gradient(circle, rgba(var(--vh-primary-rgb),.03) 0%, transparent 65%);
    pointer-events: none;
}

/* Back */
.bk {
    position: absolute; top: 1.25rem; left: 1.25rem;
    display: flex; align-items: center; gap: .3rem;
    font-size: .72rem; font-weight: 500; color: var(--vh-text-tertiary);
    text-decoration: none;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    padding: .25rem .4rem; border-radius: var(--radius-xs, 8px);
    z-index: 2;
}
.bk:hover { color: var(--vh-text-secondary); background: rgba(var(--vh-primary-rgb),.06); }
.bk:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }
.bk svg { width: 13px; height: 13px; }

/* Trust badge */
.trust {
    position: absolute; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: .6rem;
    font-size: .58rem; color: var(--vh-text-tertiary); font-weight: 500;
}
.trust-i { display: flex; align-items: center; gap: .25rem; opacity: .6; }
.trust-i svg { width: 11px; height: 11px; }

/* ── Card — blur-to-sharp entrance ────────────────────────────────────── */
.C {
    width: 100%; max-width: 385px;
    animation: cardEntrance .65s cubic-bezier(.22, .61, .36, 1) .15s both;
    position: relative; z-index: 1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.C:not(.panel) { transition: opacity .3s ease, transform .3s ease, filter .3s ease; }
.C.fade-out { opacity: 0; transform: translateY(-12px) scale(.98); pointer-events: none; filter: blur(2px); }
@keyframes cardEntrance {
    0%   { opacity: 0; transform: translateY(32px) scale(.95); filter: blur(8px); }
    50%  { opacity: .7; filter: blur(2px); }
    100% { opacity: 1; transform: none; filter: blur(0); }
}
/* Backward compat alias */
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Mobile header */
.mh { display: none; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.ml { display: flex; align-items: center; gap: .4rem; text-decoration: none; }
.ml:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 4px; border-radius: var(--radius-xs); }
.ml span { font-weight: 700; font-size: 1.05rem; color: var(--vh-text); }

/* ── Tabs with sliding indicator — crossfade ──────────────────────────── */
.tabs {
    display: flex;
    background: var(--vh-highlight, #fffcf0);
    border-radius: var(--radius-sm, 10px);
    padding: 3px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--vh-border);
    position: relative;
}
.tab {
    flex: 1; padding: .5rem .75rem;
    border: none; background: 0;
    cursor: pointer;
    font: 600 .78rem/1 var(--vh-font-body);
    color: var(--vh-text-muted);
    border-radius: var(--radius-sm, 10px);
    transition: color .3s cubic-bezier(.4, 0, .2, 1), transform .15s ease;
    text-align: center;
    position: relative; z-index: 1;
}
.tab.on { color: var(--vh-text); }
.tab:hover:not(.on) { color: var(--vh-text-secondary); }
.tab:active { transform: scale(.97); }
.tab:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: -2px; border-radius: var(--radius-sm, 10px); }
.tslide {
    position: absolute; top: 3px; left: 3px;
    width: calc(50% - 3px); height: calc(100% - 6px);
    background: var(--vh-surface, #fff);
    border-radius: var(--radius-sm, 10px);
    box-shadow: 0 1px 4px rgba(var(--vh-primary-rgb),.1), 0 2px 8px rgba(var(--vh-primary-rgb),.06);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
    z-index: 0;
}
.tabs.reg .tslide { transform: translateX(100%); }

/* ── Tab crossfade content wrapper ────────────────────────────────────── */
.tab-crossfade-out {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease;
}
.tab-crossfade-in {
    opacity: 1;
    transform: none;
    transition: opacity .3s cubic-bezier(.22,1,.36,1), transform .3s cubic-bezier(.22,1,.36,1);
}

/* ── Register progress ─────────────────────────────────────────────────── */
.progress {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: 1.25rem;
    padding: .45rem .65rem;
    background: var(--vh-surface, #fff);
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-sm, 10px);
    font-size: .68rem; font-weight: 600; color: var(--vh-text-muted);
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
}
.progress.hidden { display: none; }
.progress svg { width: 13px; height: 13px; flex-shrink: 0; }
.pbar { flex: 1; height: 3px; background: var(--vh-border); border-radius: var(--radius-xs); overflow: hidden; }
.pbar-fill { height: 100%; background: var(--vh-primary); border-radius: var(--radius-xs); transition: width .4s cubic-bezier(.4, 0, .2, 1); width: 0; }

/* ── Header ────────────────────────────────────────────────────────────── */
.ah {
    margin-bottom: 1.25rem;
    transition: opacity .2s ease, transform .2s ease;
}
.at {
    font-family: var(--vh-font-display);
    font-size: 1.65rem; font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--vh-text); line-height: 1.15;
    margin-bottom: .3rem;
}
.as { font-size: .82rem; color: var(--vh-text-muted); line-height: 1.45; }

/* ── Global error / success / info messages ───────────────────────────── */
.ge {
    padding: .55rem .75rem;
    background: var(--vh-error-bg);
    border: 1px solid var(--vh-error-border);
    border-radius: var(--radius-sm, 10px);
    font-size: .74rem; color: var(--vh-error);
    display: flex; align-items: center; gap: .45rem;
    margin-bottom: .75rem;
    animation: errSlideIn .4s cubic-bezier(.22, 1, .36, 1);
    transition: opacity .3s ease, transform .3s ease;
}
.ge.h {
    display: none;
    animation: none;
}
.ge.ge-entering {
    animation: errSlideIn .4s cubic-bezier(.22, 1, .36, 1) both;
}
.ge.ge-leaving {
    animation: errSlideOut .3s cubic-bezier(.4, 0, .2, 1) forwards;
}
.ge svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform .3s ease; }
.ge:not(.h) svg { animation: errIconPulse .5s ease .15s; }
.ge .ge-ico-ok { display: none; }
.ge.success .ge-ico-err { display: none; }
.ge.success .ge-ico-ok { display: block; }

@keyframes errSlideIn {
    0%   { opacity: 0; transform: translateY(-8px) scale(.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes errSlideOut {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-6px) scale(.96); }
}
@keyframes errIconPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* Error with shake (for form validation) */
.ge.ge-shake {
    animation: errShakeIn .5s cubic-bezier(.36,.07,.19,.97);
}
@keyframes errShakeIn {
    0%   { opacity: 0; transform: translateY(-6px) translateX(0); }
    25%  { opacity: 1; transform: translateY(0) translateX(-5px); }
    45%  { transform: translateY(0) translateX(4px); }
    65%  { transform: translateY(0) translateX(-3px); }
    80%  { transform: translateY(0) translateX(2px); }
    100% { transform: translateY(0) translateX(0); }
}

/* Info banner */
.ge.info {
    background: var(--vh-warning-bg);
    border-color: var(--vh-warning-border);
    color: var(--vh-warning);
    animation: errSlideIn .4s cubic-bezier(.22, 1, .36, 1);
}
.ge.info svg { color: var(--vh-warning); }

/* Success banner */
.ge.success {
    background: var(--vh-success-bg);
    border-color: var(--vh-success-border);
    color: var(--vh-success);
    animation: successBounceIn .5s cubic-bezier(.22, .61, .36, 1);
}
.ge.success svg { color: var(--vh-success); }
@keyframes successBounceIn {
    0%   { opacity: 0; transform: translateY(-8px) scale(.92); }
    60%  { opacity: 1; transform: translateY(2px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Caps lock warning ─────────────────────────────────────────────────── */
.caps {
    padding: .35rem .6rem;
    background: var(--vh-warning-bg);
    border: 1px solid var(--vh-warning-border);
    border-radius: var(--radius-sm, 10px);
    font-size: .66rem; color: var(--vh-warning);
    display: flex; align-items: center; gap: .35rem;
    margin-top: .35rem;
    animation: errSlideIn .2s ease;
}
.caps.h { display: none; }
.caps svg { width: 11px; height: 11px; flex-shrink: 0; }

/* ── FLOATING LABEL FIELDS ─────────────────────────────────────────────── */
.fl { position: relative; margin-bottom: .85rem; }
.fl.h { display: none; margin: 0; }
.fl-wrap { position: relative; }
.fl-in {
    width: 100%;
    padding: .85rem .9rem .45rem 2.4rem;
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-md, 12px);
    font: 400 .84rem/1.3 var(--vh-font-body);
    color: var(--vh-text);
    background: var(--vh-surface, #fff);
    outline: 0;
    transition: border-color .3s cubic-bezier(.4, 0, .2, 1),
                box-shadow .3s cubic-bezier(.4, 0, .2, 1),
                background .3s cubic-bezier(.4, 0, .2, 1),
                transform .2s cubic-bezier(.4, 0, .2, 1);
    height: 50px;
}
.fl-in::placeholder { color: transparent; }
.fl-in:focus {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb),.15), 0 0 20px rgba(var(--vh-primary-rgb),.08);
    background: rgba(255, 255, 255, 1);
}
.fl-in.err {
    border-color: var(--vh-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
    animation: fieldShake .4s cubic-bezier(.36,.07,.19,.97);
}
.fl-in.ok {
    border-color: var(--vh-success);
    box-shadow: 0 0 0 3px rgba(var(--vh-success-rgb), .08);
}
@keyframes fieldShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}

.fl-lb {
    position: absolute; left: 2.4rem; top: 50%; transform: translateY(-50%);
    font-size: .84rem; color: var(--vh-text-muted); font-weight: 400;
    pointer-events: none;
    transition: top .28s cubic-bezier(.4, 0, .2, 1),
                transform .28s cubic-bezier(.4, 0, .2, 1),
                font-size .28s cubic-bezier(.4, 0, .2, 1),
                color .28s cubic-bezier(.4, 0, .2, 1),
                letter-spacing .28s cubic-bezier(.4, 0, .2, 1);
    transform-origin: left;
}
.fl-in:focus ~ .fl-lb, .fl-in:not(:placeholder-shown) ~ .fl-lb {
    top: .45rem; transform: translateY(0) scale(.92);
    font-size: .58rem; font-weight: 600;
    color: var(--vh-text-muted);
    letter-spacing: .04em; text-transform: uppercase;
}
.fl-in:focus ~ .fl-lb { color: var(--vh-primary-dark); }
.fl-in.err ~ .fl-lb { color: var(--vh-error); }

.fl-ico {
    position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--vh-text-tertiary);
    pointer-events: none;
    transition: color .25s cubic-bezier(.4, 0, .2, 1), transform .25s ease;
}
.fl-in:focus ~ .fl-ico { color: var(--vh-primary-dark); transform: translateY(-50%) scale(1.05); }
.fl-in.err ~ .fl-ico { color: var(--vh-error); }
.fl-in.ok ~ .fl-ico { color: var(--vh-success); }

/* Field validation indicator */
.fv {
    position: absolute; right: .65rem; top: 50%; transform: translateY(-50%) scale(.5);
    width: 15px; height: 15px; opacity: 0;
    transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}
.fv.show { opacity: 1; transform: translateY(-50%) scale(1); }
.fv.ok { color: var(--vh-success); }
.fv.err { color: var(--vh-error); }

/* Inline hint under field */
.fl-hint {
    font-size: .62rem; color: var(--vh-text-tertiary);
    margin-top: .25rem; padding-left: .2rem;
    min-height: .8rem;
    transition: color .3s ease, opacity .3s ease, transform .3s ease;
    opacity: 0; transform: translateY(-4px);
}
.fl-hint:not(:empty) { opacity: 1; transform: none; }
.fl-hint.err { color: var(--vh-error); font-weight: 500; }
.fl-hint.ok { color: var(--vh-success); font-weight: 500; }

/* ── Email suggestions ─────────────────────────────────────────────────── */
.em-sug {
    position: absolute; top: calc(100% + 2px); left: 0; right: 0;
    background: var(--vh-surface, #fff);
    border: 1px solid var(--vh-border);
    border-radius: var(--radius-sm, 10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    padding: 2px; z-index: 50;
    opacity: 0; visibility: hidden;
    transform: translateY(-3px);
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
.em-sug.on { opacity: 1; visibility: visible; transform: none; }
.em-sug-i {
    display: flex; align-items: center; gap: .4rem;
    padding: .4rem .6rem; border-radius: var(--radius-xs, 8px);
    font-size: .76rem; color: var(--vh-text-secondary);
    cursor: pointer; transition: all .12s;
}
.em-sug-i:hover, .em-sug-i.sel { background: var(--vh-highlight, #fffcf0); color: var(--vh-text); }
.em-sug-i:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: -2px; }
.em-sug-i b { font-weight: 600; }

/* ── Password eye toggle ──────────────────────────────────────────────── */
.pw-eye {
    position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
    background: 0; border: 0; cursor: pointer;
    padding: .25rem; color: var(--vh-text-tertiary);
    border-radius: var(--radius-xs, 8px);
    transition: color .25s ease, transform .25s ease, background .25s ease;
}
.pw-eye:hover { color: var(--vh-text-secondary); transform: translateY(-50%) scale(1.1); background: rgba(var(--vh-primary-rgb),.06); }
.pw-eye:active { transform: translateY(-50%) scale(.92); }
.pw-eye:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }
.pw-eye svg { width: 14px; height: 14px; transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .2s ease; }
.pw-eye .eye-open, .pw-eye .eye-closed { transition: opacity .25s ease, transform .25s ease; }
.pw-eye .eye-closed { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0; }
.pw-eye.toggled .eye-open { opacity: 0; transform: scale(.8); }
.pw-eye.toggled .eye-closed { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.pw-eye.toggled svg { transform: rotate(180deg); }

/* ── Password strength meter ──────────────────────────────────────────── */
.pw-meter {
    margin-top: .4rem;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
    max-height: 0; opacity: 0;
}
.pw-meter.visible { max-height: 60px; opacity: 1; }
.pw-meter-bars {
    display: flex; gap: 3px; height: 3px; margin-bottom: .35rem;
}
.pw-meter-seg {
    flex: 1; height: 100%;
    background: var(--vh-border);
    border-radius: var(--radius-xs);
    transition: background .35s cubic-bezier(.4,0,.2,1), transform .35s ease;
}
.pw-meter-seg.filled { transform: scaleY(1.4); }
.pw-meter-seg.s1 { background: #E53E3E; }
.pw-meter-seg.s2 { background: #DD6B20; }
.pw-meter-seg.s3 { background: #D69E2E; }
.pw-meter-seg.s4 { background: #38A169; }
.pw-meter-label {
    font-size: .6rem; font-weight: 600;
    transition: color .3s ease;
    color: var(--vh-text-tertiary);
}
.pw-meter-label.s1 { color: #E53E3E; }
.pw-meter-label.s2 { color: #DD6B20; }
.pw-meter-label.s3 { color: #D69E2E; }
.pw-meter-label.s4 { color: #38A169; }

/* Legacy aliases */
.pm { display: flex; gap: 3px; height: 3px; margin-top: .35rem; }
.pm.h { display: none; }
.ps { flex: 1; background: var(--vh-border); border-radius: var(--radius-xs); transition: all .35s cubic-bezier(.4, 0, .2, 1); }
.ps.f { transform: scaleY(1.4); }
.ps.s1 { background: #E53E3E; }
.ps.s2 { background: #DD6B20; }
.ps.s3 { background: #D69E2E; }
.ps.s4 { background: #38A169; }

/* ── PW requirements ───────────────────────────────────────────────────── */
.pr { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .6rem; margin-top: .35rem; }
.pr.h { display: none; }
.pri {
    display: flex; align-items: center; gap: .3rem;
    font-size: .62rem; color: var(--vh-text-tertiary); font-weight: 500;
    transition: color .15s;
}
.pri.met { color: var(--vh-success); }
.pri svg { width: 10px; height: 10px; flex-shrink: 0; }

/* ── Form row (Remember me + Forgot password) ────────────────────────── */
.fr { display: flex; align-items: center; justify-content: space-between; margin: .7rem 0 .15rem; }
.fr.h { display: none; margin: 0; }
.chk {
    display: flex; align-items: center; gap: .4rem;
    cursor: pointer; font-size: .74rem; color: var(--vh-text-muted);
    font-weight: 500; user-select: none; position: relative;
}
.chk:hover { color: var(--vh-text-secondary); }
.chk input {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
/* Custom checkbox box */
.chk-box {
    display: flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; flex-shrink: 0;
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-xs);
    background: var(--vh-surface, #fff);
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
.chk-box svg {
    width: 10px; height: 10px; color: var(--vh-surface);
    opacity: 0; transform: scale(.5);
    transition: all .2s cubic-bezier(.34, 1.56, .64, 1);
}
.chk input:checked ~ .chk-box {
    background: var(--vh-primary);
    border-color: var(--vh-primary);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb),.2);
}
.chk input:checked ~ .chk-box svg {
    opacity: 1; transform: scale(1);
}
.chk input:focus-visible ~ .chk-box {
    outline: 2px solid var(--vh-primary); outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb),.15);
}
.chk:hover .chk-box { border-color: var(--vh-primary); }
.fgt {
    font-size: .7rem; color: var(--vh-primary-dark); font-weight: 600;
    text-decoration: none;
    transition: color .25s cubic-bezier(.4, 0, .2, 1);
    position: relative;
}
.fgt::after {
    content: '';
    position: absolute; bottom: -1px; left: 0; right: 0;
    height: 1px; background: var(--vh-primary-hover);
    transform: scaleX(0); transform-origin: right;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.fgt:hover { color: var(--vh-primary-hover); }
.fgt:hover::after { transform: scaleX(1); transform-origin: left; }
.fgt:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }

/* ── Password requirements checklist ──────────────────────────────────── */
.pw-reqs {
    display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .6rem;
    margin-top: .4rem; padding: .3rem 0;
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height .35s cubic-bezier(.4,0,.2,1), opacity .35s ease, margin .35s ease;
}
.pw-reqs.visible { max-height: 120px; opacity: 1; }
.pw-req {
    display: flex; align-items: center; gap: .3rem;
    font-size: .62rem; color: var(--vh-text-tertiary); font-weight: 500;
    transition: color .25s ease;
}
.pw-req svg {
    width: 12px; height: 12px; flex-shrink: 0;
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
    color: var(--vh-border);
}
.pw-req.met {
    color: var(--vh-success);
}
.pw-req.met svg {
    color: var(--vh-success);
    transform: scale(1.1);
}
/* Replace circle with checkmark when met */
.pw-req.met svg { animation: reqCheck .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes reqCheck { 0% { transform: scale(.5); } 50% { transform: scale(1.2); } 100% { transform: scale(1.1); } }

/* ── Confirm password match indicator ────────────────────────────────── */
.pw-match {
    display: flex; align-items: center; gap: .3rem;
    margin-top: .3rem; padding-left: .2rem;
    min-height: .8rem;
    font-size: .62rem; font-weight: 600;
    transition: opacity .3s ease, transform .3s ease;
    opacity: 0; transform: translateY(-4px);
}
.pw-match.visible { opacity: 1; transform: none; }
.pw-match .pw-match-ico {
    width: 12px; height: 12px; flex-shrink: 0;
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.pw-match.match { color: var(--vh-success); }
.pw-match.match .pw-match-ico { color: var(--vh-success); animation: reqCheck .3s cubic-bezier(.34,1.56,.64,1); }
.pw-match.mismatch { color: var(--vh-error); }
.pw-match.mismatch .pw-match-ico { color: var(--vh-error); }

/* ── Terms — custom checkbox ─────────────────────────────────────────── */
.tr {
    display: flex; align-items: flex-start; gap: .45rem;
    margin: .5rem 0 .1rem;
    font-size: .75rem; color: var(--vh-text-muted); line-height: 1.35;
}
.tr.h { display: none; margin: 0; }
#rememberRow,
.tab-transitioning .vh-form-stagger > #rememberRow { animation: none; opacity: 1; transform: none; }
.tr.tr-err { animation: fieldShake .4s cubic-bezier(.36,.07,.19,.97); }
.tr.tr-err span { color: var(--vh-error); }
.tr.tr-err .tr-box { border-color: var(--vh-error); background: rgba(220,38,38,.06); }

/* Custom checkbox replacement */
.tr-custom-chk {
    position: relative; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px;
    margin: -12px; padding: 12px;
}
.tr-custom-chk input {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.tr-box {
    width: 18px; height: 18px;
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-xs);
    background: var(--vh-surface, #fff);
    display: flex; align-items: center; justify-content: center;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    flex-shrink: 0;
}
.tr-box svg {
    width: 11px; height: 11px; color: var(--vh-surface);
    opacity: 0; transform: scale(.5);
    transition: all .2s cubic-bezier(.34,1.56,.64,1);
}
.tr-custom-chk input:checked + .tr-box {
    background: var(--vh-primary);
    border-color: var(--vh-primary);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb),.25);
}
.tr-custom-chk input:checked + .tr-box svg {
    opacity: 1; transform: scale(1);
}
.tr-custom-chk input:focus-visible + .tr-box {
    outline: 2px solid var(--vh-primary);
    outline-offset: 2px;
}
.tr-custom-chk:hover .tr-box {
    border-color: var(--vh-primary);
    transform: scale(1.05);
}

.tr a {
    color: var(--vh-primary-dark); font-weight: 600; text-decoration: none;
    position: relative;
    transition: color .25s ease;
}
.tr a::after {
    content: '';
    position: absolute; bottom: -1px; left: 0; right: 0;
    height: 1px; background: var(--vh-primary-dark);
    transform: scaleX(0); transform-origin: right;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.tr a:hover { color: var(--vh-primary-hover); }
.tr a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ── Submit button — shimmer on hover/active ──────────────────────────── */
.sub {
    width: 100%;
    padding: .78rem 1.25rem;
    background: var(--vh-primary);
    color: var(--vh-on-primary, #554000);
    font: 700 .86rem/1 var(--vh-font-body);
    border: none;
    border-radius: var(--radius-md, 12px);
    cursor: pointer;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb),.16);
    margin-top: 1.1rem;
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    min-height: 44px;
}
/* Shimmer overlay */
.sub::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,.25) 42%,
        rgba(255,255,255,.5) 50%,
        rgba(255,255,255,.25) 58%,
        transparent 70%
    );
    transform: translateX(-120%);
    transition: none;
    z-index: 1;
    pointer-events: none;
}
.sub:hover:not(:disabled):not(.ld)::before {
    transform: translateX(120%);
    transition: transform .65s ease;
}
/* Idle shimmer loop (subtle) */
@keyframes shimmerIdle {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}
.sub:not(:disabled):not(.ld):not(:hover)::before {
    animation: shimmerIdle 3s ease-in-out 2s infinite;
}
.sub:hover:not(:disabled):not(.ld) {
    background: var(--vh-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--vh-primary-rgb),.3), 0 0 40px rgba(var(--vh-primary-rgb),.1);
}
.sub:active:not(:disabled):not(.ld) {
    transform: translateY(0) scale(.98);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb),.2);
    transition-duration: .1s;
}
.sub:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.sub:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 3px; }
.sub .bt { transition: opacity .2s ease; position: relative; z-index: 2; }
.sub .ba { transition: transform .2s ease, opacity .2s ease; opacity: .5; position: relative; z-index: 2; }
.sub:hover:not(:disabled):not(.ld) .ba { transform: translateX(3px); opacity: .8; }

/* Spinner */
.sp {
    display: none;
    width: 16px; height: 16px;
    border: 2.5px solid rgba(31, 31, 31, .12);
    border-top-color: var(--vh-on-primary, #1a1a1a);
    border-radius: 50%;
    animation: spin .6s cubic-bezier(.6,.1,.4,.9) infinite;
    position: relative; z-index: 2;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading state */
.sub.ld {
    pointer-events: none;
    background: var(--vh-primary);
    opacity: .85;
}
.sub.ld::before { animation: none; transform: translateX(-120%); }
.sub.ld .sp { display: block; animation: spinnerIn .25s ease both, spin .6s cubic-bezier(.6,.1,.4,.9) .25s infinite; }
.sub.ld .bt, .sub.ld .ba { opacity: 0; position: absolute; }
@keyframes spinnerIn { from { opacity: 0; transform: scale(.5) rotate(0); } to { opacity: 1; transform: scale(1) rotate(90deg); } }

/* Success state */
.sub.ok {
    background: var(--vh-success); color: var(--vh-surface); pointer-events: none;
    box-shadow: 0 4px 16px rgba(var(--vh-success-rgb), .25);
    transition: background .3s ease, box-shadow .3s ease;
}
.sub.ok::before { display: none; }
.sub.ok .bt, .sub.ok .ba, .sub.ok .sp { display: none; }
.ckm { display: none; width: 18px; height: 18px; position: relative; z-index: 2; }
.sub.ok .ckm { display: block; animation: checkPop .4s cubic-bezier(.22, .61, .36, 1); }
@keyframes checkPop {
    0%   { transform: scale(0) rotate(-45deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Error flash state */
.sub.err-flash {
    background: var(--vh-error); color: var(--vh-surface);
    box-shadow: 0 4px 16px rgba(220, 38, 38, .25);
    animation: errFlash .6s cubic-bezier(.36,.07,.19,.97);
}
.sub.err-flash::before { display: none; }
@keyframes errFlash {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(-4px); }
    30%  { transform: translateX(4px); }
    45%  { transform: translateX(-3px); }
    60%  { transform: translateX(2px); }
    75%  { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

/* ── Social button loading spinner ────────────────────────────────────── */
.sbtn-sp {
    display: none;
    width: 14px; height: 14px;
    border: 2px solid rgba(0,0,0,.08);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin .6s cubic-bezier(.6,.1,.4,.9) infinite;
}
.sbtn.ld {
    pointer-events: none; opacity: .7;
}
.sbtn.ld .sbtn-sp { display: inline-block; }
.sbtn.ld span:not(.sbtn-sp) { opacity: .5; }
.sbtn.ld svg { opacity: .3; }

/* ── Success overlay ───────────────────────────────────────────────────── */
.success-ov {
    position: fixed; inset: 0;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
}
.success-ov.on { opacity: 1; visibility: visible; }
.suc-ico {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--vh-success);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.25rem;
    animation: sucIconPop .5s .1s cubic-bezier(.22, .61, .36, 1) both;
    box-shadow: 0 8px 32px rgba(var(--vh-success-rgb), .25), 0 0 0 8px rgba(var(--vh-success-rgb), .08);
}
@keyframes sucIconPop {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    50%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.suc-ico svg { width: 30px; height: 30px; color: var(--vh-surface); animation: sucCheck .35s .45s ease both; }
@keyframes sucCheck { from { stroke-dashoffset: 30; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
.suc-t {
    font-family: var(--vh-font-display); font-size: 1.4rem; font-weight: 700;
    letter-spacing: -0.02em; color: var(--vh-text); margin-bottom: .3rem;
    animation: vh-fadeUp .4s .3s both;
}
.suc-s {
    font-size: .82rem; color: var(--vh-text-muted); margin-bottom: 1.5rem;
    animation: vh-fadeUp .4s .4s both;
}
@keyframes vh-fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.suc-bar { width: 120px; height: 3px; background: var(--vh-border); border-radius: var(--radius-xs); overflow: hidden; animation: vh-fadeUp .3s .5s both; }
.suc-bar-fill { height: 100%; background: var(--vh-success); border-radius: var(--radius-xs); animation: countdown 1.2s .6s linear forwards; width: 100%; }
@keyframes countdown { from { width: 100%; } to { width: 0; } }

/* ── Form stagger (children animate in sequence) ──────────────────────── */
.vh-form-stagger > * {
    opacity: 0;
    animation: formItemSlide .45s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes formItemSlide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
.vh-form-stagger > *:nth-child(1) { animation-delay: .15s; }
.vh-form-stagger > *:nth-child(2) { animation-delay: .22s; }
.vh-form-stagger > *:nth-child(3) { animation-delay: .29s; }
.vh-form-stagger > *:nth-child(4) { animation-delay: .36s; }
.vh-form-stagger > *:nth-child(5) { animation-delay: .43s; }
.vh-form-stagger > *:nth-child(6) { animation-delay: .50s; }
.vh-form-stagger > *:nth-child(7) { animation-delay: .57s; }
.vh-form-stagger > *:nth-child(8) { animation-delay: .64s; }
.vh-form-stagger > *:nth-child(9) { animation-delay: .71s; }

/* ── Tab switch content transition ────────────────────────────────────── */
.tab-transitioning .ah,
.tab-transitioning .vh-form-stagger > * {
    animation: tabContentIn .3s cubic-bezier(.22, 1, .36, 1) both;
}
.tab-transitioning .vh-form-stagger > *:nth-child(1) { animation-delay: 0s; }
.tab-transitioning .vh-form-stagger > *:nth-child(2) { animation-delay: .03s; }
.tab-transitioning .vh-form-stagger > *:nth-child(3) { animation-delay: .06s; }
.tab-transitioning .vh-form-stagger > *:nth-child(4) { animation-delay: .09s; }
.tab-transitioning .vh-form-stagger > *:nth-child(5) { animation-delay: .12s; }
.tab-transitioning .vh-form-stagger > *:nth-child(6) { animation-delay: .15s; }
.tab-transitioning .vh-form-stagger > *:nth-child(7) { animation-delay: .18s; }
.tab-transitioning .vh-form-stagger > *:nth-child(8) { animation-delay: .21s; }
.tab-transitioning .vh-form-stagger > *:nth-child(9) { animation-delay: .24s; }
@keyframes tabContentIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ── Password strength indicator (legacy) ────────────────────────────── */
.pw-strength {
    margin-top: .4rem;
    overflow: hidden;
    transition: max-height .35s ease, opacity .35s ease;
    max-height: 0; opacity: 0;
}
.pw-strength.visible { max-height: 40px; opacity: 1; }
.pw-strength-bar {
    height: 3px;
    border-radius: var(--radius-xs);
    background: var(--vh-border);
    overflow: hidden;
    margin-bottom: .3rem;
}
.pw-strength-fill {
    height: 100%;
    border-radius: var(--radius-xs);
    width: 0;
    transition: width .4s cubic-bezier(.4, 0, .2, 1), background .4s ease;
}
.pw-strength-fill.s1 { width: 25%; background: #E53E3E; }
.pw-strength-fill.s2 { width: 50%; background: #DD6B20; }
.pw-strength-fill.s3 { width: 75%; background: #D69E2E; }
.pw-strength-fill.s4 { width: 100%; background: #38A169; }
.pw-strength-text {
    font-size: .6rem; font-weight: 600;
    transition: color .3s ease;
}
.pw-strength-text.s1 { color: #E53E3E; }
.pw-strength-text.s2 { color: #DD6B20; }
.pw-strength-text.s3 { color: #D69E2E; }
.pw-strength-text.s4 { color: #38A169; }

/* ── Divider ───────────────────────────────────────────────────────────── */
.dv { display: flex; align-items: center; gap: .75rem; margin: 1.15rem 0; }
.dv::before, .dv::after { content: ''; flex: 1; height: 1px; background: var(--vh-border); }
.dv span { font-size: .64rem; font-weight: 600; color: var(--vh-text-tertiary); text-transform: uppercase; letter-spacing: .08em; }

/* ── Social login buttons — brand colors ─────────────────────────────── */
.soc { display: flex; gap: .5rem; }
.sbtn {
    flex: 1; padding: .6rem .7rem;
    background: var(--vh-surface);
    border: 1.5px solid var(--vh-border);
    border-radius: var(--radius-md, 12px);
    cursor: pointer;
    font: 600 .76rem/1 var(--vh-font-body);
    color: var(--vh-text);
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    transition: all .28s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
}
.sbtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08), 0 2px 6px rgba(0,0,0,.04);
}
.sbtn:active { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0, 0, 0, .06); }
.sbtn:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }
.sbtn svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform .28s ease; }
.sbtn:hover svg { transform: scale(1.12); }

/* Google */
.sbtn[data-provider="google"]:hover,
.sbtn.sbtn-google:hover {
    border-color: #4285f4;
    background: #f0f4ff;
    color: #1a73e8;
    box-shadow: 0 6px 16px rgba(66, 133, 244, .15), 0 2px 6px rgba(66, 133, 244, .06);
}
/* Apple */
.sbtn[data-provider="apple"]:hover,
.sbtn.sbtn-apple:hover {
    border-color: var(--vh-text);
    background: #1a1a1a;
    color: var(--vh-surface);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .2), 0 2px 6px rgba(0, 0, 0, .06);
}
/* Facebook */
.sbtn[data-provider="facebook"]:hover,
.sbtn.sbtn-facebook:hover {
    border-color: #1877F2;
    background: #f0f4ff;
    color: #1877F2;
    box-shadow: 0 6px 16px rgba(24, 119, 242, .15), 0 2px 6px rgba(24, 119, 242, .06);
}
/* GitHub */
.sbtn[data-provider="github"]:hover,
.sbtn.sbtn-github:hover {
    border-color: var(--vh-text);
    background: #f5f5f5;
    color: #24292e;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .04);
}
/* Microsoft */
.sbtn[data-provider="microsoft"]:hover,
.sbtn.sbtn-microsoft:hover {
    border-color: #00a4ef;
    background: #f0f9ff;
    color: #00a4ef;
    box-shadow: 0 6px 16px rgba(0, 164, 239, .15), 0 2px 6px rgba(0, 164, 239, .06);
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.af { text-align: center; margin-top: 1.75rem; font-size: .72rem; color: var(--vh-text-muted); line-height: 1.4; }
.af a {
    color: var(--vh-text-muted); text-decoration: none;
    position: relative;
    transition: color .25s ease;
}
.af a::after {
    content: '';
    position: absolute; bottom: -1px; left: 0; right: 0;
    height: 1px;
    background: var(--vh-primary-dark);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.af a:hover { color: var(--vh-primary-dark); }
.af a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ── PARTICLES / CONFETTI ─────────────────────────────────────────────── */
.ptc { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
.pt {
    position: absolute; border-radius: 50%;
    animation: fly .9s cubic-bezier(.25,.46,.45,.94) forwards;
    will-change: transform, opacity;
}
.pt.rect { border-radius: var(--radius-xs); width: 4px; height: 8px; }
.pt.star {
    border-radius: 0;
    width: 0; height: 0;
    background: none;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 7px solid var(--pt-color, #F2C94C);
}
@keyframes fly {
    0%   { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0) rotate(var(--r, 180deg)); }
}

/* ── MAGIC CODE / 2FA ──────────────────────────────────────────────────── */
.magic-link {
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    margin-top: .75rem;
    font-size: .76rem; font-weight: 600; color: var(--vh-primary-dark);
    cursor: pointer; background: 0; border: 0;
    padding: .45rem .5rem; border-radius: var(--radius-sm, 10px);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    width: 100%;
}
.magic-link:hover { color: var(--vh-primary-hover); background: rgba(var(--vh-primary-rgb),.06); transform: translateY(-1px); }
.magic-link:active { transform: translateY(0); }
.magic-link:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }
.magic-link svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform .3s ease; }
.magic-link:hover svg { transform: rotate(15deg) scale(1.1); }

/* Panels */
.panel { display: none; opacity: 0; transform: translateY(14px); }
.panel.on { display: block; animation: panelIn .45s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* Code input grid */
.code-inputs { display: flex; gap: 8px; justify-content: center; margin: 1.5rem 0 1rem; }
.code-input {
    width: 52px; height: 64px;
    text-align: center;
    font-family: var(--vh-font-display);
    font-size: 1.75rem; font-weight: 700;
    color: var(--vh-text);
    background: var(--vh-surface, #fff);
    border: 2px solid var(--vh-border);
    border-radius: var(--radius-md, 12px);
    outline: 0;
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
    caret-color: var(--vh-primary);
    -moz-appearance: textfield;
}
.code-input::-webkit-outer-spin-button,
.code-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.code-input:focus {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb),.2);
    transform: translateY(-2px);
}
.code-input.filled {
    border-color: var(--vh-primary);
    background: var(--vh-highlight, #fffcf0);
    box-shadow: 0 2px 8px rgba(var(--vh-primary-rgb),.1);
}
.code-input.ok {
    border-color: var(--vh-success);
    background: rgba(var(--vh-success-rgb), .04);
    box-shadow: 0 0 0 3px rgba(var(--vh-success-rgb), .1);
    color: var(--vh-success);
}
.code-input.err {
    border-color: var(--vh-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
    animation: fieldShake .35s ease;
}
.code-inputs .code-input:nth-child(4) { margin-left: 8px; }

/* Code panel header */
.code-header { text-align: center; margin-bottom: .25rem; }
.code-header .at { margin-bottom: .4rem; }
.code-email { display: block; font-weight: 600; color: var(--vh-text); margin-top: .25rem; font-size: .88rem; }

/* Timer badge */
.code-timer {
    display: flex; align-items: center; justify-content: center; gap: .3rem;
    font-size: .72rem; font-weight: 600; color: var(--vh-primary-dark);
    margin: .5rem 0;
    transition: color .3s ease;
}
.code-timer svg { width: 13px; height: 13px; }
.code-timer.expired { color: var(--vh-error); }

/* Resend row */
.code-footer { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: .75rem; }
.code-resend {
    font-size: .74rem; color: var(--vh-text-muted);
    background: 0; border: 0; cursor: pointer;
    font-weight: 500; padding: .35rem .5rem;
    border-radius: var(--radius-xs, 8px); transition: all .2s;
}
.code-resend:hover:not(:disabled) { color: var(--vh-primary-dark); background: rgba(var(--vh-primary-rgb),.05); }
.code-resend:disabled { opacity: .45; cursor: not-allowed; }
.code-resend:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }
.code-back {
    display: flex; align-items: center; gap: .25rem;
    font-size: .72rem; color: var(--vh-text-tertiary);
    background: 0; border: 0; cursor: pointer;
    font-weight: 500; padding: .35rem .5rem;
    border-radius: var(--radius-xs, 8px); transition: all .2s;
}
.code-back:hover { color: var(--vh-text-secondary); background: rgba(0, 0, 0, .02); }
.code-back:focus-visible { outline: 2px solid var(--vh-primary); outline-offset: 2px; }
.code-back svg { width: 12px; height: 12px; }

/* Magic email panel */
.magic-icon {
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--vh-highlight, #fffcf0);
    border: 1px solid var(--vh-border);
    transition: transform .3s ease, box-shadow .3s ease;
}
.magic-icon:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb),.12); }
.magic-icon svg { width: 24px; height: 24px; color: var(--vh-primary-dark); }

/* ── Magic login hint ──────────────────────────────────────────────────── */
.magic-hint {
    display: flex; align-items: center; gap: .45rem;
    padding: .5rem .7rem;
    background: rgba(var(--vh-primary-rgb),.04);
    border: 1px solid rgba(var(--vh-primary-rgb),.1);
    border-radius: var(--radius-sm, 10px);
    font-size: .72rem; font-weight: 500;
    color: var(--vh-text-muted);
    margin: .5rem 0 .15rem;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}
.magic-hint:hover {
    background: rgba(var(--vh-primary-rgb),.07);
    border-color: rgba(var(--vh-primary-rgb),.18);
}
.magic-hint svg {
    width: 16px; height: 16px; flex-shrink: 0;
    color: var(--vh-primary-dark);
    opacity: .7;
}
.magic-hint.h { display: none; margin: 0; }

/* ── Submit button mail icon ──────────────────────────────────────────── */
.ba-mail {
    position: relative; z-index: 2;
    opacity: .6;
    transition: transform .2s ease, opacity .2s ease;
}
.sub:hover:not(:disabled):not(.ld) .ba-mail { opacity: .9; transform: translateY(-1px); }
.sub.ld .ba-mail, .sub.ok .ba-mail { display: none; }

/* ── Shake animation ───────────────────────────────────────────────────── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* ── Loading overlay for form area ────────────────────────────────────── */
.form-loading {
    position: relative;
    pointer-events: none;
}
.form-loading::after {
    content: '';
    position: absolute; inset: -4px;
    background: rgba(255,255,255,.5);
    border-radius: var(--radius-md, 12px);
    z-index: 5;
    animation: formLoadFade .3s ease both;
}
@keyframes formLoadFade { from { opacity: 0; } to { opacity: 1; } }

/* ── Skip to content (a11y) ───────────────────────────────────────────── */
.skip-link {
    position: absolute;
    left: -9999px; top: auto;
    width: 1px; height: 1px;
    overflow: hidden;
    z-index: 10000;
    padding: .5rem 1rem;
    background: var(--vh-primary);
    color: var(--vh-on-primary, #554000);
    font-weight: 700; font-size: .85rem;
    border-radius: var(--radius-sm, 10px);
    text-decoration: none;
}
.skip-link:focus {
    position: fixed;
    left: 1rem; top: 1rem;
    width: auto; height: auto;
    clip: auto;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .S { display: none; }
    .L::before { display: none; }
    .mh { display: flex; }
    .bk { display: none; }
    .trust { display: none; }
    .R {
        justify-content: flex-start;
        padding: 1.5rem;
        padding-top: 2rem;
    }
    .C {
        max-width: 420px;
    }
}

@media (max-width: 480px) {
    .C { max-width: 100%; }
    .at { font-size: 1.4rem; }
    .R { padding: 1.25rem 1rem; padding-top: 1.5rem; }
    .soc { flex-direction: column; }
    .sbtn { justify-content: center; }
    .code-input { width: 44px; height: 56px; font-size: 1.5rem; border-radius: var(--radius-sm, 10px); }
    .code-inputs { gap: 6px; }
    .tabs { margin-bottom: 1.25rem; }
    .ah { margin-bottom: 1rem; }
    .mh { margin-bottom: 1.25rem; }
    .sub { margin-top: .85rem; }
}

@media (max-width: 360px) {
    .R { padding: 1rem .75rem; }
    .at { font-size: 1.25rem; }
    .code-input { width: 38px; height: 50px; font-size: 1.35rem; }
    .code-inputs { gap: 4px; }
    .code-inputs .code-input:nth-child(4) { margin-left: 4px; }
}

/* Mobile keyboard handling — shrink layout when keyboard open */
@media (max-height: 500px) and (max-width: 960px) {
    .R { padding-top: .75rem; justify-content: flex-start; }
    .mh { margin-bottom: .75rem; }
    .ah { margin-bottom: .5rem; }
    .at { font-size: 1.15rem; }
    .as { font-size: .75rem; }
    .tabs { margin-bottom: .75rem; padding: 2px; }
    .tab { padding: .35rem .5rem; font-size: .72rem; }
    .fl { margin-bottom: .5rem; }
    .fl-in { height: 44px; padding-top: .65rem; padding-bottom: .35rem; }
    .sub { margin-top: .5rem; padding: .6rem 1rem; min-height: 40px; }
    .af { margin-top: .75rem; }
    .dv { margin: .5rem 0; }
    .soc { gap: .35rem; }
    .tr { margin: .25rem 0 .05rem; }
    .fr { margin: .35rem 0 .1rem; }
}

/* Virtual keyboard open (JS-driven via visualViewport) */
.keyboard-open .R {
    padding-top: .75rem;
    justify-content: flex-start;
}
.keyboard-open .mh { margin-bottom: .75rem; }
.keyboard-open .ah { margin-bottom: .5rem; }
.keyboard-open .at { font-size: 1.15rem; }
.keyboard-open .as { font-size: .75rem; }
.keyboard-open .tabs { margin-bottom: .75rem; padding: 2px; }
.keyboard-open .tab { padding: .35rem .5rem; font-size: .72rem; }
.keyboard-open .fl { margin-bottom: .5rem; }
.keyboard-open .fl-in { height: 44px; padding-top: .65rem; padding-bottom: .35rem; }
.keyboard-open .sub { margin-top: .5rem; padding: .6rem 1rem; min-height: 40px; }
.keyboard-open .af { margin-top: .75rem; }
.keyboard-open .dv { margin: .5rem 0; }
.keyboard-open .soc { gap: .35rem; }
.keyboard-open .tr { margin: .25rem 0 .05rem; }
.keyboard-open .fr { margin: .35rem 0 .1rem; }
.keyboard-open .S-feats,
.keyboard-open .S-p { display: none; }

@supports (padding: env(safe-area-inset-bottom)) {
    .R { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

/* Touch devices: larger tap targets */
@media (pointer: coarse) {
    .sub { min-height: 52px; }
    .sbtn { min-height: 48px; }
    .tab { min-height: 44px; }
    .pw-eye { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .fgt { min-height: 44px; display: inline-flex; align-items: center; }
    .lop { min-height: 44px; }
    .code-back { min-height: 44px; }
    .code-resend { min-height: 44px; }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .tslide { transition-duration: 0.01ms !important; }
    .pt { animation: none !important; display: none !important; }
    .sub::before { animation: none !important; }
    /* Ensure card still appears (no blur stuck) */
    .C { opacity: 1 !important; filter: none !important; transform: none !important; }
}

/* ── Forced colors (Windows High Contrast) ────────────────────────────── */
@media (forced-colors: active) {
    .sub {
        border: 2px solid ButtonText;
        forced-color-adjust: none;
        background: ButtonFace;
        color: ButtonText;
    }
    .sub:hover:not(:disabled) {
        background: Highlight;
        color: HighlightText;
        border-color: Highlight;
    }
    .sub:disabled {
        border-color: GrayText;
        color: GrayText;
    }
    .sub::before { display: none; }
    .fl-in {
        border: 2px solid ButtonText;
        background: Field;
        color: FieldText;
    }
    .fl-in:focus {
        outline: 2px solid Highlight;
        outline-offset: 2px;
        border-color: Highlight;
        box-shadow: none;
    }
    .fl-in.err { border-color: LinkText; }
    .fl-in.ok { border-color: ButtonText; }
    .tab {
        border: 1px solid transparent;
    }
    .tab.on {
        border-color: Highlight;
    }
    .tab:focus-visible {
        outline: 2px solid Highlight;
    }
    .tslide {
        background: Highlight;
        forced-color-adjust: none;
    }
    .sbtn {
        border: 2px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
    }
    .sbtn:hover {
        background: Highlight;
        color: HighlightText;
        border-color: Highlight;
    }
    .ge {
        border: 2px solid LinkText;
        background: Canvas;
        color: CanvasText;
    }
    .ge.success {
        border-color: ButtonText;
    }
    .fl-hint.err { color: LinkText; }
    .fl-hint.ok { color: CanvasText; }
    .code-input {
        border: 2px solid ButtonText;
        background: Field;
        color: FieldText;
    }
    .code-input:focus {
        outline: 2px solid Highlight;
        box-shadow: none;
    }
    .pw-meter-seg {
        forced-color-adjust: none;
        border: 1px solid ButtonText;
    }
    .pw-meter-seg.filled {
        background: Highlight;
    }
    .pt { display: none !important; }
    .S { border-right: 2px solid CanvasText; }
    .tr-box {
        border: 2px solid ButtonText;
        forced-color-adjust: none;
    }
    .tr-custom-chk input:checked + .tr-box {
        background: Highlight;
        border-color: Highlight;
    }
    .pw-req svg { color: ButtonText; }
    .pw-req.met svg { color: Highlight; }
    .pw-match { color: CanvasText; }
    .pw-match.match { color: Highlight; }
    .pw-match.mismatch { color: LinkText; }
}
