/* XSITE Website — landing + back office shell.
   Dark, elegant, minimal. Section theme colours are defined per-card below so a
   real photo can later be layered over the gradient (colour stays as fallback). */

:root {
    --bg: #0d0f12;
    --bg-elev: #16191f;
    --ink: #f2f2f0;
    --ink-dim: #a7adb6;
    --line: #262b33;
    --focus: #e0a92e;
}

* { box-sizing: border-box; }

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    letter-spacing: 0.01em;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 2rem;
    border-bottom: 1px solid var(--line);
}

.wordmark {
    font-weight: 700;
    letter-spacing: 0.28em;
    font-size: 0.95rem;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.lang-option {
    background: none;
    border: none;
    color: var(--ink-dim);
    font: inherit;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    line-height: 0;
}

.lang-flag {
    display: block;
    width: 22px;
    height: auto;
    border-radius: 2px;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.lang-option.is-active .lang-flag { opacity: 1; }
.lang-option:hover .lang-flag { opacity: 0.8; }
.lang-sep { color: var(--line); }

/* ---------- Main / intro ---------- */
.site-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 3.5rem 2rem 2rem;
}

.intro { text-align: center; margin-bottom: 3rem; }

.intro-headline {
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 300;
    margin: 0 0 0.75rem;
}

.intro-lead {
    color: var(--ink-dim);
    font-size: 1.05rem;
    margin: 0;
}

/* ---------- Section cards ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover { transform: translateY(-4px); border-color: var(--card-accent, var(--focus)); }

.card-panel {
    /* Solid gradient now; drop a photo in later via background-image with this as fallback. */
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-grad);
    background-size: cover;
    background-position: center;
}

.card-icon { font-size: 2.6rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }

/* Opaque logo on a panel painted the same cream as its own background
   (#fef7ef, sampled from qpie.pdf) — the inherited .card-icon drop-shadow
   must be cancelled or it outlines the image rectangle and breaks the blend. */
.card-icon--image {
    height: 120px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: none;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.4rem 1.4rem 1.6rem;
}

.card-name { font-size: 1.25rem; font-weight: 600; }
.card-desc { color: var(--ink-dim); font-size: 0.92rem; flex: 1; }

.card-enter {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--card-accent, var(--focus));
    font-weight: 600;
}

