/* ═══════════════════════════════════════════════════════════
   AlarmCard — Booking & Admin stylesheet
   Design tokens mirror the marketing site (alarmcard.no).
   Palette derived from the AlarmCard logo. Plain CSS, no build.
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   DESIGN TOKENS — Logo-derived palette
───────────────────────────────────────────── */
:root {
    /* Brand scale */
    --brand-red:        #D92020;
    --brand-navy:       #16356D;
    --brand-navy-deep:  #0D1F42;
    --brand-blue:       #2558A8;
    --brand-sky:        #6A9CC8;
    --brand-ice:        #BCCDE0;
    --brand-ice-pale:   #E4EEF8;
    --brand-green:      #157A3E;

    /* Backgrounds */
    --bg:               #FFFFFF;
    --bg-subtle:        #F3F7FC;
    --bg-raised:        #E8EFF8;
    --bg-muted:         #EEF3FA;

    /* Borders — blue-grey family */
    --border:           #C8D9EC;
    --border-subtle:    #DAE6F3;
    --border-strong:    #A8C0D8;

    /* Text */
    --text-primary:     #0D1F42;
    --text-secondary:   #2D4A70;
    --text-tertiary:    #5878A0;
    --text-muted:       #8AA5C4;

    /* Accessible accents (AA on white) */
    --link-blue:        #1E4E96;
    --red-aa:           #B81818;
    --green-aa:         #157A3E;

    /* Lead status pills (bg / fg / dot). Blue and red stay in the brand
       family (navy/red above); green from the approved dashboard design;
       no-show is a deliberately clear yellow. */
    --status-booked-bg:   var(--brand-ice-pale);
    --status-booked-fg:   var(--brand-navy);
    --status-booked-dot:  var(--brand-navy);
    --status-done-bg:     #E5F4EA;
    --status-done-fg:     #256A41;
    --status-done-dot:    #2F9153;
    --status-cancel-bg:   #FBE9E7;
    --status-cancel-fg:   var(--red-aa);
    --status-cancel-dot:  var(--brand-red);
    --status-noshow-bg:   #FDF3C4;
    --status-noshow-fg:   #6E5A00;
    --status-noshow-dot:  #E8C400;

    /* Typography */
    --font-display:     'DM Sans', sans-serif;
    --font-mono:        'DM Mono', monospace;

    /* Layout */
    --header-h:         64px;
    --radius-lg:        12px;
    --radius-md:        8px;

    /* Spacing scale (4px base) */
    --space-2:   8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
}

/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: var(--font-display);
    background: var(--bg-subtle);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link-blue); }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.ac-header {
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 60px;
    border-bottom: 1px solid var(--border);
}
.ac-header-logo { display: flex; align-items: center; }
.ac-header-logo img { height: 60px; width: auto; display: block; }
.ac-header-extra { display: flex; align-items: center; gap: var(--space-3); }
@media (max-width: 900px) {
    .ac-header { padding: 14px 24px; }
}

/* CTA pill link — booking pages only, shares the .ac-header shell above */
.ac-header-cta {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand-red); color: #fff; border: none; text-decoration: none;
    padding: 10px 24px; border-radius: 20px;
    font-family: var(--font-display); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.ac-header-cta svg { transition: transform .2s; }
.ac-header-cta:hover {
    background: var(--red-aa); transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(217, 32, 32, .3);
}
.ac-header-cta:hover svg { transform: translateX(4px); }

/* Scroll-progress bar (booking pages). Class selector, not an ID selector:
   Leaf treats a literal "#" as its own tag-syntax delimiter anywhere in a
   template's raw source, even inside <style>/<script> blocks — an
   "#progress{...}" ID selector silently truncated the whole template
   server-side. The HTML id="progress" is unaffected (Leaf doesn't scan
   attribute values); only the CSS selector needed to be a class. */
