/* Sunstar Check-in – Gestaltung angelehnt an specials.sunstar.ch
   Titel: Cormorant Garamond (Serif), Text und Buttons: DM Sans.
   Farben: Blau #313C48, Beige #F5F3EF, Gold #B0A572. Ecken bewusst eckig wie auf der Website. */

/* Schriften liegen in der App (public/fonts, SIL Open Font License), nicht bei Google:
   so erfährt Google nicht bei jedem Aufruf die IP-Adresse des Hotels. Variable Schriften,
   eine Datei pro Zeichensatz deckt alle Strichstärken ab. */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("/fonts/cormorant-garamond-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("/fonts/cormorant-garamond-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: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/dm-sans-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/dm-sans-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; }
:root {
  --blue: #313c48;
  --beige: #f5f3ef;
  --gold: #b0a572;
  --gold-dark: #8f854f; /* Gold für Text auf hellem Grund, damit es gut lesbar bleibt */
  --bg: var(--beige);
  --card: #ffffff;
  --text: #313c48;
  --muted: #6e7681;
  --line: #e4dfd4;
  --field: #d6d0c3;
  --error: #a3271b;
  --ok: #3f6b4a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
}

/* Hinweis Testumgebung – bewusst nicht in Markenfarben, damit er auffällt */
.banner {
  background: #f2c94c;
  color: #3d2e00;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 16px;
}

/* Markenkopf: Logo weiss auf Blau (das Logo ist schwarz mit transparentem Hintergrund) */
.brand { background: var(--blue); display: flex; justify-content: center; padding: 16px 20px 14px; }
.brand img { height: 48px; width: auto; filter: brightness(0) invert(1); }

main { max-width: 820px; margin: 0 auto; padding: 28px 20px 48px; }

/* Titel */
h1, h2 { font-family: var(--serif); font-weight: 700; color: var(--blue); line-height: 1.15; }
h1 { font-size: 36px; margin: 0; }
h2 { font-size: 30px; margin: 0 0 8px; }
.accent { color: var(--gold); }
.eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 6px; }

header.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.muted { color: var(--muted); }
.error { color: var(--error); }

/* Buttons: Gold, Grossschrift, gesperrt, eckig */
button {
  font: 700 14px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 0;
  border-radius: 0;
  padding: 16px 32px;
  min-height: 54px;
  background: var(--gold);
  color: #fff;
  cursor: pointer;
}
button:active { background: var(--gold-dark); }
button.secondary { background: transparent; color: var(--gold-dark); border: 1px solid var(--gold); }
button.link { background: none; color: var(--muted); padding: 8px; min-height: 0; font-weight: 500; font-size: 14px; letter-spacing: 0.04em; text-transform: none; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.5; }

/* Arrival-Liste */
.list { display: grid; gap: 10px; }
.res {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  width: 100%;
  min-height: 0;
  text-align: left;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  padding: 18px 20px;
}
.res:active { background: #faf8f3; }
.res-item[hidden], .group[hidden] { display: none; }
.res .name { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--blue); }
.res .meta { color: var(--muted); font-size: 14px; }
.res .pax { grid-row: span 2; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-dark); }
.res.is-done { border-left-color: var(--line); }
.res.is-done .name { color: var(--muted); }

.search { margin-bottom: 20px; }
.search[hidden] { display: none; }
/* Lupe neben «Arrivals heute» blendet das Suchfeld ein und aus */
.title-row { display: flex; align-items: center; gap: 14px; }
.search-toggle { background: none; padding: 6px; min-height: 0; line-height: 0; }
.search-toggle:active { background: none; opacity: 0.6; }
.search-toggle img { width: 26px; height: 26px; }
.search-toggle[aria-expanded="true"] { outline: 1px solid var(--gold); }
.group + .group { margin-top: 28px; }
.group-title { font-size: 26px; margin: 0; display: inline; }

