/* Sign-in, sign-up and recovery pages (layout.auth).

   The member app's frame, from the first screen: one ink surface (the sidebar's
   #0f0e29) and one indigo light. The ink panel draws this install's network shape
   (site/partials/_auth_tree) with the sidebar's hairlines; on sign-up the lit route
   comes down to an open place and carries on as the steps (site/partials/_auth_route).
   With FRONTEND_THEME=investment it draws rising bars instead (site/partials/_auth_growth),
   with the same classes and the same single draw.
   Colour is for meaning: the indigo action, the lit route, status messages.
   One typeface (partials/_font). No Tailwind or jQuery on these pages. */

.au-body { margin: 0; background: #ffffff; }

.au {
    --au-ink:       #0f0e29;
    --au-ink-node:  #1d1c4a;
    --au-ink-edge:  #47458a;
    --au-ink-line:  #2c2b5f;
    --au-ink-text:  rgba(226, 228, 255, .74);
    --au-ink-dim:   rgba(226, 228, 255, .5);
    --au-hi:        #8f8cff;
    --au-paper:     #ffffff;
    --au-tint:      #f5f6fb;
    --au-text:      #0f1330;
    --au-text-2:    #2a3052;
    --au-muted:     #5b6284;
    --au-faint:     #7d839f;
    --au-line:      #e3e6f0;
    --au-line-2:    #c9cee0;
    --au-brand:     #4f46e5;
    --au-brand-d:   #3f37c9;
    --au-ring:      rgba(79, 70, 229, .22);
    --au-radius:    12px;
    --au-field-h:   50px;

    display: grid;
    grid-template-columns: minmax(400px, 5fr) 7fr;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--au-paper);
    color: var(--au-text-2);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.au *, .au *::before, .au *::after { box-sizing: border-box; }
.au [hidden] { display: none !important; }

/* ── Ink panel ────────────────────────────────────────────────────────── */
.au-panel {
    position: sticky; top: 0;
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    padding: 32px 48px 40px;
    overflow: hidden;
    background: var(--au-ink);
    color: var(--au-ink-text);
}
.au-brand {
    display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
    color: #fff; text-decoration: none;
    font-size: 17px; font-weight: 700; letter-spacing: -.012em;
    border-radius: 10px;
}
.au-brand:focus-visible { outline: 2px solid var(--au-hi); outline-offset: 4px; }
/* An uploaded logo may be dark on transparent: it sits on a small white tile. */
.au-brand img { display: block; height: 38px; width: auto; max-width: 170px; padding: 5px; border-radius: 10px; background: #fff; object-fit: contain; }
.au-brand__mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--au-brand); color: #fff; font-size: 17px; font-weight: 700; }

.au-art { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 440px; min-height: 0; padding: 24px 0; }
.au.is-join .au-art { justify-content: flex-start; max-width: 360px; padding-top: 48px; }
.au-note { margin: 0; max-width: 24ch; color: #fff; font-size: 21px; line-height: 1.35; font-weight: 600; letter-spacing: -.012em; }

/* The network drawing */
.au-net { display: block; width: 100%; height: auto; overflow: visible; }
.au-net .ln   { fill: none; stroke: var(--au-ink-line); stroke-width: 1; }
.au-net .nd   { fill: var(--au-ink-node); stroke: var(--au-ink-edge); stroke-width: 1; }
.au-net .nd.is-route { fill: var(--au-hi); stroke: none; }
.au-net .rt   { fill: var(--au-hi); }
.au-net .lit  { fill: none; stroke: var(--au-hi); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.au-net .halo { fill: none; stroke: var(--au-hi); stroke-opacity: .38; stroke-width: 1.2; }
.au-net .you  { fill: var(--au-hi); }
.au-net .open { fill: var(--au-ink); stroke: var(--au-hi); stroke-width: 1.4; stroke-dasharray: 3 3; }
.au-net .tag  { fill: #e7e8ff; font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; letter-spacing: .005em; }
/* Investment site: rising bars, a climb still ahead (sign-up) and the arrow at its end. */
.au-net .bar  { fill: var(--au-ink-node); stroke: var(--au-ink-edge); stroke-width: 1; }
.au-net .ln--ahead { stroke: var(--au-ink-edge); stroke-dasharray: 3 4; }
.au-net .tip  { fill: none; stroke: var(--au-hi); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* The one moment of motion: the route draws from the root, then its places light up. */
@keyframes au-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes au-show { from { opacity: 0; } to { opacity: 1; } }
.au-net .lit { animation: au-draw 1.4s cubic-bezier(.45, 0, .2, 1) .2s both; }
.au-net .nd.is-route, .au-net .halo, .au-net .you, .au-net .open, .au-net .tag, .au-net .tip { animation: au-show .45s ease-out 1.45s both; }

/* Sign-up steps: stations on the line that comes down from the drawing. */
.au-steps { margin-left: calc(var(--spine, 8%) - 6px); }
.au-steps__count { display: none; }
.au-route { margin: 0; padding: 4px 0 0; list-style: none; }
.au-route__step { position: relative; min-height: 46px; padding: 0 0 18px 30px; color: var(--au-ink-dim); font-size: 15px; font-weight: 500; line-height: 1.4; }
.au-route__step::before { content: ''; position: absolute; left: 5.5px; top: 18px; bottom: -6px; width: 1px; background: var(--au-ink-line); }
.au-route__step:last-child { padding-bottom: 0; }
.au-route__step:last-child::before { display: none; }
.au-route__node { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--au-ink); box-shadow: inset 0 0 0 1px var(--au-ink-edge); }
.au-route__step.is-done { color: var(--au-ink-text); }
.au-route__step.is-done::before { background: var(--au-hi); }
.au-route__step.is-done .au-route__node { background: var(--au-hi); box-shadow: none; }
.au-route__step.is-now { color: #fff; font-weight: 600; }
.au-route__step.is-now .au-route__node { background: var(--au-hi); box-shadow: 0 0 0 5px rgba(143, 140, 255, .2); }
.au-route__meta { display: block; margin-top: 3px; color: var(--au-hi); font-size: 13.5px; font-weight: 500; }

/* ── Form side ────────────────────────────────────────────────────────── */
.au-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; background: var(--au-paper); }
.au-sheet { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 424px; margin: 0 auto; padding: 64px 24px 48px; }
.au-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 18px 40px 22px; border-top: 1px solid #eef0f6; color: var(--au-faint); font-size: 13px; }
.au-foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.au-foot a { color: var(--au-muted); text-decoration: none; }
.au-foot a:hover { color: var(--au-text); text-decoration: underline; text-underline-offset: 3px; }
.au-foot .au-lang { margin-left: auto; }

.au-head { margin-bottom: 30px; }
.au-title { margin: 0; color: var(--au-text); font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; }
.au-lede { margin: 10px 0 0; max-width: 46ch; color: var(--au-muted); font-size: 15px; line-height: 1.55; }

.au-sheet a:not(.au-btn) { color: var(--au-brand); font-weight: 600; text-decoration: none; border-radius: 4px; }
.au-sheet a:not(.au-btn):hover { color: var(--au-brand-d); text-decoration: underline; text-underline-offset: 3px; }
.au-sheet a:not(.au-btn):focus-visible { outline: 2px solid var(--au-brand); outline-offset: 2px; }

/* Fields */
.au-form { display: grid; gap: 18px; margin: 0; }
.au-field { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.au-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--au-text-2); font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.au-label .au-opt { color: var(--au-faint); font-weight: 500; }
legend.au-label { width: 100%; margin: 0 0 7px; padding: 0; }
.au-label a { font-size: 13.5px; }
.au-hint { margin: 0; color: var(--au-muted); font-size: 13px; line-height: 1.45; }
.au-hint.is-warn { color: #93370d; font-weight: 500; }

.au-input {
    display: block; width: 100%; height: var(--au-field-h); margin: 0; padding: 0 14px;
    border: 1px solid var(--au-line-2); border-radius: var(--au-radius); background: #fff;
    color: var(--au-text); font: inherit; font-size: 16px; line-height: 1.2;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
    -webkit-appearance: none; appearance: none;
}
.au-input::placeholder { color: #9aa0bb; opacity: 1; }
.au-input:hover { border-color: #aab0c8; }
.au-input:focus { outline: none; border-color: var(--au-brand); box-shadow: 0 0 0 3px var(--au-ring); }
.au-input.is-locked { background: var(--au-tint); color: var(--au-text-2); cursor: default; }
.au-input.is-locked:focus { border-color: var(--au-line-2); box-shadow: none; }
select.au-input {
    padding-right: 42px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235b6284' stroke-width='1.6'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.au-input--otp { height: 60px; padding-left: calc(14px + .45em); text-align: center; font-size: 26px; font-weight: 600; letter-spacing: .45em; font-variant-numeric: tabular-nums; }

.au-pw { position: relative; }
.au-pw .au-input { padding-right: 52px; }
.au-pw__toggle {
    position: absolute; top: 1px; right: 1px; bottom: 1px; width: 48px;
    display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 11px 11px 0;
    background: none; color: var(--au-faint); cursor: pointer;
}
.au-pw__toggle:hover { color: var(--au-text); }
.au-pw__toggle:focus-visible { outline: 2px solid var(--au-brand); outline-offset: -5px; }
.au-pw__toggle svg { width: 20px; height: 20px; }
.au-pw__toggle .i-hide, .au-pw__toggle[aria-pressed="true"] .i-show { display: none; }
.au-pw__toggle[aria-pressed="true"] .i-hide { display: block; }

/* Country code + number: one control */
.au-phone {
    display: flex; height: var(--au-field-h); overflow: hidden;
    border: 1px solid var(--au-line-2); border-radius: var(--au-radius); background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.au-phone:hover { border-color: #aab0c8; }
.au-phone:focus-within { border-color: var(--au-brand); box-shadow: 0 0 0 3px var(--au-ring); }
.au-phone select, .au-phone input {
    height: 100%; margin: 0; border: 0; border-radius: 0; background-color: transparent;
    color: var(--au-text); font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none;
}
.au-phone select {
    flex: 0 0 auto; width: 96px; padding: 0 30px 0 14px; border-right: 1px solid var(--au-line); background-color: var(--au-tint); cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235b6284' stroke-width='1.6'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
.au-phone input { flex: 1; min-width: 0; padding: 0 14px; }
.au-phone select:focus, .au-phone input:focus { outline: none; }
.au-phone input::placeholder { color: #9aa0bb; opacity: 1; }

.au-check { display: flex; align-items: center; gap: 10px; color: var(--au-text-2); font-size: 14.5px; cursor: pointer; user-select: none; }
.au-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--au-brand); cursor: pointer; }

/* Placement side: one tap, no menu */
.au-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--au-radius); background: #eef0f7; }
.au-seg__opt { position: relative; }
.au-seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.au-seg__opt span { display: grid; place-items: center; height: 42px; border-radius: 9px; color: var(--au-muted); font-size: 14.5px; font-weight: 600; transition: background-color .15s, color .15s, box-shadow .15s; }
.au-seg__opt input:checked + span { background: #fff; color: var(--au-text); box-shadow: 0 1px 2px rgba(15, 19, 48, .1), 0 0 0 1px var(--au-line); }
.au-seg__opt input:focus-visible + span { outline: 2px solid var(--au-brand); outline-offset: 2px; }

/* Packages */
.au-pick { display: grid; gap: 8px; }
.au-pick__opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border: 1px solid var(--au-line-2); border-radius: var(--au-radius); background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.au-pick__opt:hover { border-color: #aab0c8; }
.au-pick__opt input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--au-brand); }
.au-pick__name { flex: 1; min-width: 0; color: var(--au-text); font-size: 15px; font-weight: 600; }
.au-pick__price { color: var(--au-text); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.au-pick__opt:has(input:checked) { border-color: var(--au-brand); box-shadow: 0 0 0 3px var(--au-ring); }
.au-pick__opt:has(input:focus-visible) { outline: 2px solid var(--au-brand); outline-offset: 2px; }

/* Buttons */
.au-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: var(--au-field-h); margin: 0; padding: 0 20px;
    border: 0; border-radius: var(--au-radius); background: var(--au-brand); color: #fff;
    font: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: .005em; line-height: 1;
    text-decoration: none; cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 19, 48, .12), inset 0 1px 0 rgba(255, 255, 255, .1);
    transition: background-color .15s, box-shadow .15s, transform .06s;
}
.au-btn:hover { background: var(--au-brand-d); }
.au-btn:active { transform: translateY(1px); }
.au-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--au-brand); }
.au-btn[disabled] { cursor: progress; opacity: .7; }
.au-btn--quiet { background: #fff; color: var(--au-text); box-shadow: inset 0 0 0 1px var(--au-line-2); }
.au-btn--quiet:hover { background: var(--au-tint); }
.au-btn__spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: au-spin .7s linear infinite; }
.au-btn.is-busy .au-btn__spin { display: inline-block; }
@keyframes au-spin { to { transform: rotate(360deg); } }

.au-actions { display: grid; gap: 14px; margin-top: 6px; }
.au-legal { margin: 0; color: var(--au-faint); font-size: 12.5px; line-height: 1.5; }
.au-legal a { font-weight: 500 !important; }
.au-alt { margin: 26px 0 0; color: var(--au-muted); font-size: 14.5px; }
.au-aside { display: flex; gap: 10px; margin: 30px 0 0; padding-top: 20px; border-top: 1px solid var(--au-line); color: var(--au-faint); font-size: 13px; line-height: 1.5; }
.au-aside svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; color: #9aa0bb; }

/* Live checks (referrer lookup, wallet progress) */
.au-check-result:empty { display: none; }
.au-check-result { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--au-muted); }
.au-check-result::before { content: ''; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.au-check-result.is-ok { color: #047857; }
.au-check-result.is-bad { color: #b42318; }

.au-status:empty { display: none; }
.au-status { padding: 12px 14px; border-radius: 10px; background: var(--au-tint); color: var(--au-text-2); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.au-status.is-ok { background: #ecfdf5; color: #065f46; }
.au-status.is-bad { background: #fef3f2; color: #912018; }

.au-wallet { margin: 0; padding: 12px 14px; border: 1px dashed var(--au-line-2); border-radius: var(--au-radius); }
.au-wallet dt { color: var(--au-muted); font-size: 13px; font-weight: 500; }
.au-wallet dd { margin: 3px 0 0; color: var(--au-text); font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* The new member ID, on the same ink as the panel: the thing to keep. */
.au-plate { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 22px; padding: 18px 18px 18px 22px; border-radius: 16px; background: var(--au-ink); color: #fff; }
.au-plate small { display: block; color: var(--au-ink-dim); font-size: 13px; font-weight: 500; }
.au-plate strong { display: block; margin-top: 2px; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.au-plate strong span { color: var(--au-hi); }
.au-copy { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: rgba(226, 228, 255, .1); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.au-copy:hover { background: rgba(226, 228, 255, .18); }
.au-copy:focus-visible { outline: 2px solid var(--au-hi); outline-offset: 2px; }
.au-copy svg { width: 16px; height: 16px; }

/* Messages from msg() and validation */
.au .alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.au .alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.au .alert-danger  { background: #fef3f2; border-color: #fecdca; color: #912018; }
.au .alert-warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.au .alert-info, .au .alert-primary { background: #eef0ff; border-color: #c2c9ef; color: #262168; }

/* ── Phones and tablets ───────────────────────────────────────────────── */
@media (max-width: 1023.98px) {
    .au { display: flex; flex-direction: column; background: var(--au-ink); --au-field-h: 52px; }
    /* The panel becomes a band: brand, and the network small beside it. */
    .au-panel {
        position: relative; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
        padding: 18px 20px 44px; padding-top: max(18px, env(safe-area-inset-top));
    }
    .au-brand { font-size: 16.5px; }
    .au-brand img { height: 34px; }
    .au-brand__mark { width: 34px; height: 34px; font-size: 16px; }
    .au-art { max-width: none; padding: 0; justify-content: center; }
    .au-net { width: auto; height: 88px; }
    .au-net .tag { display: none; }
    .au-note { display: none; }

    /* Sign-up: the steps become a row of stations under the brand. */
    .au.is-join .au-panel { grid-template-columns: 1fr; gap: 18px; padding-bottom: 46px; }
    .au.is-join .au-art { padding: 0; }
    .au.is-join .au-net { display: none; }
    .au-steps { margin-left: 0; }
    .au-steps__count { display: block; margin: 0 0 12px; color: #fff; font-size: 14.5px; font-weight: 600; }
    .au-route { display: flex; padding: 0; }
    .au-route__step { flex: 1; min-height: 0; padding: 0; }
    .au-route__step::before { left: 12px; right: 4px; top: 5.5px; bottom: auto; width: auto; height: 1px; }
    .au-route__step:last-child { flex: 0 0 12px; }
    .au-route__label, .au-route__meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .au-route__node { position: relative; top: 0; display: block; }

    /* The form rises over the band on a sheet. */
    .au-main { position: relative; z-index: 1; flex: 1 0 auto; min-height: 0; margin-top: -24px; border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px -18px rgba(15, 14, 41, .6); }
    .au-sheet { justify-content: flex-start; max-width: 480px; padding: 30px 20px 36px; }
    .au-head { margin-bottom: 26px; }
    .au-title { font-size: 26px; }
    .au-foot { flex-direction: column; align-items: center; gap: 12px; padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); text-align: center; }
    .au-foot__links { justify-content: center; }
    .au-foot .au-lang { margin-left: 0; }
    .au-plate strong { font-size: 26px; }
}
@media (max-width: 1023.98px) and (min-height: 760px) {
    .au-sheet { padding-top: 36px; }
}
/* Short laptop screens: keep the sign-up line and steps in view. */
@media (min-width: 1024px) and (max-height: 780px) {
    .au-panel { padding-top: 24px; padding-bottom: 28px; }
    .au.is-join .au-art { padding-top: 24px; }
    .au.is-join .au-art { max-width: 290px; }
    .au-route__step { min-height: 40px; padding-bottom: 12px; }
}

/* Inside the mobile app (?mobile=1): the form alone. */
.au.is-app { display: block; background: var(--au-paper); }
.au.is-app .au-main { margin: 0; border-radius: 0; box-shadow: none; min-height: 100vh; min-height: 100dvh; }
.au.is-app .au-sheet { justify-content: flex-start; padding: 24px 20px 32px; }

@media (prefers-reduced-motion: reduce) {
    .au-net .lit, .au-net .nd.is-route, .au-net .halo, .au-net .you, .au-net .open, .au-net .tag, .au-net .tip { animation: none; }
    .au-btn, .au-input, .au-phone { transition: none; }
}
