/* ============================================================
   Digital Marketing — base design system (public + auth pages)
   The only hard-coded colours live in the two token blocks below;
   every rule references a token so light and dark both work.
   ============================================================ */

:root {
    /* The same red pen as the portal, and the same default: _Layout
       injects the company brand over it. */
    --brand: #b23a2b;
    --brand-600: color-mix(in srgb, var(--brand), #000 12%);
    --brand-700: color-mix(in srgb, var(--brand), #000 24%);
    --brand-tint: color-mix(in srgb, var(--brand), #fff 88%);
    --on-brand: #ffffff;

    --bg: #fafaf8;
    --surface: #ffffff;
    --surface-2: #f3f1eb;
    --text: #1a1a1a;
    --muted: #5c5a52;
    --line: #e3dfd3;
    --ring: color-mix(in srgb, var(--brand), transparent 70%);

    --ok: #4a7c52;
    --warn: #b8791a;
    --danger: #ef4444;
    --cyan: #3a6098;
    --cyan-700: #2b4c7e;

    /* Matched to the portal so a card does not change shape when you
       sign in. */
    --radius: 12px;
    --radius-sm: 8px;
    /* These pages never load portal.css, so the shadow tint it declares
       has to be declared here too — an undefined var in an rgba() makes
       the whole declaration invalid and the shadow simply vanishes. */
    --nt-shadow-rgb: 69, 68, 63;
    --shadow-sm: 0 1px 2px rgba(var(--nt-shadow-rgb), .06), 0 1px 3px rgba(var(--nt-shadow-rgb), .04);
    --shadow: 0 10px 30px -12px rgba(var(--nt-shadow-rgb), .25);

    --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

[data-theme="dark"] {
    /* Neon, the same room as the portal: near-black with a blue-violet
       cast, and an edge that is rim light rather than a grey hairline. */
    --brand-tint: color-mix(in srgb, var(--brand), #000 62%);
    --bg: #06070e;
    --surface: #0d0f1a;
    --surface-2: #090c17;
    --text: #e6f1ff;
    --muted: #a3b4cc;
    --line: rgba(125, 200, 255, 0.13);
    --danger: #ff5c7a;
    --ok: #3df5a0;
    --warn: #ffc44d;
    --cyan: #5be1ff;
    --cyan-700: #35dcf5;
    --nt-shadow-rgb: 0, 0, 0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 12px 34px -12px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }

/* ── brand lockup ─────────────────────────────────────────── */
.brand, .auth-brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--brand); color: var(--on-brand);
    font-weight: 800; font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; color: var(--text); }

/* ── buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: inherit; font-weight: 600; cursor: pointer;
    padding: .72rem 1.15rem; border-radius: var(--radius-sm);
    border: 1px solid transparent; transition: transform .05s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-brand { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.btn-brand:hover { background: var(--brand-600); color: var(--on-brand); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

/* ── theme toggle (auth + status pages) ───────────────────── */
.theme-toggle {
    position: fixed; top: 1rem; inset-inline-end: 1rem; z-index: 5;
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--line); color: var(--muted);
    cursor: pointer; box-shadow: var(--shadow-sm); transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
.theme-toggle .ico-sun { display: none; }
[data-theme="dark"] .theme-toggle .ico-sun { display: inline; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

/* ============================================================
   Landing
   ============================================================ */
.auth-body { min-height: 100%; }

.landing {
    min-height: 100vh; display: flex; flex-direction: column;
    padding: clamp(1.2rem, 3vw, 2.4rem);
    background:
        radial-gradient(1200px 480px at 100% -8%, var(--brand-tint), transparent 60%),
        radial-gradient(900px 420px at -6% 108%, var(--brand-tint), transparent 55%);
}
.landing-top { display: flex; align-items: center; }
.landing-main {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    max-width: 980px; margin: 0 auto; width: 100%; padding: 2rem 0;
}
.landing-hero { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.eyebrow {
    display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--brand);
    background: var(--brand-tint); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}
.landing-hero h1 {
    margin: 0 0 .8rem; font-size: clamp(1.8rem, 4.4vw, 3rem);
    line-height: 1.08; letter-spacing: -.02em; font-weight: 800;
}
.landing-hero p { margin: 0 auto; max-width: 620px; color: var(--muted); font-size: 1.08rem; }

.door-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.3rem; }
@media (max-width: 720px) { .door-grid { grid-template-columns: 1fr; } }

.door {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.8rem; display: flex; flex-direction: column; gap: .55rem;
    box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
    color: var(--text);
}
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ring); color: var(--text); }
.door-icon {
    width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
    font-size: 1.5rem; color: var(--on-brand); margin-bottom: .4rem;
}
.door-icon--staff { background: linear-gradient(135deg, var(--brand), var(--brand-700)); }
.door-icon--client { background: linear-gradient(135deg, var(--cyan), var(--cyan-700)); }
.door-title { font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.door-desc { color: var(--muted); flex: 1; }
.door-cta { font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: .4rem; }

.landing-foot {
    display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center;
    color: var(--muted); font-size: .875rem; padding-top: 1.6rem;
}
.landing-foot i { margin-inline-end: .3rem; }

/* ============================================================
   Auth card (login pages)
   ============================================================ */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem;
    background:
        radial-gradient(1000px 460px at 100% -10%, var(--brand-tint), transparent 60%),
        radial-gradient(760px 380px at -8% 110%, var(--brand-tint), transparent 55%);
}
.auth-card {
    width: 100%; max-width: 430px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: clamp(1.4rem, 4vw, 2.4rem); box-shadow: var(--shadow);
}
.auth-brand { margin-bottom: 1.5rem; }
.auth-title { margin: 0 0 .3rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 1.4rem; color: var(--muted); }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
    width: 100%;
    font: inherit; padding: .72rem .85rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--ring); background: var(--surface);
}
.field input.input-validation-error { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: .82rem; }
.field-err:empty { display: none; }