.progress-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 100%;
    background: var(--brand-blue); z-index: 1000;
}
.progress-bar::before {
    content: ''; position: absolute; top: 0; left: 0; height: 100%;
    width: var(--p, 0%); background: var(--brand-red);
    transition: width .1s linear;
}

/* Banner strip directly under the header — booking pages only */
.ac-banner {
    width: 100%; background: rgba(217, 32, 32, .93);
    min-height: 48px; padding: 0 40px; font-family: var(--font-mono);
    font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
    color: #fff; text-align: center; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
}

/* ─────────────────────────────────────────────
   LAYOUT WRAPPERS
───────────────────────────────────────────── */
.ac-main { max-width: 640px; margin: var(--space-8) auto; padding: 0 var(--space-4); }
.ac-main--narrow { max-width: 440px; }
.ac-main--wide { max-width: 1100px; }

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.ac-footer {
    text-align: center;
    background: #1B3A6B;
    color: rgba(188, 205, 224, .5);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .5px;
    padding: 16px var(--space-4);
    margin-top: var(--space-8);
}
.ac-footer a { color: inherit; opacity: .7; }
.ac-footer a:hover { opacity: 1; }

/* Rich footer variant (booking pages) — same .ac-footer background/
   color/font as the plain admin footer above, just with the fuller
   marketing-style content (logo, tagline, contact, copyright bar)
   layered on top instead of a single line of text. */
.ac-footer.ac-footer--rich { text-align: left; padding: 0; margin-top: 0; }
.ac-footer-inner {
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
    padding: 64px 60px 48px; max-width: 1200px; margin: 0 auto; align-items: start;
}
.ac-footer-brand { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.ac-footer-logo { height: 44px; width: auto; display: block; }
.ac-footer-tagline { font-size: 14px; color: rgba(188, 205, 224, .8); line-height: 1.7; text-align: center; }
.ac-footer-right { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.ac-footer-email {
    font-family: var(--font-display); font-size: 22px; font-weight: 700;
    color: #fff; text-decoration: none; transition: color .2s;
}
.ac-footer-email:hover { color: var(--brand-ice); }
.ac-footer-web { font-size: 13px; color: rgba(188, 205, 224, .7); text-decoration: none; transition: color .2s; }
.ac-footer-web:hover { color: #fff; }
.ac-footer-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 60px; border-top: 1px solid rgba(188, 205, 224, .15);
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: .5px; color: rgba(188, 205, 224, .5);
}
.ac-footer-bar a { color: inherit; opacity: .7; }
.ac-footer-bar a:hover { opacity: 1; }
@media (max-width: 900px) {
    .ac-footer-inner { grid-template-columns: 1fr; gap: 40px; padding: 48px 24px 32px; text-align: center; }
    .ac-footer-right { align-items: center; }
    .ac-footer-bar { flex-direction: column; gap: 6px; padding: 16px 24px; text-align: center; }
}

/* ─────────────────────────────────────────────
   PRIVACY SHEET (booking pages)
   Bottom sheet on mobile widths, centered modal on wider screens.
───────────────────────────────────────────── */
.ac-sheet-backdrop {
    position: fixed; inset: 0; background: rgba(13, 31, 66, .45);
    z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.ac-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.ac-sheet {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%) translateY(100%);
    width: 100%; max-width: 720px; height: 82vh; max-height: 820px;
    background: #fff; border-radius: 16px 16px 0 0; z-index: 101;
    box-shadow: 0 -4px 24px rgba(13, 31, 66, .18);
    display: flex; flex-direction: column;
    /* Hidden by default at every breakpoint — the media query below only
       repositions the OPEN state's transform, it must never make the
       closed sheet visible/interactive on its own. */
    opacity: 0; pointer-events: none;
    transition: transform .25s ease, opacity .2s ease;
}
.ac-sheet.open {
    transform: translateX(-50%) translateY(0);
    opacity: 1; pointer-events: auto;
}
@media (min-width: 760px) {
    .ac-sheet {
        bottom: auto; top: 50%; transform: translate(-50%, -45%);
        border-radius: 16px; height: 78vh;
    }
    .ac-sheet.open { transform: translate(-50%, -50%); }
}
.ac-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle);
    flex: 0 0 auto;
}
.ac-sheet-head h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.ac-sheet-close {
    background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1;
    color: var(--text-tertiary); padding: 4px 8px;
}
.ac-sheet-close:hover { color: var(--text-primary); }
.ac-sheet-frame { flex: 1; border: 0; width: 100%; }

