.reg {
    /* Teal brand shared with the login page (mb-tokens.css); the onboarding wizard reads these same tokens. */
    --reg-primary: #0f766e;
    --reg-primary-hover: #115e59;
    --reg-on-primary: #ffffff;
    --reg-ink: #12302d;
    --reg-muted: #4b635f;
    --reg-rule: #d3e0dd;
    --reg-field-border: #7d9490;
    --reg-tint: #e6f4f1;
    --reg-surface: #ffffff;
    --reg-ground: #f2f8f7;
    --reg-danger: #b42318;
    margin: 0;
    background: var(--reg-ground);
    color: var(--reg-ink);
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.reg *, .reg *::before, .reg *::after { box-sizing: border-box; }
.reg a { color: var(--reg-primary); text-underline-offset: 3px; }

.reg-shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.reg-brand { display: inline-block; }
.reg-brand img { display: block; width: 140px; max-width: 100%; height: auto; }
.reg-story { display: none; }

.reg-form-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.reg-brand--mobile { align-self: flex-start; margin: 4px 0 16px 4px; }

.reg-card {
    width: 100%;
    max-width: 480px;
    padding: 28px 20px 24px;
    background: var(--reg-surface);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.06);
}
.reg-card h1 {
    margin: 0 0 24px;
    font-size: 1.375rem;
    line-height: 1.35;
    font-weight: 600;
    text-align: center;
    text-wrap: balance;
}

.reg-field { margin-bottom: 16px; }
.reg-field label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; }
.reg-req { color: var(--reg-danger); }

.reg-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--reg-field-border);
    border-radius: 8px;
    background: var(--reg-surface);
    color: var(--reg-ink);
    font: inherit;
    font-size: 0.9375rem;
}
.reg-input::placeholder { color: var(--reg-muted); opacity: 0.7; }
.reg-input:focus { outline: 2px solid var(--reg-primary); outline-offset: 1px; border-color: var(--reg-primary); }
.reg-input.is-invalid, .reg-phone.is-invalid { border-color: var(--reg-danger); }

.reg-phone {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--reg-field-border);
    border-radius: 8px;
    background: var(--reg-surface);
    overflow: hidden;
}
.reg-phone:focus-within { outline: 2px solid var(--reg-primary); outline-offset: 1px; border-color: var(--reg-primary); }
.reg-phone-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-right: 1px solid var(--reg-rule);
    background: var(--reg-tint);
    color: var(--reg-muted);
    font-size: 0.9375rem;
}
.reg-input--bare { border: 0; border-radius: 0; }
.reg-input--bare:focus { outline: 0; }

.reg-password { position: relative; }
.reg-password .reg-input { padding-right: 52px; }
.reg-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--reg-muted);
    cursor: pointer;
}
.reg-toggle:hover { color: var(--reg-ink); }
.reg-toggle:focus-visible { outline: 2px solid var(--reg-primary); }
.reg-toggle svg { width: 20px; height: 20px; }
.reg-toggle .reg-eye-off, .reg-toggle[aria-pressed="true"] .reg-eye { display: none; }
.reg-toggle[aria-pressed="true"] .reg-eye-off { display: block; }

.reg-hint, .reg-error { margin: 6px 0 0; font-size: 0.8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.reg-hint { color: var(--reg-muted); }
.reg-error { color: var(--reg-danger); }

.reg-terms { margin: 4px 0 20px; font-size: 0.8125rem; line-height: 1.6; color: var(--reg-muted); }

.reg-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    background: var(--reg-primary);
    color: var(--reg-on-primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease;
}
.reg-submit:hover { background: var(--reg-primary-hover); }
.reg-submit:focus-visible { outline: 2px solid var(--reg-primary); outline-offset: 2px; }
.reg-submit:disabled { cursor: progress; background: var(--reg-primary-hover); }
/* A primary action that leaves the site (e.g. the WhatsApp deep link) is an anchor; `.reg a` would recolour its label. */
.reg a.reg-submit { color: var(--reg-on-primary); text-decoration: none; }

/* WhatsApp deep-link QR: only for desktop visitors; on a phone the button already opens WhatsApp. */
.reg-qr { display: none; }
@media (min-width: 992px) {
    .reg-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 20px 0 0; }
    .reg-qr img { width: 240px; height: 240px; border: 1px solid var(--reg-rule); border-radius: 8px; }
    .reg-qr figcaption { max-width: 320px; text-align: center; font-size: 0.875rem; line-height: 1.5; color: var(--reg-muted); }
}
.reg-submit-progress { display: none; align-items: center; gap: 10px; }
.reg-submit.is-loading .reg-submit-label { display: none; }
.reg-submit.is-loading .reg-submit-progress { display: inline-flex; }
.reg-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: reg-spin 700ms linear infinite;
}
@keyframes reg-spin { to { transform: rotate(360deg); } }