/* Aufklappbare Gruppen («Erfasst – noch nicht eingecheckt», «Eingecheckt») */
details.group > summary { list-style: none; cursor: pointer; padding: 12px 0 8px; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "▸"; font-size: 20px; color: var(--gold); transition: transform 0.15s; }
details.group[open] > summary::before { transform: rotate(90deg); }
details.group[open] > summary { margin-bottom: 14px; }
.group-count { font-family: var(--sans); font-size: 13px; font-weight: 700; color: #fff; background: var(--blue); padding: 3px 9px; vertical-align: middle; }

/* Markierungen */
.badge { display: inline-block; vertical-align: middle; margin-left: 8px; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 8px; }
.badge.done { background: #e6eee7; color: var(--ok); }
.badge.partial { background: #f1ecd9; color: var(--gold-dark); }
.badge.warn { background: #f7e1dd; color: var(--error); }
.badge.group-tag { background: #e3e6ea; color: var(--blue); }
.warn-text { color: var(--error); }
/* Dezenter Hinweis, dass ein Vermerk «Profil prüfen» erledigt wurde */
.changed { margin-left: 8px; font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--muted); vertical-align: middle; }
/* Vermerk der Gastsuche, direkt unter der Karte, mit «Erledigt» */
.res-item .note { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px 10px 16px; background: #fbf0ee; border: 1px solid #f0d6d1; border-top: 0; border-left: 4px solid var(--error); color: var(--error); font-size: 14px; font-weight: 500; }
.note-done { flex: none; min-height: 40px; padding: 10px 16px; font-size: 12px; background: #fff; color: var(--error); border: 1px solid var(--error); }
.note-done:active { background: #f7e1dd; }
/* Link zum Meldeschein (PDF) unter einer erfassten Reservation */
.doc-link { display: inline-block; margin: 6px 0 0 16px; padding: 6px 0; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); padding: 28px; }

/* Fortschritt über die Personen */
.steps { display: flex; gap: 6px; margin: 0 0 18px; }
.steps span { flex: 1; height: 3px; background: var(--line); }
.steps span.done { background: var(--gold); }

/* Formular */
form.person { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
form.person .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
input, select {
  font: 400 17px/1.3 var(--sans);
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--field);
  border-radius: 0;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold); }
.street-row { display: grid; grid-template-columns: 1fr 140px; gap: 18px; }
.consent { display: flex; align-items: flex-start; gap: 14px; font-size: 16px; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--text); padding: 16px; background: var(--beige); cursor: pointer; }
.consent input { width: 26px; height: 26px; min-height: 0; flex: none; margin: 0; padding: 0; accent-color: var(--gold); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 8px; }

/* Anrede Herr / Frau */
.salutation { display: grid; gap: 6px; }
.salutation .label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.segmented { display: inline-flex; gap: 10px; }
.segmented button { min-width: 140px; background: #fff; color: var(--blue); border: 1px solid var(--field); }
.segmented button.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Unterschriftsfeld */
.signature-pad { position: relative; margin-top: 18px; background: #fff; border: 1px solid var(--field); border-bottom: 2px solid var(--blue); }
.signature-pad canvas { display: block; width: 100%; height: 240px; touch-action: none; cursor: crosshair; }
.signature-hint { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.signature-pad.signed .signature-hint { display: none; }

/* Interessen: Kacheln und Schalter (angewählt = goldener Rahmen) */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.switches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.choice { position: relative; background: #fff; color: var(--blue); border: 1px solid var(--field); font: 500 16px/1.3 var(--sans); letter-spacing: normal; text-transform: none; touch-action: manipulation; }
.choice:active { background: var(--beige); }
.choice svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.choice.on { border: 2px solid var(--gold); background: #fbfaf6; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 136px; padding: 18px 10px; }
.tile.on::after { content: "✓"; position: absolute; top: 8px; right: 12px; color: var(--gold-dark); font-size: 20px; font-weight: 700; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; text-align: left; }
.switch svg { width: 26px; height: 26px; flex: none; }
.knob { position: relative; flex: none; width: 44px; height: 26px; background: var(--field); }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; transition: left 0.15s; }
.switch.on .knob { background: var(--gold); }
.switch.on .knob::after { left: 21px; }
.small { font-size: 13px; margin-top: 16px; }
.form-actions.split { justify-content: space-between; }

/* Danke- und Fehlerseite */
.center { text-align: center; padding: 56px 28px; }
.center h1 { font-size: 44px; margin-bottom: 14px; }
.card.thanks { background: var(--blue); border: 0; }
.card.thanks h1 { color: #fff; }
.card.thanks .eyebrow { color: var(--gold); }
.card.thanks p { color: #d9dde2; font-size: 18px; max-width: 460px; margin: 0 auto; }
.card.thanks p.demo-note { margin-top: 20px; padding: 12px 16px; border: 1px solid #f2c94c; color: #f2c94c; font-size: 15px; }
.footer-link { text-align: center; margin-top: 28px; }

/* PIN-Dialog */
dialog { border: 0; padding: 32px; width: min(420px, 92vw); border-top: 4px solid var(--gold); }
dialog::backdrop { background: rgb(49 60 72 / 0.6); }
dialog input { font-size: 28px; letter-spacing: 0.4em; text-align: center; margin: 8px 0; }
dialog .actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 12px; }

/* Eigener Ziffernblock */
.keypad {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--beige); border-top: 3px solid var(--gold);
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgb(49 60 72 / 0.15);
}
.keypad[hidden] { display: none; }
.keypad-head { max-width: 520px; margin: 0 auto 8px; display: flex; justify-content: space-between; align-items: center; }
.keypad-title { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.keypad-head-actions { display: flex; gap: 10px; }
.keypad-done, .keypad-clear { min-height: 44px; padding: 8px 18px; font-size: 12px; }
.keypad-clear { background: #fff; color: var(--error); border: 1px solid var(--field); }
.keypad-grid { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad-grid button { background: #fff; color: var(--blue); font: 500 26px/1 var(--sans); letter-spacing: normal; min-height: 62px; border: 1px solid var(--line); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.keypad-grid button:active { background: #ebe7de; }
.keypad-grid .muted-key { background: #ebe7de; }
.keypad-grid .muted-key:active { background: var(--field); } /* sichtbar dunkler, sonst keine Rückmeldung beim Tippen */
.keypad-grid button[hidden] { visibility: hidden; display: block; }
body.keypad-open main { padding-bottom: 340px; }

@media (max-width: 600px) {
  form.person { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  .brand img { height: 40px; }
}

/* KINDER-REGELUNG: ausgeblendete Felder bei Kindern unter 16 (hidden schlägt sonst display:flex/grid nicht) */
.person .adult-only[hidden], .child-hint[hidden] { display: none; }
.child-hint { margin: 0; padding: 12px 16px; background: #f1ecd9; color: var(--gold-dark); font-size: 15px; font-weight: 600; }

/* Pflichtfelder: rotes Sternchen; fehlende Felder nach «Weiter» rot umrandet */
.req { color: var(--error); margin-left: 3px; }
input.invalid, select.invalid { border-color: var(--error); outline: 1px solid var(--error); }
.segmented.invalid button { border-color: var(--error); }
/* Codice Fiscale nur bei Italien (Nationalität oder Wohnsitz) */
.person .it-only.off { display: none; }

/* SPRACHEN: Leiste «DE · EN · FR · IT» oben rechts auf den Gast-Seiten */
.lang-bar { display: flex; justify-content: flex-end; gap: 6px; margin: 0 0 14px; }
.lang-bar button { min-height: 40px; min-width: 52px; padding: 6px 12px; background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; }
.lang-bar button.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* DEMO-MODUS: Test-Reservation anlegen, Demo zurücksetzen (nur ohne Sihot sichtbar) */
.demo-tools { margin-top: 28px; border: 1px dashed #f2c94c; }
.demo-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.demo-row select { flex: 0 0 auto; width: auto; }
