/* ============================================================
   vm-auth.css — VOUCHMORPH sign in (login.php) and registration
   (register.php). One stylesheet so the two pages stay identical.

   Same brand system as admin (serif display, brass/ink, frame
   motif) but the right column flips from dark editorial to a
   light, doodled panel — friendlier, consumer-facing register.
   ============================================================ */
:root {
    --paper:        #FBF9F5;
    --panel:        #FFFFFF;
    --ink-900:      #16232E;
    --ink-700:      #24384A;
    --ink-500:      #5B6B78;
    --ink-300:      #9AA6AC;
    --line:         #E4DFD3;
    --line-strong:  #CFC7B4;
    --brass:        #B4884A;
    --brass-deep:   #8A6530;
    --brass-tint:   #F6EFDF;
    --mint:         #6E9A85;
    --danger:       #b3261e;
    --danger-bg:    #fbeceb;
    --f-display: 'Source Serif 4', 'IBM Plex Sans', serif;
    --f-body: 'IBM Plex Sans', sans-serif;
    --f-cond: 'IBM Plex Sans Condensed', sans-serif;
    --f-mono: 'IBM Plex Mono', monospace;
    --f-script: 'Alex Brush', 'Brush Script MT', cursive;
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
    --sp-9: 48px; --sp-10: 64px;
    --frame-inset: calc(var(--sp-6) * 0.5);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: var(--f-body);
    color: var(--ink-900);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.split { display: flex; min-height: 100vh; width: 100%; }
.col { min-width: 0; display: flex; flex-direction: column; }

/* LEFT — 58% — clean paper, the actual form */
.col-form {
    flex: 0 0 58%;
    background: var(--paper);
    align-items: center;
    justify-content: center;
    padding: var(--sp-8) var(--sp-6);
}
.form-wrap { width: 100%; max-width: 440px; }

.brand { margin-bottom: var(--sp-7); }
.brand .mark {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 26px;
    letter-spacing: 0.005em;
    color: var(--ink-900);
}
.brand .mark sup { font-size: 11px; color: var(--brass-deep); font-weight: 600; }
.brand .division {
    margin-top: var(--sp-2);
    font-family: var(--f-cond);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-300);
    padding-top: var(--sp-2);
    border-top: 2px solid var(--brass);
    display: inline-block;
}

.form-wrap h2 {
    font-family: var(--f-display);
    font-size: 26px;
    font-weight: 600;
    color: var(--ink-900);
}
.form-wrap .subtitle {
    color: var(--ink-500);
    font-size: 14px;
    margin-top: var(--sp-1);
    margin-bottom: var(--sp-6);
}

/* Identifier type — quiet tab row instead of loud pill buttons */
.id-tabs {
    display: flex;
    gap: var(--sp-1);
    border-bottom: 1.5px solid var(--line);
    margin-bottom: var(--sp-6);
    overflow-x: auto;
    scrollbar-width: none;
}
.id-tabs::-webkit-scrollbar { display: none; }
.id-tab {
    flex: 0 0 auto;
    background: none;
    border: none;
    padding: var(--sp-3) var(--sp-3) 10px;
    font-family: var(--f-cond);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-300);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color .15s;
}
.id-tab:hover { color: var(--ink-700); }
.id-tab.active { color: var(--brass-deep); }
.id-tab.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1.5px;
    height: 2px;
    background: var(--brass);
}

.field { margin-bottom: var(--sp-5); }
.field label {
    display: block;
    margin-bottom: var(--sp-2);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-500);
    font-family: var(--f-cond);
}
.field label .hint {
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--ink-300);
    font-family: var(--f-body);
}
.field-input { position: relative; display: flex; }
.field-input svg {
    position: absolute;
    left: var(--sp-4);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--ink-300);
    pointer-events: none;
}
.phone-prefix {
    display: none;
    align-items: center;
    padding: 0 var(--sp-3);
    font-family: var(--f-mono);
    font-size: 14px;
    color: var(--brass-deep);
    background: var(--brass-tint);
    border: 1.5px solid var(--line);
    border-right: none;
}
.phone-prefix.show { display: flex; }
.field input {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: var(--sp-4) var(--sp-4) var(--sp-4) 44px;
    border: 1.5px solid var(--line);
    font-size: 15px;
    font-family: var(--f-body);
    background: #fff;
    transition: border-color .15s, background .15s;
    color: var(--ink-900);
    border-radius: 0;
}
.field-input.has-prefix input { padding-left: var(--sp-4); }
.field input:focus { outline: none; border-color: var(--brass); }
.field input::placeholder { color: var(--ink-300); opacity: 0.8; }
.pin-input { font-family: var(--f-mono); letter-spacing: 0.35em; }