.reg-switch { margin: 20px 0 0; text-align: center; font-size: 0.9375rem; }
.reg-switch a { font-weight: 600; }

/* Login-only pieces: a lead line under the heading, status/error banners and the remember-me row. */
.reg-card .reg-h1--lead { margin-bottom: 8px; }
.reg-lead { margin: 0 0 24px; text-align: center; font-size: 0.9375rem; line-height: 1.5; color: var(--reg-muted); }
.reg-alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid; border-radius: 8px; font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere; }
.reg-alert--success { border-color: #b9ddd8; background: var(--reg-tint); color: var(--reg-ink); }
.reg-alert--error { border-color: #f4c3be; background: #fef3f2; color: var(--reg-danger); }
.reg-check { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; }
.reg-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--reg-primary); }
.reg-check label { flex: 1; padding-block: 12px; font-size: 0.9375rem; cursor: pointer; }

/* Account-recovery pages: a neutral secondary action and a borderless text action below the primary submit. */
.reg-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    margin-top: 12px;
    border: 1px solid var(--reg-rule);
    border-radius: 8px;
    background: #f3f5f7;
    color: var(--reg-ink);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 160ms ease;
}
.reg-secondary:hover { background: #e8ecef; color: var(--reg-ink); }
.reg-secondary:focus-visible { outline: 2px solid var(--reg-primary); outline-offset: 2px; }
.reg-textbtn-row { margin: 12px 0 0; text-align: center; }
.reg-textbtn {
    padding: 10px 14px;
    border: 0;
    background: none;
    color: var(--reg-muted);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}
.reg-textbtn:hover { color: var(--reg-ink); text-decoration: underline; }
.reg-textbtn:focus-visible { outline: 2px solid var(--reg-primary); outline-offset: 2px; }

.reg-footer { margin-top: 20px; font-size: 0.75rem; color: var(--reg-muted); text-align: center; }
.reg-footer p { margin: 0; }
.reg-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 16px; }
.reg-footer-nav a { padding-block: 6px; color: var(--reg-muted); }

