/* ── Register page — Calm Canvas (Sage), matched to the studio admin login ──
   Same Hanken Grotesk type, warm canvas, hairline white card and teal accent as
   /auth/studio. Class names are kept (.reg-*) so the page markup reads cleanly;
   the look is driven entirely by the tokens on .reg-app below. ── */
.reg-app {
    --accent: #0E9488;
    --accent-ink: #FFFFFF;
    --bg: #F6F5F2;
    --panel: #FFFFFF;
    --ink: #23211E;
    --ctl: #56524C;
    --muted: #908C85;
    --soft: #B4AFA6;
    --line: #ECEAE5;
    --line-soft: #F1EFEB;
    --hover: #F4F2EE;
    --surface: #FCFBF9;
    --danger: #A23226;
    --r-card: 15px;
    --r-btn: 10px;
    --fieldH: 48px;

    position: fixed;
    inset: 0;
    overflow: auto;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.reg-app *, .reg-app *::before, .reg-app *::after { box-sizing: border-box; }
.reg-app a { color: inherit; text-decoration: none; }

.reg-shell {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 28px clamp(20px, 5vw, 64px);
}

/* top bar — "Back to site" (mirrors the login .lg-topbar / .lg-back) */
.reg-topbar { display: flex; align-items: center; }
.reg-back {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--muted); font-size: 13.5px; font-weight: 600;
    padding: 8px 12px; border-radius: var(--r-btn);
    transition: background .12s, color .12s;
}
.reg-back:hover { background: var(--hover); color: var(--ink); }

.reg-formwrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 28px 0; }

/* the single floating card that holds the whole form */
.reg-card {
    width: 100%;
    max-width: 600px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    padding: 38px clamp(22px, 5vw, 44px);
    box-shadow: 0 1px 2px rgba(20, 18, 14, .03), 0 22px 60px -34px rgba(20, 18, 14, .30);
}

/* brand */
.reg-brand { display: flex; margin-bottom: 22px; }
.reg-brand img { height: 30px; width: auto; max-width: 180px; object-fit: contain; display: block; }

/* heading — Hanken Grotesk, no Playfair (matches the login .lg-h1 / .lg-sub) */
.reg-form-title {
    margin: 0;
    font-family: inherit;
    font-size: 27px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1;
    color: var(--ink);
}
.reg-form-sub { margin: 9px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* steps */
.reg-steps {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin: 28px 0; flex-wrap: nowrap;
}
.reg-step-item { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.reg-step-num {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    color: var(--accent);
    border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.reg-step-label { font-size: 12px; font-weight: 600; color: var(--ctl); white-space: nowrap; }
.reg-step-line { flex: 0 0 64px; height: 2px; background: var(--line); margin: 0 14px; }

/* error alert (mirrors .lg-alert-error) */
.reg-alert-error {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 13px; border-radius: var(--r-btn);
    font-size: 13px; line-height: 1.45; margin: 22px 0 0;
    background: color-mix(in srgb, #C0392B 8%, var(--panel));
    border: 1px solid color-mix(in srgb, #C0392B 24%, transparent);
    color: var(--danger);
}
.reg-alert-error svg { flex-shrink: 0; margin-top: 1px; }

/* selected-tier summary shown when ?tier=… is in the URL */
.reg-tier-summary {
    margin: 22px 0 0;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.reg-tier-summary-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.reg-tier-summary-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.reg-tier-summary-change {
    appearance: none; -webkit-appearance: none; border: none; background: transparent;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.reg-tier-summary-change:hover { background: var(--hover); color: var(--ink); }
.reg-tier-summary-name { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.reg-tier-summary-price { display: flex; align-items: baseline; gap: 6px; font-size: 15px; color: var(--ink); }
.reg-tier-summary-price > span:first-child { font-size: 22px; font-weight: 800; }
.reg-tier-summary-cadence { color: var(--muted); font-size: 13px; }
.reg-tier-summary-trial {
    margin-top: 8px; display: inline-block;
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    color: var(--accent);
    padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}

/* sections — grouped fieldsets divided by a hairline so the card reads as one
   surface (not a stack of separate cards) */
.reg-section { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line-soft); }
.reg-section-header { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.reg-section-icon {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: color-mix(in srgb, var(--accent) 10%, var(--panel));
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.reg-section-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.reg-section-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* form fields */
.reg-fields { display: flex; flex-direction: column; gap: 15px; }
.reg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.reg-field { display: flex; flex-direction: column; gap: 7px; }

.reg-label { font-size: 12.5px; font-weight: 600; color: var(--ctl); }
.reg-label-opt { font-size: 11px; color: var(--soft); font-weight: 400; margin-left: 4px; }
.reg-required { color: #C0392B; }

.reg-input {
    width: 100%; height: var(--fieldH);
    padding: 0 15px;
    border: 1px solid var(--line); border-radius: var(--r-btn);
    background: var(--surface); font: inherit; font-size: 15px; color: var(--ink);
    outline: none; transition: border-color .14s, box-shadow .14s, background .14s;
    -webkit-appearance: none;
}
select.reg-input { padding-right: 38px; }
.reg-input::placeholder { color: var(--soft); }
.reg-input:focus {
    border-color: var(--accent); background: var(--panel);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* slug preview row */
.reg-slug-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.reg-slug-preview {
    flex: 1; font-size: 12px; color: var(--muted);
    padding: 7px 10px; background: var(--hover);
    border: 1px solid var(--line); border-radius: 7px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reg-slug-preview code { color: var(--accent); font-family: inherit; font-weight: 600; }
.reg-slug-status { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; flex-shrink: 0; white-space: nowrap; }
.reg-slug-checking { background: var(--hover); color: var(--muted); }
.reg-slug-ok    { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); }
.reg-slug-taken { background: color-mix(in srgb, #C0392B 10%, var(--panel)); color: var(--danger); }

/* hints */
.reg-hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

/* primary submit (mirrors the login .lg-btn) */
.reg-submit-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; height: calc(var(--fieldH) + 2px); margin-top: 26px;
    border: 1px solid var(--accent); border-radius: var(--r-btn);
    background: var(--accent); color: var(--accent-ink);
    font: inherit; font-weight: 700; font-size: 15px; letter-spacing: -.005em;
    cursor: pointer; transition: filter .12s;
}
.reg-submit-btn:hover:not(:disabled) { filter: brightness(.95); }
.reg-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.reg-submit-spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent-ink) 45%, transparent);
    border-top-color: var(--accent-ink);
    animation: reg-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes reg-spin { to { transform: rotate(360deg); } }

.reg-trust-note { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* in-card sign-in / back links */
.reg-footer-links { text-align: center; font-size: 14px; color: var(--muted); margin-top: 24px; }
.reg-footer-links a { color: var(--accent); font-weight: 600; }
.reg-footer-links a:hover { text-decoration: underline; }

/* page legal footer below the card (mirrors the login .lg-formfoot) */
.reg-formfoot {
    display: flex; gap: 18px; align-items: center; justify-content: center;
    color: var(--soft); font-size: 12.5px; padding: 18px 0 6px;
}
.reg-formfoot a { color: var(--muted); }
.reg-formfoot a:hover { color: var(--ink); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .reg-shell { padding: 20px 16px; }
    .reg-card { padding: 28px 20px; }
    .reg-row { grid-template-columns: 1fr; }
    .reg-form-title { font-size: 24px; }
    .reg-steps .reg-step-label { display: none; }
    .reg-step-line { flex-basis: 40px; }
}