.field-input.has-toggle input { padding-right: 44px; }
.pin-toggle {
    position: absolute;
    right: var(--sp-2);
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--ink-300);
    transition: color .15s;
}
.pin-toggle:hover { color: var(--ink-700); }
.pin-toggle svg { width: 18px; height: 18px; pointer-events: none; }

.consent {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    margin: var(--sp-1) 0 var(--sp-4);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-500);
    cursor: pointer;
}
.consent input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--brass-deep);
    cursor: pointer;
}
.consent a { color: var(--brass-deep); text-decoration: underline; text-underline-offset: 2px; }
.consent a:hover { color: var(--ink-900); }
.consent.needs-tick { color: var(--danger); }

/* The credentials step no longer carries a checkbox: agreement is asked for
   once per version of the documents, on its own step, not at every sign-in.
   This is the quiet notice that stays under the button. */
.consent-note {
    margin: var(--sp-3) 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-400, var(--ink-500));
    text-align: center;
}
.consent-note a { color: var(--brass-deep); text-decoration: underline; text-underline-offset: 2px; }
.consent-note a:hover { color: var(--ink-900); }

.btn {
    width: 100%;
    padding: var(--sp-4);
    background: var(--ink-900);
    color: #fff;
    border: 1.5px solid var(--ink-900);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--f-cond);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    border-radius: 0;
    margin-top: var(--sp-2);
}
.btn:hover { background: var(--brass); border-color: var(--brass); color: var(--ink-900); }
.btn svg { width: 16px; height: 16px; transition: transform .15s; }
.btn:hover svg { transform: translateX(4px); }

.error {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    background: var(--danger-bg);
    color: var(--danger);
    padding: var(--sp-4);
    margin-bottom: var(--sp-6);
    font-size: 13px;
    border-left: 3px solid var(--danger);
    line-height: 1.5;
    font-weight: 500;
}
.error svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.dev-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    background: var(--brass-tint);
    color: var(--brass-deep);
    padding: var(--sp-3) var(--sp-4);
    margin-bottom: var(--sp-6);
    font-size: 11.5px;
    border-left: 3px solid var(--brass);
    line-height: 1.5;
    font-family: var(--f-cond);
    letter-spacing: 0.01em;
}
.dev-notice svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.dev-notice strong { text-transform: uppercase; letter-spacing: 0.06em; }

.trust-row {
    display: flex;
    justify-content: space-between;
    margin-top: var(--sp-7);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--line);
    font-size: 10.5px;
    color: var(--ink-300);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    font-family: var(--f-cond);
}
.trust-row span { display: flex; align-items: center; gap: var(--sp-2); }
.trust-row svg { width: 14px; height: 14px; color: var(--brass); }

.foot-links {
    display: flex;
    justify-content: center;
    gap: var(--sp-6);
    margin-top: var(--sp-7);
    font-family: var(--f-cond);
    font-size: 11.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
}
.foot-links a { color: var(--ink-500); text-decoration: none; transition: color .15s; }
.foot-links a:hover { color: var(--brass-deep); }

/* ============================================================
   RIGHT — 42% — light doodle panel
   Same frame motif as admin, but paper-toned with a scatter of
   thin-line financial doodles instead of the dark editorial copy.
   ============================================================ */
.col-brand {
    flex: 0 0 42%;
    background: var(--brass-tint);
    position: relative;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
}
.frame-mat { position: relative; flex: 1; margin: var(--frame-inset); }
.frame-line {
    position: absolute;
    inset: var(--frame-inset);
    border: 1px solid rgba(22,35,46,0.14);
    pointer-events: none;
}
.frame-strip {
    position: absolute;
    color: rgba(22,35,46,0.4);
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.frame-strip.top {
    top: calc(var(--frame-inset) - 10px);
    left: calc(var(--frame-inset) + 30px);
    right: calc(var(--frame-inset) + 30px);
    height: 20px;
    background: var(--brass-tint);
    padding: 0 12px;
}
.frame-strip.bottom {
    bottom: calc(var(--frame-inset) - 10px);
    left: calc(var(--frame-inset) + 30px);
    right: calc(var(--frame-inset) + 30px);
    height: 20px;
    background: var(--brass-tint);
    padding: 0 12px;
}
.frame-strip.lateral {
    right: calc(var(--frame-inset) - 24px);
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    width: 26px;
    height: auto;
    writing-mode: vertical-rl;
    color: var(--brass-deep);
    font-family: var(--f-cond);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.34em;
    z-index: 3;
}

/* Doodle field — thin hand-style line icons scattered across the panel */
.doodle-field {
    position: absolute;
    inset: var(--frame-inset);
    z-index: 0;
    overflow: hidden;
}
.doodle-field svg { position: absolute; stroke: rgba(22,35,46,0.20); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.doodle-field svg.brass { stroke: rgba(180,136,74,0.42); }
.doodle-field svg.faint { stroke: rgba(22,35,46,0.12); }

.magazine {
    position: absolute;
    inset: var(--frame-inset);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-7) var(--sp-6);
    z-index: 1;
}
/* halo, not a fade: punches letterforms clear of doodles crossing
   behind them without masking the artwork itself */
.halo-text {
    text-shadow:
        0 0 6px var(--brass-tint), 0 0 6px var(--brass-tint),
        0 0 10px var(--brass-tint), 0 0 10px var(--brass-tint);
}
.magazine .script-word {
    font-family: var(--f-script);
    font-size: 32px;
    font-weight: 700;
    color: var(--ink-900);
    letter-spacing: 0.03em;
    margin-bottom: var(--sp-4);
    opacity: 0.92;
}
.magazine .eyebrow {
    font-family: var(--f-cond);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brass-deep);
    margin-bottom: var(--sp-4);
}
.magazine p {
    font-family: var(--f-body);
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-700);
    max-width: 300px;
}
.magazine p.secondary {
    font-size: 12px;
    line-height: 1.7;
    color: var(--ink-500);
    max-width: 290px;
    margin-top: var(--sp-4);
}
.magazine p.secondary strong { color: var(--ink-700); font-weight: 600; }
.magazine .rule { margin-top: var(--sp-5); width: 40px; height: 1px; background: var(--brass); }