/* ─────────────────────────────────────────────
   CARD
───────────────────────────────────────────── */
.ac-card {
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(13, 31, 66, .06);
    padding: var(--space-8);
    margin-bottom: var(--space-5);
}
.ac-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.ac-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.ac-lead { color: var(--text-secondary); font-size: 15px; margin-bottom: var(--space-5); line-height: 1.6; }

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.ac-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--brand-red); color: #fff;
    border: 1px solid var(--brand-red); border-radius: var(--radius-md);
    padding: 13px 24px; font-family: var(--font-display);
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background .2s, border-color .2s, box-shadow .2s;
    text-decoration: none; white-space: nowrap;
}
.ac-btn:hover { background: var(--red-aa); border-color: var(--red-aa); }
.ac-btn:disabled { opacity: .5; cursor: default; }
.ac-btn-block { width: 100%; }

.ac-btn-secondary {
    background: #fff; color: var(--text-primary);
    border-color: var(--border-strong);
}
.ac-btn-secondary:hover { background: var(--bg-subtle); border-color: var(--brand-blue); }

.ac-btn-ghost {
    background: transparent; color: #fff;
    border-color: rgba(255, 255, 255, .5);
}
.ac-btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }

.ac-btn-danger-outline {
    background: #fff; color: var(--red-aa);
    border-color: var(--red-aa);
}
.ac-btn-danger-outline:hover { background: #FBEAEA; }

.ac-btn-sm { padding: 8px 14px; font-size: 13px; }

/* ─────────────────────────────────────────────
   FORM FIELDS
───────────────────────────────────────────── */
.ac-label {
    display: block; font-size: 14px; font-weight: 600;
    color: var(--text-primary); margin: var(--space-4) 0 4px;
}
.ac-input, .ac-select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    font-family: var(--font-display); font-size: 15px;
    color: var(--text-primary); background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.ac-input:focus, .ac-select:focus {
    outline: none; border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 88, 168, .12);
}
.ac-select { appearance: none; -webkit-appearance: none; cursor: pointer; }

/* ─────────────────────────────────────────────
   TABLE
───────────────────────────────────────────── */
.ac-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ac-table thead th {
    background: var(--bg-subtle);
    text-transform: uppercase; font-size: 12px; letter-spacing: .4px;
    font-weight: 600; color: var(--text-tertiary);
    text-align: left; padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
}
.ac-table tbody td {
    font-size: 14px; color: var(--text-secondary);
    padding: 12px; border-bottom: 1px solid var(--border-subtle);
}
.ac-table tbody tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────────
   BADGES
