/* Booking and admin pages. Design tokens and @font-face duplicate index.html
   on purpose (see CLAUDE.md "Design tokens"): change a colour or font there,
   change it here too. */

@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("/fonts/dm-sans-normal-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("/fonts/dm-sans-normal-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Serif";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/instrument-serif-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/instrument-serif-normal-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Serif Fallback";
    src: local("Times New Roman"), local("Times");
    size-adjust: 85.39%;
    ascent-override: 115.94%;
    descent-override: 36.30%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "DM Sans Fallback";
    src: local("Arial"), local("Helvetica");
    size-adjust: 107.70%;
    ascent-override: 92.11%;
    descent-override: 28.78%;
    line-gap-override: 0%;
}

:root {
    --bg: #f7f4ed;
    --bg-2: #efeade;
    --ink: #1a1612;
    --ink-2: #4b403a;
    --rule: #d9d2c2;
    --accent: #7c3a1d;
    --accent-soft: #b98367;
    --display: "Instrument Serif", "Instrument Serif Fallback", "Times New Roman", serif;
    --ok: #3d6b45;
    --warn: #9a4a1a;
    /* Borders of controls: 3:1 against both backgrounds (WCAG 1.4.11). */
    --line-strong: #857a68;
}

* { box-sizing: border-box; }
/* Components set display; without this they would ignore the hidden attribute. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: "DM Sans", "DM Sans Fallback", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, .option:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.top {
    border-bottom: 1px solid var(--rule);
    background: rgba(247, 244, 237, 0.92);
}
.top-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    font-family: var(--display);
    font-size: 28px;
    font-style: italic;
    letter-spacing: 0.04em;
    text-decoration: none;
}
.top-inner > a:last-child { font-size: 14px; color: var(--ink-2); }

main { max-width: 760px; margin: 0 auto; padding: 32px 16px 120px; }
h1 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(36px, 7vw, 52px);
    line-height: 1.05;
    margin: 0 0 8px;
}
h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 28px;
    margin: 0 0 16px;
}
h3 {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--ink-2);
    margin: 24px 0 8px;
}
.lead { color: var(--ink-2); margin: 0 0 32px; max-width: 52ch; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 24px;
    background: var(--ink);
    color: var(--bg);
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
@media (hover: hover) { .btn:hover { background: var(--accent); } }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; background: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
@media (hover: hover) { .btn-ghost:hover { background: var(--ink); color: var(--bg); } }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 12px; }
.link-btn {
    background: none; border: 0; padding: 0; font: inherit; color: var(--accent);
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

.step { border-top: 1px solid var(--rule); padding: 28px 0; }
.step[hidden] { display: none; }
.step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.step-num { font-family: var(--display); font-style: italic; color: var(--accent); font-size: 22px; }

/* Service list */
.service-group { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; scroll-margin-top: 72px; }
.service-group > legend {
    font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
    color: var(--ink-2); padding: 24px 0 8px;
}
.option {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 12px 4px;
    border: 0;
    border-bottom: 1px solid var(--rule);
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.option input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.option-text { display: flex; flex-direction: column; min-width: 0; }
.option .name { font-weight: 500; overflow-wrap: anywhere; hyphens: auto; }
.option .meta { font-size: 13px; color: var(--ink-2); }
.option .price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.option:has(input:checked) { background: var(--bg-2); }
.option input:focus-visible { outline: none; }
.highlight { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.multi .box {
    width: 22px; height: 22px; border: 1.5px solid var(--line-strong); border-radius: 4px;
    position: relative;
}
.multi.is-chosen .box { background: var(--accent); border-color: var(--accent); }
.multi.is-chosen .box::after {
    content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
    border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.multi.is-chosen .multi-head { background: var(--bg-2); }
.multi-head .meta::after { content: " ›"; }
.multi-head[aria-expanded="true"] .meta::after { content: ""; }
.variants { border: 0; margin: 0; padding: 0 0 8px 36px; min-width: 0; }
.variants .option { min-height: 52px; }
.variant-clear { margin: 10px 0 4px; min-height: 44px; }

/* "Häufig gebucht": one tap and on to the times. */
.section-title {
    font-family: inherit; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
    font-weight: 500; color: var(--ink-2); margin: 8px 0 10px;
}
.quick { margin: 0 0 28px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    min-height: 92px; padding: 14px;
    border: 1px solid var(--line-strong); border-radius: 14px;
    background: #fffdf8; color: var(--ink);
    font: inherit; text-align: left; cursor: pointer;
}
.quick-tile .name { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; }
.quick-tile .kicker { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.quick-tile .meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--ink-2); }
@media (hover: hover) { .quick-tile:hover { border-color: var(--ink); } }
.quick-tile:active { transform: scale(0.97); background: var(--bg-2); }
.quick-tile { -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform 80ms ease-out, background-color 120ms; }
@media (min-width: 640px) { .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cat-chips {
    position: sticky; top: 0; z-index: 5;
    display: flex; gap: 8px; overflow-x: auto;
    margin: 0 -16px; padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    display: inline-flex; align-items: center;
    min-height: 40px; padding: 0 16px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    font-size: 14px; text-decoration: none; color: var(--ink); background: transparent;
    cursor: pointer;
}
.chip-radio { position: relative; min-height: 44px; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radio:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-radio:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.staff-chips { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.staff-chips legend { padding: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.staff-one { margin: 0 0 16px; color: var(--ink-2); }

.lost { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.lost .link-btn { min-height: 44px; }
#lost { margin-top: 12px; }

/* Screens */
.progress { display: flex; gap: 6px; margin: -16px 0 20px; }
.progress span { flex: 1; height: 3px; border-radius: 3px; background: var(--rule); transition: background-color 200ms; }
.progress span.on { background: var(--accent); }
.screen h1:focus, .screen h2:focus, #done:focus { outline: none; }
.screen.enter { animation: enter 200ms ease-out; }
.screen.enter-back { animation: enter-back 200ms ease-out; }
@keyframes enter { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0; margin: -8px 0 4px;
    background: none; border: 0; font: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.back-btn::before { content: "‹"; font-size: 22px; line-height: 1; }

/* Days and times */
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.week-head .month { font-weight: 500; text-transform: capitalize; }
.week-nav {
    width: 44px; height: 44px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: transparent;
    font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer;
}
.week-nav:disabled { opacity: 0.3; cursor: default; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day {
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: transparent;
    padding: 8px 2px 6px;
    font: inherit;
    text-align: center;
    cursor: pointer;
    color: var(--ink);
}
.day .wd { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.day .dn { display: block; font-size: 20px; font-family: var(--display); line-height: 1.2; white-space: nowrap; }
.day .dot { display: block; height: 14px; font-size: 10px; color: var(--ink-2); }
.day:not(:disabled) .dot::before {
    content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
    vertical-align: middle;
}
.day[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.day[aria-pressed="true"] .wd, .day[aria-pressed="true"] .dot { color: var(--bg); }
.day[aria-pressed="true"] .dot::before { background: var(--bg); }
.day:disabled {
    cursor: default; color: var(--ink-2); border-color: var(--rule);
    background: repeating-linear-gradient(135deg, transparent 0 6px, var(--bg-2) 6px 12px);
}
.times-wrap h3 { margin-top: 20px; }
.part-label { margin: 14px 0 6px; font-size: 13px; color: var(--ink-2); }
.times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
}
.time {
    min-height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    color: var(--ink);
}
@media (hover: hover) { .time:hover { border-color: var(--ink); } }
.time[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.next-free { margin: 8px 0; }
.wait { margin: 16px 0; }
.wait-open { min-height: 44px; }
.wait-panel { margin-top: 12px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; }
.wait-panel .btn { margin-top: 4px; }
.skeleton { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 56px; }
.skeleton span { height: 48px; border-radius: 999px; background: var(--bg-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
#slot-picker.is-loading { opacity: 0.5; pointer-events: none; transition: opacity 120ms; }

/* Tap feedback, like an app: no grey flash, a small press instead. */
.time, .day, .btn, .option, .chip, .week-nav, .back-btn, .link-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 80ms ease-out, background-color 120ms, color 120ms;
}
.time:active, .day:active, .btn:active, .chip:active, .week-nav:active { transform: scale(0.96); }
.option:active { background: var(--bg-2); }

/* Details */
.plan-when { margin-bottom: 8px !important; }
.plan-meta { margin-top: 8px !important; }
.known-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; margin-bottom: 16px; }
.hint { display: block; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.field-error { display: block; font-size: 14px; color: var(--warn); margin-top: 6px; }
.field input[aria-invalid="true"] { border-color: var(--warn); }
.note-open { min-height: 44px; margin-bottom: 8px; }
.trust { list-style: none; padding: 0; margin: 16px 0; font-size: 14px; }
.trust li { padding: 4px 0 4px 26px; position: relative; }
.trust li::before {
    content: ""; position: absolute; left: 4px; top: 10px; width: 10px; height: 6px;
    border: solid var(--ok); border-width: 0 0 2px 2px; transform: rotate(-45deg);
}
#turnstile:empty { display: none; }

/* Remembered customer */
.welcome p, .next-visit p { margin: 0 0 6px; }
.suggest { margin: 12px 0 8px; }
.suggest-times { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest-time { padding: 0 16px; min-height: 48px; background: var(--bg); }
.welcome-links { margin-top: 8px; }
.welcome-links .link-btn { min-height: 36px; }

/* Done */
#done .check {
    width: 56px; height: 56px; border-radius: 50%; background: var(--ok);
    position: relative; margin: 8px 0 20px;
    animation: pop 360ms cubic-bezier(.2, 1.4, .4, 1);
}
#done .check::after {
    content: ""; position: absolute; left: 19px; top: 14px; width: 14px; height: 24px;
    border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
#done h2 { font-size: clamp(34px, 7vw, 46px); margin-bottom: 4px; }
#done .actions { align-items: center; }
.remember { border: 1px solid var(--accent-soft); background: transparent; }
.again { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); }
.again p { margin: 0 0 8px; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .screen.enter, .screen.enter-back, #done .check, .skeleton span, .highlight { animation: none; }
    .time, .day, .btn, .option, .chip { transition: none; }
}

/* Forms */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; margin-bottom: 6px; }
.field input, .field textarea, .field select, select.input, input.input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: #fffdf8;
    font: inherit;
    color: var(--ink);
}
.field textarea { min-height: 88px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 12px; }
.check input { margin-top: 3px; accent-color: var(--accent); }

/* The one button at the bottom, like an app. */
html { scroll-padding-bottom: 120px; }
.bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--ink);
    color: var(--bg);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    z-index: 20;
    animation: rise 200ms ease-out;
}
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
.bar-inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.bar-text { min-width: 0; line-height: 1.3; }
.bar .btn { background: var(--bg); color: var(--ink); flex: 0 0 auto; min-height: 48px; }
@media (hover: hover) { .bar .btn:hover { background: var(--accent-soft); } }
.bar .btn[disabled] { opacity: 0.45; background: var(--bg); }
body.typing .bar { display: none; }
@media (max-width: 380px) {
    .bar-inner { flex-wrap: wrap; }
    .bar .btn { flex: 1 1 100%; }
}

.card {
    background: var(--bg-2);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}
.card p { margin: 0 0 6px; }
.plan-line { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.plan-line:last-child { border-bottom: 0; }
.plan-line .t { font-variant-numeric: tabular-nums; min-width: 48px; font-weight: 500; }
.notice { border-left: 3px solid var(--accent); padding: 8px 14px; background: var(--bg-2); margin: 16px 0; }
.notice.error { border-color: var(--warn); color: var(--warn); }
.notice.ok { border-color: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

@media (max-width: 480px) {
    /* Price stays beside the name, so a phone shows more services per screen. */
    .option { grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 12px; }
    .option input { margin-top: 1px; }
}

/* Tiles are choices now (aria-pressed), plus "Deine Auswahl" and "Noch etwas dazu?" */
.quick-tile[aria-pressed="true"] { border-color: var(--ink); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--ink); }
.quick-tile[aria-pressed="true"] .name::after { content: " ✓"; }
.addons { margin: -12px 0 28px; }
.chosen-list { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.chosen-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.chosen-list .name { font-weight: 500; line-height: 1.3; }
.chosen-list .meta { grid-column: 1; font-size: 13px; color: var(--ink-2); }
.chosen-remove {
    grid-column: 2; grid-row: 1 / span 2; width: 44px; height: 44px; border: 0; border-radius: 999px;
    background: transparent; color: var(--ink-2); font: inherit; font-size: 16px; cursor: pointer;
}
.chosen-remove:active { background: var(--bg-2); }
.addon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.addon {
    display: flex; align-items: flex-start; gap: 8px; min-height: 64px; padding: 10px 12px;
    border: 1px dashed var(--ink-2); border-radius: 10px; background: transparent; color: var(--ink);
    font: inherit; text-align: left; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform 80ms ease-out;
}
.addon:active { transform: scale(0.97); background: var(--bg-2); }
@media (hover: hover) { .addon:hover { border-style: solid; border-color: var(--ink); } }
.addon .plus { font-size: 20px; line-height: 1.1; color: var(--accent); }
.addon-text { display: flex; flex-direction: column; min-width: 0; }
.addon .kicker { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.addon .name { font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; }
.addon .meta { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
@media (min-width: 640px) { .addon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