/* password with show / hide toggle */
.pass-wrap { position: relative; display: flex; align-items: center; }
.pass-wrap input { padding-inline-end: 2.9rem !important; }
.pass-toggle {
    position: absolute; inset-inline-end: .4rem; width: 34px; height: 34px; border-radius: 8px;
    border: none; background: transparent; color: var(--muted); cursor: pointer;
    display: grid; place-items: center; font-size: 1rem;
}
.pass-toggle:hover { color: var(--brand); background: var(--brand-tint); }
.pass-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.check { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .9rem; cursor: pointer; margin: 0; }
.check input { width: 1rem; height: 1rem; margin: 0; flex: none; accent-color: var(--brand); }

.form-error {
    display: flex; align-items: flex-start; gap: .5rem;
    background: color-mix(in srgb, var(--danger), transparent 90%);
    border: 1px solid color-mix(in srgb, var(--danger), transparent 70%);
    color: var(--danger); border-radius: var(--radius-sm); padding: .7rem .85rem; font-size: .9rem;
}
.form-error:empty,
.form-error.validation-summary-valid,
.form-error:not(:has(li:not([style]))) { display: none; }
.form-error ul { margin: 0; padding-inline-start: 1.1rem; }
.form-error li { list-style: none; }

.auth-alt { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.auth-alt a { font-weight: 600; }

/* ============================================================
   Status / error pages
   ============================================================ */
.status-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem;
    background:
        radial-gradient(1000px 460px at 100% -10%, var(--brand-tint), transparent 60%),
        radial-gradient(760px 380px at -8% 110%, var(--brand-tint), transparent 55%);
}
.status-card {
    text-align: center; width: 100%; max-width: 480px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: clamp(1.6rem, 4vw, 2.4rem); box-shadow: var(--shadow);
}
.status-card .auth-brand { justify-content: center; margin-bottom: 1.4rem; }
.status-code { font-size: 3.4rem; font-weight: 800; color: var(--brand); line-height: 1; margin-bottom: .6rem; }
.status-card h1 { margin: 0 0 .5rem; font-size: 1.5rem; }
.status-card p { color: var(--muted); margin: 0 0 1.4rem; }
.status-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.status-rid { font-size: .82rem; }
/* What the database said. Monospaced, scrollable and never wider than the card — a SQL error
   is one long line and would otherwise stretch the page sideways. */
