/* Layout: showroom split — a bottle-green panel with a cabinet elevation drawing beside a quiet worktop-stone form; stacks to a banner on phones */
:root {
    --stone: #eef0ec;        /* page: pale quartz worktop */
    --surface: #fbfcfa;      /* cards, inputs */
    --ink: #13241d;
    --muted: #5b6a62;
    --line: #d5dbd5;
    --green: #173a2e;        /* showroom panel, primary buttons */
    --green-ink: #f1f4ef;    /* text on green */
    --brass: #9c7426;        /* accent on light surfaces */
    --brass-bright: #c9a253; /* accent on green */
    --ok: #1f7a4d;
    --ok-bg: #e2f1e8;
    --warn: #8a5a00;
    --warn-bg: #fbf0d9;
    --err: #a3312a;
    --err-bg: #f9e5e2;
    --focus: rgba(156, 116, 38, 0.35);

    --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --radius: 14px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --stone: #0d1612;
        --surface: #142019;
        --ink: #e5ebe6;
        --muted: #92a299;
        --line: #26362e;
        --brass: #d0ab5e;
        --ok: #5fd39a;
        --ok-bg: rgba(95, 211, 154, 0.12);
        --warn: #f0c46a;
        --warn-bg: rgba(240, 196, 106, 0.12);
        --err: #f08a80;
        --err-bg: rgba(240, 138, 128, 0.12);
        --focus: rgba(208, 171, 94, 0.4);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    background: var(--stone);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-left: max(0px, env(safe-area-inset-left, 0px));
    padding-right: max(0px, env(safe-area-inset-right, 0px));
}

h1, h2 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brass);
}

p.lead { color: var(--muted); margin: 0; max-width: 38ch; }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Brand ---------- */

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; display: block; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 0.8rem; color: var(--muted); }

/* ---------- Sign-in: showroom split ---------- */

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

.showroom {
    background: var(--green);
    color: var(--green-ink);
    padding: 48px clamp(28px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    overflow: hidden;
}
.showroom .brand-sub { color: rgba(241, 244, 239, 0.7); }

.showroom-copy { display: grid; gap: 10px; max-width: 30ch; }
.showroom-copy .eyebrow { color: var(--brass-bright); }
.showroom-copy h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); color: var(--green-ink); }

.elevation { width: 100%; max-width: 520px; height: auto; display: block; }
.elevation .ln { fill: none; stroke: var(--brass-bright); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.elevation .fill { fill: rgba(201, 162, 83, 0.08); }
.elevation .handle { fill: var(--brass-bright); }
.elevation .dim { stroke: rgba(241, 244, 239, 0.45); stroke-width: 1; vector-effect: non-scaling-stroke; }
.elevation text { fill: rgba(241, 244, 239, 0.6); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; }

.signin {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 110px;
}

.signin-box { width: 100%; max-width: 380px; display: grid; gap: 28px; }
.signin-head { display: grid; gap: 8px; }

/* ---------- Forms ---------- */

form.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }

label { font-size: 0.82rem; font-weight: 600; color: var(--ink); }

input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 16px; /* stops iOS zooming into inputs */
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 110px; resize: vertical; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--focus); }

.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 0.9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: var(--green-ink);
    background: var(--green);
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); background: #1e4a3b; }
.btn.block { width: 100%; padding: 14px; font-size: 1rem; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--brass); background: transparent; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    border-left: 3px solid;
}
.alert.error { color: var(--err); background: var(--err-bg); }
.alert.success { color: var(--ok); background: var(--ok-bg); }
.alert.warning { color: var(--warn); background: var(--warn-bg); }

.footnote { color: var(--muted); font-size: 0.82rem; display: flex; align-items: center; gap: 8px; }
.footnote svg { flex: none; }

/* ---------- Signed-in pages ---------- */

.page {
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 20px 120px;
    display: grid;
    gap: 28px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Access pass: the one set-off object on the page */
.pass {
    background: var(--green);
    color: var(--green-ink);
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 32px);
    display: grid;
    gap: 22px;
}
.pass h1 { color: var(--green-ink); }
.pass .eyebrow { color: var(--brass-bright); }

.chip {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(95, 211, 154, 0.16);
    color: #8be3b5;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(139, 227, 181, 0.25); }
.chip.expired { background: rgba(240, 138, 128, 0.16); color: #f4a69e; }

.pass-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid rgba(241, 244, 239, 0.14);
}
.pass-meta div { display: grid; gap: 4px; min-width: 0; }
.pass-meta dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(241, 244, 239, 0.6); }
.pass-meta dd { margin: 0; font-family: var(--font-mono); font-size: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.meter { height: 6px; border-radius: 999px; background: rgba(241, 244, 239, 0.14); overflow: hidden; }
.meter span { display: block; height: 100%; width: 100%; background: var(--brass-bright); border-radius: inherit; transition: width 0.6s ease; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-head .count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

.systems {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}
.systems a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 15px 6px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background 0.15s, padding 0.15s;
}
.systems a:hover { background: var(--surface); padding-left: 12px; }
.systems .tag {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--brass);
    border: 1px solid var(--line);
    background: var(--surface);
}
.systems .host { font-size: 1rem; overflow-wrap: anywhere; }
.systems .host b { font-weight: 600; }
.systems .host span { color: var(--muted); }
.systems .go { color: var(--muted); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.systems a:hover .go { color: var(--brass); }

/* ---------- Admin ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 32px);
}
.card .section { display: grid; gap: 4px; padding-block: 22px; border-top: 1px solid var(--line); }
.card .section:first-child { border-top: 0; padding-top: 0; }
.card .section h2 { margin-bottom: 6px; }
.card .section label { margin-top: 10px; }
.hint { color: var(--muted); font-size: 0.82rem; }
.hint code { font-family: var(--font-mono); color: var(--brass); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row > div { display: grid; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.admin-intro { display: grid; gap: 6px; }

/* ---------- Powered by badge ---------- */

.powered-by-float {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
    z-index: 1000;
    animation: floatIn 0.6s ease-out 0.5s both;
}
@keyframes floatIn {
    from { opacity: 0; transform: translateY(20px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.powered-by-float a {
    display: block;
    background: white;
    padding: 10px 14px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.powered-by-float a:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05); }
.powered-by-float img { height: 24px; width: auto; display: block; }

/* ---------- Motion ---------- */

.rise { animation: rise 0.5s ease-out both; }
.rise.d2 { animation-delay: 0.08s; }
@keyframes rise { from { transform: translateY(8px); opacity: 0.4; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
    .split { grid-template-columns: 1fr; min-height: 0; }
    .showroom { padding: 24px 20px 0; gap: 20px; }
    .showroom-copy h1 { font-size: 1.6rem; }
    .elevation { max-width: 360px; margin-bottom: -6px; }
    .signin { padding: 32px 20px 110px; align-items: flex-start; }
}

@media (max-width: 600px) {
    .pass-meta { grid-template-columns: 1fr 1fr; }
    .pass-meta .wide { grid-column: 1 / -1; }
    .row { grid-template-columns: 1fr; }
    .systems .go span { display: none; }
    .powered-by-float { right: calc(15px + env(safe-area-inset-right, 0px)); bottom: calc(15px + env(safe-area-inset-bottom, 0px)); }
    .powered-by-float a { padding: 8px 12px; }
    .powered-by-float img { height: 20px; }
}