/* Per-section theme colours */
.card--xsitejobs { --card-grad: linear-gradient(135deg, #0a5567, #0c6478); --card-accent: #e0a92e; }
.card--melissa   { --card-grad: linear-gradient(135deg, #c69a2e, #e8b849); --card-accent: #e6b84a; }
/* Panel matches the Quick Pie logo's own cream background exactly so the
   opaque PNG blends in without a visible box (color sampled from qpie.pdf). */
.card--snackshop { --card-grad: #fef7ef; --card-accent: #e8794e; }

/* ---------- Footer ---------- */
.site-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 2rem;
    border-top: 1px solid var(--line);
    color: var(--ink-dim);
    font-size: 0.82rem;
}

.copyright { margin: 0; }

.admin-entry {
    display: inline-flex;
    align-items: center;
    color: var(--ink-dim);
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.admin-entry:hover { opacity: 1; color: var(--focus); }

/* ---------- Back office ---------- */
.auth-card {
    max-width: 380px;
    margin: 2rem auto;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 2rem;
}

.auth-title { margin: 0 0 1.4rem; font-weight: 400; font-size: 1.5rem; }

.auth-form { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-form label { font-size: 0.8rem; color: var(--ink-dim); margin-top: 0.7rem; }

.auth-form input[type=text],
.auth-form input[type=password] {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    padding: 0.6rem 0.7rem;
    font: inherit;
}

.auth-form input:focus { outline: none; border-color: var(--focus); }

/* ---------- Back-office buttons: one elevated style ----------
   Every pressable control in /manage/ shares this recipe: a pill face with a
   glossy highlight across the top, a hard coloured edge underneath giving it
   thickness, a soft glow floating it off the page, and a press *into* the page
   on click. Variants differ only in the four --btn-* colours, so a new button
   type is four values, not a new set of rules.

   These class names exist only on back-office screens (the public sections use
   their own prefixed classes — qp-btn-primary, honey's .btn, jobs' .btn-jobs),
   so styling them from this shared stylesheet cannot bleed into a public page.
   manage-honey.css re-points the same variables for its light theme.

   The flat versions of these rules were deleted, not overridden — stale rules
   combine with their replacements rather than losing to them (see CLAUDE.md,
   the mobile buy-row bug). */
.btn-primary,
.btn-secondary,
.btn-danger,
.mh-btn,
.mh-btn-go,
.mh-btn-undo,
.mh-chip,
.mh-toggle-btn,
.mh-order-btns button {
    --btn-face: var(--focus);
    --btn-edge: #a97d13;
    --btn-ink: #1a1400;
    --btn-glow: rgba(0, 0, 0, 0.28);

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--btn-face);
    color: var(--btn-ink);
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    outline: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: 0 2px 0 var(--btn-edge), 0 4px 10px var(--btn-glow);
    transition: transform .18s, box-shadow .18s, filter .18s;
}

/* The gloss. Inset from the edges and separately rounded so it reads as light
   falling on a curved face rather than as a second rectangle. */
.btn-primary::before,
.btn-secondary::before,
.btn-danger::before,
.mh-btn::before,
.mh-btn-go::before,
.mh-btn-undo::before,
.mh-chip::before,
.mh-toggle-btn::before,
.mh-order-btns button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 4%;
    width: 92%;
    height: 50%;
    border-radius: 125px;
    background-image: linear-gradient(#fff 0, rgba(255, 255, 255, 0) 100%);
    opacity: .32;
    pointer-events: none;
    transition: opacity .18s;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.mh-btn:hover,
.mh-btn-go:hover,
.mh-btn-undo:hover,
.mh-chip:hover,
.mh-chip-mini:hover,
.mh-toggle-btn:hover,
.mh-order-btns button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 0 var(--btn-edge), 0 8px 18px var(--btn-glow);
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.mh-btn:active,
.mh-btn-go:active,
.mh-btn-undo:active,
.mh-chip:active,
.mh-chip-mini:active,
.mh-toggle-btn:active,
.mh-order-btns button:active {
    transform: translateY(2px) scale(1);
    box-shadow: 0 0 0 var(--btn-edge), 0 2px 5px var(--btn-glow);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.mh-btn:focus-visible,
.mh-btn-go:focus-visible,
.mh-btn-undo:focus-visible,
.mh-chip:focus-visible,
.mh-chip-mini:focus-visible,
.mh-toggle-btn:focus-visible,
.mh-order-btns button:focus-visible {
    outline: 2px solid var(--btn-face);
    outline-offset: 3px;
}

/* A disabled button is not pressable, so it must not look raised either. */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.mh-btn:disabled,
.mh-btn-go:disabled,
.mh-btn-undo:disabled,
.mh-toggle-btn:disabled,
.mh-order-btns button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: none;
}

.btn-primary:disabled::before,
.mh-btn:disabled::before,
.mh-order-btns button:disabled::before { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .btn-primary, .btn-secondary, .btn-danger, .mh-btn, .mh-btn-go,
    .mh-btn-undo, .mh-chip, .mh-toggle-btn,
    .mh-order-btns button { transition: none; }
}

.btn-primary {
    margin-top: 1.3rem;
    padding: 0.7rem 1.4rem;
}

.auth-error { color: #e8794e; font-size: 0.85rem; }
.auth-back { margin-top: 1.2rem; font-size: 0.82rem; }
.auth-back a { color: var(--ink-dim); }

.manage-nav { display: inline-flex; align-items: center; gap: 1rem; font-size: 0.85rem; }
.manage-user { color: var(--ink-dim); }
.link-button { background: none; border: none; color: var(--ink); font: inherit; cursor: pointer; padding: 0; }
.logout-form { display: inline; margin: 0; }
.manage-placeholder { color: var(--ink-dim); max-width: 46ch; }
.messages { list-style: none; padding: 0; }
.messages .success { color: #6bd08b; }

/* ---------- Dashboard boxes ---------- */
.manage-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.manage-box {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.manage-box h2 { margin: 0 0 0.2rem; font-size: 1rem; font-weight: 600; }
.manage-box a { color: var(--ink-dim); font-size: 0.9rem; }
.manage-box a:hover { color: var(--focus); }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
    .cards { grid-template-columns: 1fr; }
    .site-header, .site-footer { padding: 1.1rem 1.3rem; }
    .site-main { padding: 2.5rem 1.3rem 1.5rem; }
}

/* Back-office header on a phone. The account email plus the two links do not fit
   on one line, and because nothing was allowed to wrap they pushed the document
   ~190px wider than the viewport — every /manage/ page scrolled sideways, on a
   device Costas actually works from. Scoped to body.manage so the public sections,
   which have their own header treatments, are untouched. */
@media (max-width: 720px) {
    body.manage .site-header {
        flex-wrap: wrap;
        gap: 0.5rem 0.9rem;
        padding: 0.9rem 1.1rem;
    }
    body.manage .manage-nav {
        flex-wrap: wrap;
        gap: 0.25rem 0.9rem;
        font-size: 0.78rem;
        min-width: 0;
    }
    /* The address is the least useful thing here and the longest — let it be the
       part that truncates, rather than pushing the links off screen. */
    body.manage .manage-user {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    body.manage .wordmark { font-size: 0.82rem; letter-spacing: 0.2em; }
}