.status-detail {
    margin: 0 0 1.1rem; padding: .7rem .8rem; max-height: 9rem; overflow: auto;
    text-align: start; white-space: pre-wrap; overflow-wrap: anywhere;
    font-size: .78rem; line-height: 1.5; color: var(--muted, #555);
    background: rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.08); border-radius: 8px;
}
.status-rid code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; }

/* ============================================================
   Sign-in — split layout: brand panel (left) + form (right)
   ============================================================ */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 44%) minmax(0, 1fr); }
.auth-panel {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(155deg, var(--brand-700) 0%, var(--brand) 52%, color-mix(in srgb, var(--brand), #fff 24%) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: clamp(1.6rem, 4vw, 3.4rem);
}
.auth-panel-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-orb { position: absolute; border-radius: 50%; background: #fff; opacity: .28; filter: blur(46px); mix-blend-mode: soft-light; animation: auth-orb 16s ease-in-out infinite; }
.auth-orb-1 { width: 420px; height: 420px; top: -150px; inset-inline-end: -110px; }
.auth-orb-2 { width: 300px; height: 300px; bottom: -90px; inset-inline-start: -90px; animation-delay: -6s; }
.auth-orb-3 { width: 200px; height: 200px; top: 46%; inset-inline-start: 58%; animation-delay: -11s; opacity: .18; }
@keyframes auth-orb { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-22px, 26px) scale(1.08); } }
.auth-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(circle at 28% 32%, #000 0, transparent 68%); mask-image: radial-gradient(circle at 28% 32%, #000 0, transparent 68%);
}
.auth-panel-inner { position: relative; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 2.2rem; animation: auth-rise .6s ease both; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-lockup, .auth-lockup .brand-name { color: #fff; }
.auth-lockup .brand-tagline { color: rgba(255,255,255,.84); }
.auth-lockup .brand-mark { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); box-shadow: 0 10px 30px rgba(0,0,0,.18); backdrop-filter: blur(6px); }
/* the light logo sits on a white plate so a dark-ink logo stays legible on the gradient;
   a dedicated dark-mode logo (light ink) is preferred and needs no plate */
.auth-lockup .brand-logo-wrap { background: #fff; padding: .55rem .8rem; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.auth-lockup .brand-logo-dark { display: block; }
.auth-lockup .brand-logo-wrap:has(.brand-logo-dark) { background: transparent; padding: 0; box-shadow: none; }
.auth-lockup .brand-logo-wrap:has(.brand-logo-dark) .brand-logo-light { display: none; }
.auth-lockup.brand-stacked { align-items: center; }
.auth-lockup.brand-row .brand-text { text-align: start; }

.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.auth-points li { display: flex; align-items: center; gap: .8rem; font-size: .95rem; font-weight: 500; color: rgba(255,255,255,.94); }
.auth-points i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; font-size: 1.05rem; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24); }
.auth-panel-foot { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .82rem; }
.auth-panel-foot a { color: rgba(255,255,255,.82); display: inline-flex; align-items: center; gap: .35rem; }
.auth-panel-foot a:hover { color: #fff; }

.auth-side {
    display: grid; place-items: center; padding: clamp(1.2rem, 4vw, 3rem) 1rem;
    background:
        radial-gradient(900px 420px at 100% -10%, var(--brand-tint), transparent 60%),
        radial-gradient(700px 360px at -8% 110%, var(--brand-tint), transparent 55%);
}
.auth-side .auth-card { max-width: 440px; animation: auth-rise .6s .08s ease both; }
.auth-side .auth-title { font-size: 1.6rem; }

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-panel { padding: 1.4rem 1.2rem; }
    .auth-panel-inner { gap: .5rem; align-items: center; text-align: center; }
    .auth-points, .auth-panel-foot { display: none; }
    .auth-lockup { flex-direction: row !important; gap: .6rem; --lockup-logo: 36px; --lockup-mark: 38px; --lockup-name: 1.15rem; }
    .auth-lockup .brand-tagline { display: none; }
    .auth-lockup .brand-logo-wrap { padding: .35rem .5rem; border-radius: 10px; }
    .auth-side { padding: 1.2rem 1rem 2rem; }
}
@media (prefers-reduced-motion: reduce) { .auth-orb, .auth-panel-inner, .auth-side .auth-card { animation: none; } }