/* Honeypot: off-screen rather than display:none, which bots skip. */
.reg-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 992px) {
    .reg { background: var(--reg-surface); }
    .reg-shell { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

    .reg-story {
        position: relative;
        isolation: isolate;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 40px clamp(32px, 5vw, 80px);
        background-color: var(--reg-tint);
        background-image: linear-gradient(160deg, var(--reg-tint) 0%, var(--reg-surface) 75%);
    }
    .reg-story .reg-brand img { width: 176px; }

    /* Decorative only: sits under the slide (z-index -1 inside the isolated story) and never carries content. */
    .reg-blob {
        position: absolute;
        z-index: -1;
        background: rgb(15 118 110 / 0.07);
        pointer-events: none;
        animation: reg-drift 22s ease-in-out infinite alternate;
    }
    .reg-blob--a { top: -90px; right: -70px; width: 340px; height: 320px; border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; }
    .reg-blob--b { bottom: -120px; left: -90px; width: 420px; height: 380px; background: rgb(15 118 110 / 0.09); border-radius: 41% 59% 36% 64% / 58% 37% 63% 42%; animation-duration: 28s; animation-delay: -6s; }
    .reg-blob--c { top: 34%; left: -36px; width: 120px; height: 110px; background: rgb(94 189 180 / 0.2); border-radius: 52% 48% 61% 39% / 44% 56% 44% 56%; animation-duration: 18s; animation-delay: -3s; }
    .reg-blob--d { bottom: 12%; right: 6%; width: 150px; height: 140px; background: rgb(242 140 40 / 0.14); border-radius: 38% 62% 47% 53% / 61% 42% 58% 39%; animation-duration: 24s; animation-delay: -11s; }
    .reg-blob--e { top: 20%; right: 18%; width: 64px; height: 58px; background: rgb(15 118 110 / 0.12); border-radius: 57% 43% 49% 51% / 46% 60% 40% 54%; animation-duration: 16s; animation-delay: -8s; }

    /* Slides share one grid cell so they can cross-fade; the cell also takes the tallest caption, which keeps the dots from jumping between slides. */
    .reg-carousel { position: relative; display: grid; flex: 1; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; justify-items: center; row-gap: 24px; }
    /* A fixed scene has no dots; this spacer holds their row so the art sits exactly where it does on the rotating panel. */
    .reg-carousel--single::after { content: ""; grid-area: 2 / 1; height: 10px; }
    .reg-slide { grid-area: 1 / 1; visibility: hidden; width: 100%; margin: 0; max-width: 600px; text-align: center; transition: visibility 0s linear 300ms; }
    .reg-slide.is-active { visibility: visible; transition-delay: 0s; }
    /* Fade the image and caption, not the figure: opacity on the figure would isolate the image and break its multiply blend.
       The outgoing slide fades first and the incoming one waits for it, so the two captions never overlap as unreadable text. */
    .reg-slide img, .reg-slide figcaption { opacity: 0; transition: opacity 300ms ease; }
    .reg-slide.is-active img, .reg-slide.is-active figcaption { opacity: 1; transition: opacity 500ms ease 300ms; }
    .reg-slide img {
        display: block;
        width: 100%;
        height: auto;
        max-height: min(52dvh, 420px);
        margin: 0 auto 24px;
        object-fit: contain;
        /* Artwork ships on a pure white backdrop; multiply lets the dotted tint show through it. */
        mix-blend-mode: multiply;
    }
    .reg-slide strong { display: block; margin-bottom: 8px; font-size: 1.125rem; font-weight: 600; }
    .reg-slide span { display: block; color: var(--reg-muted); line-height: 1.6; }

    .reg-dots { grid-area: 2 / 1; display: flex; gap: 8px; }
    .reg-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--reg-rule); cursor: pointer; }
    .reg-dot.is-active { width: 24px; border-radius: 6px; background: var(--reg-primary); }
    .reg-dot:focus-visible { outline: 2px solid var(--reg-primary); outline-offset: 3px; }

    .reg-form-side { justify-content: center; padding: 40px clamp(24px, 3vw, 64px); }
    .reg-brand--mobile { display: none; }
    .reg-card { padding: 0; background: transparent; box-shadow: none; }
}

/* Keeps the form column inside a desktop viewport without a page scroll; inputs stay 44px for touch landscape tablets.
   The register form is the tallest page and needs ~830px at full spacing, so the compact tier starts there, not at 800px. */
@media (min-width: 992px) and (max-height: 839.98px) {
    .reg-form-side { padding-block: 16px; }
    .reg-card h1 { margin-bottom: 16px; }
    .reg-field { margin-bottom: 12px; }
    .reg-input, .reg-submit, .reg-secondary { min-height: 44px; }
    .reg-terms { margin: 4px 0 14px; }
    .reg-lead { margin-bottom: 16px; }
    .reg-check { margin-bottom: 14px; }
    .reg-switch { margin-top: 14px; }
    .reg-footer { margin-top: 8px; }
    .reg-footer-nav a { padding-block: 4px; }
}

/* A 768px-tall laptop leaves ~620-660px under the browser toolbar; 40px inputs are the floor that still reads as a normal field. */
@media (min-width: 992px) and (max-height: 699.98px) {
    .reg-form-side { padding-block: 8px; }
    .reg-card h1 { margin-bottom: 10px; font-size: 1.25rem; }
    .reg-field { margin-bottom: 8px; }
    .reg-field label { margin-bottom: 4px; }
    .reg-input, .reg-submit, .reg-secondary { min-height: 40px; }
    .reg-input { padding-block: 6px; }
    .reg-hint { margin-top: 4px; line-height: 1.4; }
    .reg-terms { margin: 2px 0 10px; line-height: 1.45; }
    .reg-switch { margin-top: 10px; }
    .reg-footer-nav a { padding-block: 2px; }
}

@keyframes reg-drift {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(14px, -18px) rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
    .reg-blob { animation: none; }
    .reg-slide, .reg-slide img, .reg-slide figcaption { transition: none; }
    .reg-spinner { animation-duration: 1.6s; }
    .reg-submit, .reg-secondary { transition: none; }
}