───────────────────────────────────────────── */
.ac-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1.4;
    background: var(--brand-ice-pale); color: var(--brand-navy);
}
.ac-badge-green { background: #E6F6EB; color: var(--green-aa); }
.ac-badge-muted { background: var(--bg-muted); color: var(--text-tertiary); }
.ac-badge-red { background: #FBEAEA; color: var(--red-aa); }

/* ─────────────────────────────────────────────
   CHIPS (filter links + slot pickers)
───────────────────────────────────────────── */
.ac-chip {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 104px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: #fff; color: var(--text-primary);
    font-size: 14px; font-weight: 500; text-align: center;
    cursor: pointer; text-decoration: none;
    transition: border-color .15s, background .15s, color .15s;
}
.ac-chip:hover { border-color: var(--border-strong); }
.ac-chip.active {
    background: var(--brand-navy); border-color: var(--brand-navy); color: #fff;
}

/* ─────────────────────────────────────────────
   ALERTS
───────────────────────────────────────────── */
.ac-alert {
    font-size: 14px; padding: 12px 14px; border-radius: var(--radius-md);
    margin-top: var(--space-3);
    background: var(--brand-ice-pale); color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.ac-alert-error { background: #FBEAEA; color: var(--red-aa); border-color: #F0CFCF; }
.ac-alert-success { background: #E6F6EB; color: var(--green-aa); border-color: #C7E8D2; }

/* ─────────────────────────────────────────────
   HELPERS
───────────────────────────────────────────── */
.ac-hidden { display: none; }
.ac-note { font-size: 13px; color: var(--text-tertiary); margin-top: var(--space-2); }

/* Visually-hidden (honeypot) */
.ac-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Horizontally scrollable row of chips (day picker) */
.ac-chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
/* Grid of chips (time-slot picker) */
.ac-chip-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px; margin-top: var(--space-3);
}
.ac-chip-grid .ac-chip { min-width: 0; }

/* Inline callout box (e.g. chosen slot) */
.ac-slotbox {
    background: var(--brand-ice-pale); border-radius: var(--radius-md);
    padding: 14px 16px; margin: var(--space-3) 0 var(--space-5);
    font-weight: 600; font-size: 15px; color: var(--text-primary);
}

/* Segmented radio group (call type) */
.ac-segmented { display: flex; gap: 10px; margin-top: 6px; }
.ac-segmented label {
    flex: 1; margin: 0; border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 12px; text-align: center;
    cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-secondary);
    transition: border-color .15s, background .15s, color .15s;
}
.ac-segmented input { display: none; }
.ac-segmented label:has(input:checked) {
    border-color: var(--brand-blue); background: var(--brand-ice-pale); color: var(--brand-navy);
}

/* Consent row */
.ac-consent {
    display: flex; gap: 10px; align-items: flex-start;
    margin: var(--space-5) 0; font-size: 13px; color: var(--text-secondary);
}
.ac-consent input { margin-top: 3px; }
.ac-consent label { font-weight: 400; margin: 0; }

.ac-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 560px) {
    .ac-card { padding: var(--space-6); }
    .ac-main { margin: var(--space-5) auto; }
}

/* ─────────────────────────────────────────────
   DECK SLIDE CONTENT (shared: preview, presenter, room)
   Scope class .deck-slide sizes/positions slide HTML rendered from .deck
   files. All slide TYPOGRAPHY (headings, links, code, media sizing, etc.)
   now comes entirely from the AlarmCard Marp theme (/marp-theme.css,
   source at Resources/MarpRender/theme.css) — this block used to also
   carry that styling for the old hand-rolled DeckMarkdown renderer's plain
   HTML output, but duplicating it here now would just fight the theme's
   own rules. Load /marp-theme.css and /marp-scale.js on any page using
   .deck-slide (2026-07-11 amendment, internal/DESIGN_CALL_ROOMS_SLOTS_DECKS.md §6.2).

   Marp's own CSS targets `div.marpit > section` and renders each slide as
   a FIXED 1280×720px canvas — marp-scale.js scales that box down to fit
   whatever size .deck-slide actually is via a CSS transform, the same
   technique Marp's own official viewers use (there's no pure-CSS "just
   make it responsive" mode; marp-core's output is deliberately a fixed
   canvas meant to be scaled by the embedding page). Call
   `wireMarpScale(el)` once per .deck-slide container, then
   `el.__rescaleMarp()` after every `el.innerHTML = ...` slide swap — the
   incoming HTML has no inline style of its own, so each fresh <section>
   needs the scale re-applied. See marp-scale.js's own comment for why. */
.deck-slide {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #fff;
}
.deck-slide.marpit > section {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    transform-origin: top left;
}