/* ============================================================
   REGISTRATION — pieces only register.php uses. None of these
   classes appear on login.php.
   ============================================================ */
.id-tab.locked { color: var(--line-strong); cursor: not-allowed; }
.id-tab.locked:hover { color: var(--ink-300); }

.help-text {
    margin-top: var(--sp-2);
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-300);
}
.field-input.plain input { padding-left: var(--sp-4); }

.link-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--f-cond);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brass-deep);
    cursor: pointer;
    transition: color .15s;
}
.link-toggle:hover { color: var(--ink-900); }

.additional-phones {
    display: none;
    margin-top: var(--sp-3);
    padding: var(--sp-4);
    background: var(--brass-tint);
    border-left: 3px solid var(--brass);
}
.additional-phones.show { display: block; }
.additional-phones .help-text { margin: 0 0 var(--sp-3); color: var(--brass-deep); }
.additional-phones .field-input + .field-input { margin-top: var(--sp-2); }

.contact-channel-group {
    display: none;
    margin-top: var(--sp-3);
    padding: var(--sp-4);
    background: var(--danger-bg);
    border-left: 3px solid var(--danger);
}
.contact-channel-group.show { display: block; }
.contact-channel-group .help-text { margin-top: 0; color: var(--danger); }
.contact-channel-choice {
    display: flex;
    gap: var(--sp-5);
    margin: var(--sp-2) 0 var(--sp-3);
    font-size: 13px;
    color: var(--ink-700);
}
.contact-channel-choice input { accent-color: var(--brass-deep); }

.otp-section { display: none; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:disabled:hover { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.btn:disabled:hover svg { transform: none; }
.btn-secondary { background: transparent; color: var(--ink-900); }
.btn-secondary:hover { background: var(--brass-tint); border-color: var(--brass); color: var(--ink-900); }

.resend-timer {
    margin-top: var(--sp-4);
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-500);
}

/* Status line under the buttons. .message.error also matches .error
   above, so it resets that block's flex layout and spacing. */
.message {
    display: block;
    margin: var(--sp-5) 0 0;
    padding: var(--sp-4);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    background: #fff;
    color: var(--ink-700);
    border-left: 3px solid var(--line-strong);
}
.message:empty { display: none; }
.message.error { display: block; margin: var(--sp-5) 0 0; background: var(--danger-bg); color: var(--danger); border-left-color: var(--danger); }
.message.success { background: #EEF4F0; color: #3F6B57; border-left-color: var(--mint); }
.message.warning { background: var(--brass-tint); color: var(--brass-deep); border-left-color: var(--brass); }
.message .btn { margin-top: var(--sp-3); }

.fade-in { animation: vm-fade-up .35s ease; }
@keyframes vm-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .fade-in { animation: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .split { flex-direction: column; }
    .col-form { flex: 1 1 auto; order: 2; padding: var(--sp-7) var(--sp-5); }
    .col-brand { flex: 1 1 auto; order: 1; min-height: 260px; }
    :root { --frame-inset: calc(var(--sp-5) * 0.5); }
    .frame-strip.lateral { display: none; }
    .magazine p, .magazine p.secondary { max-width: 280px; }
    /* Stacked, the panel is only as tall as min-height, and an
       absolutely placed .magazine was cut off top and bottom once its
       copy ran past that. In the flow, the panel grows to fit it. */
    .magazine { position: relative; inset: auto; padding: var(--sp-8) var(--sp-5); }
}
@media (max-width: 480px) {
    .trust-row { flex-wrap: wrap; gap: var(--sp-3); justify-content: center; }
    .foot-links { gap: var(--sp-4); }
}
