/*
 * Site themes — app page family "register" (views/vendor/register.php, through includes/header.php).
 * Loaded by themes/_base/app.php only on a themed request; never on the legacy page.
 * The page keeps its layout and every register-page-builder setting. Its own palette (--zr-*, set on
 * .zreg) is re-pointed at the template tokens; the no-image header becomes the template's hero band.
 * A market's own choices still win where they were made for a specific backdrop:
 *   - header with a background image: the image, overlay and the market's text colour stay;
 *   - "Button background" set in the builder (data-zr-own-button, printed only when themed): kept.
 * Status colours (error / referral boxes, password meter, stars, benefit icon tiles) are left alone:
 * light tiles with coloured marks read in both modes.
 * Token-only: no [data-zin-mode] / prefers-color-scheme selectors.
 */
body.zt-app-register .zreg {
    --zr-brand: var(--z-accent-text);      /* links, icons, focus — always the contrast-safe accent */
    --zr-brand-alt: var(--z-accent-2);
    --zr-ink: var(--z-text);
    --zr-body: color-mix(in srgb, var(--z-text) 45%, var(--z-muted));
    --zr-muted: var(--z-muted);
    --zr-line: var(--z-border);
    --zr-line-soft: var(--z-surface-2);
    --zr-page: var(--z-bg);
    --zr-card: var(--z-surface);
    --zr-shadow: var(--z-shadow);
    --zr-shadow-lg: var(--z-shadow-lg);
    /* Required marks and field errors: the page's red, pulled toward the text colour so it stays
       readable on a dark card too. */
    --zr-danger: color-mix(in srgb, #dc2626 72%, var(--z-text));
    font-family: var(--z-font-body);
}
/* The submit button: the template's action colour and its ink — unless the market picked its own
   button colour in the builder (then the view's --zr-btn-bg / --zr-btn-ink on .zreg stand). */
body.zt-app-register .zreg:not([data-zr-own-button]) {
    --zr-btn-bg: var(--z-accent);
    --zr-btn-ink: var(--z-accent-ink);
}

/* ---- Header: the template's hero band when there is no background image ------------------ */
body.zt-app-register .zreg-hero:not(:has(> .zreg-hero-media)) {
    background: linear-gradient(135deg, var(--z-hero-from) 0%, var(--z-hero-to) 100%);
    color: var(--z-hero-ink);
}
body.zt-app-register .zreg-hero:not(:has(> .zreg-hero-media)) :is(.zreg-badge, .zreg-logo-fallback) {
    background: color-mix(in srgb, var(--z-hero-ink) 14%, transparent);
    border-color: color-mix(in srgb, var(--z-hero-ink) 26%, transparent);
}
body.zt-app-register .zreg-hero h1 { font-family: var(--z-font-display); }

/* ---- Card, fields -------------------------------------------------------------------------- */
body.zt-app-register .zreg-social-btn:hover,
body.zt-app-register .zreg-benefit:hover { border-color: color-mix(in srgb, var(--z-muted) 45%, var(--z-border)); }
body.zt-app-register .zreg-benefit { background: var(--z-surface); }
body.zt-app-register .zreg-seg-btn[aria-pressed="true"] { box-shadow: var(--z-shadow); }
/* The bridge paints every input's border; the page's own good / bad states must still show. */
body.zt-app.zt-app-register .zreg .zreg-input.is-bad { border-color: var(--zr-danger) !important; }
body.zt-app.zt-app-register .zreg .zreg-input.is-good { border-color: var(--zr-ok) !important; }
body.zt-app.zt-app-register .zreg .zreg-input:focus { border-color: var(--z-accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--z-accent) 20%, transparent); }

/* ---- Content blocks: brand tints were mixed with white ------------------------------------ */
body.zt-app-register .zreg-step-dot,
body.zt-app-register .zreg-who-initial { background: var(--z-accent-soft); color: var(--z-accent-text); }
body.zt-app-register .zreg-quote-mark { color: color-mix(in srgb, var(--z-accent-text) 45%, var(--z-surface)); }
body.zt-app-register .zreg-submit:focus-visible { outline-color: var(--z-text); }
