/* youpartments Gästeportal · stay.youpartments.com
   ==========================================================================
   Dokumentierte Ausnahme vom Dark-Standard: öffentliche Gast-App im hellen
   Theme nach Projekt 20 (Tokens unverändert übernommen). Systemschriften,
   keine externen Ressourcen, keine Inline-Styles (CSP 'self').
   Mobil zuerst, 16-px-Gutter, 8-px-Raster, sichtbare Fokusringe,
   prefers-reduced-motion schaltet alle Bewegung ab.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Farben (Projekt 20) */
  --text: #16211d;
  --text-2: #3d4a45;
  --muted: #667069;
  --line: #e4e7e5;
  --line-stark: #d3d8d5;
  --accent: #2f4f43;
  --accent-dunkel: #223b32;
  --accent-tint: #eef3f0;
  --accent-tint-2: #f6f9f7;
  --erfolg: #2b7a55;
  --erfolg-tint: #eaf4ee;
  --warn: #8a4b1f;
  --warn-tint: #fbf3ec;
  --flaeche: #f3f5f4;
  --karte: #ffffff;
  /* Ergänzungen für Fehler/Info (gleiche Temperatur) */
  --fehler: #9b2c2c;
  --fehler-tint: #fbefee;
  --info: #2f5b7a;
  --info-tint: #eef4f8;

  /* 8-px-Raster */
  --r1: 8px;
  --r2: 16px;
  --r3: 24px;
  --r4: 32px;
  --r5: 40px;
  --r6: 56px;

  /* Form */
  --rund-gross: 16px;
  --rund: 12px;
  --rund-klein: 10px;
  --schatten: 0 1px 2px rgba(22, 33, 29, 0.04),
              0 8px 20px -14px rgba(22, 33, 29, 0.22);
  --schatten-hoch: 0 1px 2px rgba(22, 33, 29, 0.05),
                   0 14px 32px -18px rgba(22, 33, 29, 0.30);
  --fokus: 0 0 0 3px #ffffff, 0 0 0 5px var(--accent);

  /* Bewegung */
  --zeit: 180ms;
  --zeit-lang: 250ms;
  --kurve: cubic-bezier(0.32, 0.72, 0, 1);

  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--flaeche);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  width: min(1080px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.main { flex: 1 0 auto; padding: var(--r3) 0 var(--r5); outline: none; }

p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dunkel); }

:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: 6px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { box-shadow: none; }

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

.skip-link {
  position: absolute; left: -9999px; top: var(--r1); z-index: 30;
  background: var(--karte); padding: 12px var(--r2); border-radius: var(--rund-klein);
  border: 2px solid var(--accent); color: var(--accent); font-weight: 600;
}
.skip-link:focus { left: var(--gutter); }

/* ---------- Kopf ---------- */

.topbar { background: var(--karte); }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--r2);
  padding: var(--r2) 0 12px;
}
.wordmark {
  font-size: 15px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.3;
}
.brand-sub { font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.topbar-line { height: 2px; background: var(--accent); }

.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-stark); border-radius: 999px; background: var(--accent-tint-2);
}
.lang-btn {
  min-width: 44px; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-2);
  cursor: pointer; transition: background var(--zeit) var(--kurve), color var(--zeit) var(--kurve);
}
.lang-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.lang-btn:hover:not([aria-pressed="true"]) { background: var(--accent-tint); }

/* ---------- Typografie ---------- */

h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0; outline: none; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.008em; line-height: 1.3; margin: 0; outline: none; }

.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--r1);
}
.lead { color: var(--text-2); margin-top: var(--r1); max-width: 62ch; }
.prose { color: var(--text-2); white-space: pre-line; max-width: 68ch; }
.prose + .prose { margin-top: 12px; }
.note { color: var(--muted); font-size: 13.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ---------- Pillen / Status ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.4;
  border: 1px solid var(--line-stark); background: var(--accent-tint-2); color: var(--text-2);
}
.pill-before_arrival, .pill-info { background: var(--info-tint); border-color: #cfe0ec; color: var(--info); }
.pill-in_stay, .pill-ok { background: var(--erfolg-tint); border-color: #cde6d7; color: var(--erfolg); }
.pill-after_departure { background: var(--flaeche); color: var(--muted); }
.pill-warn { background: var(--warn-tint); border-color: #f0dcc8; color: var(--warn); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot-ok { background: var(--erfolg); }
.dot-warn { background: #c27a3d; }
.dot-info { background: var(--info); }
.dot-muted { background: var(--line-stark); }
.status-line { display: flex; align-items: center; gap: 10px; margin-bottom: var(--r1); }
.status-chip { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--r1);
  min-height: 48px; padding: 0 20px;
  border-radius: var(--rund); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2;
  cursor: pointer;
  transition: background var(--zeit) var(--kurve), border-color var(--zeit) var(--kurve),
              transform var(--zeit) var(--kurve), box-shadow var(--zeit) var(--kurve);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--accent-dunkel); color: #fff; }
.btn-secondary { background: var(--karte); border-color: var(--line-stark); color: var(--accent); }
.btn-secondary:hover:not([disabled]) { background: var(--accent-tint-2); border-color: var(--accent); color: var(--accent-dunkel); }
.btn-ghost {
  min-height: 40px; padding: 0 12px; background: transparent; color: var(--accent);
  border-color: transparent; font-size: 14px;
}
.btn-ghost:hover:not([disabled]) { background: var(--accent-tint); }
.btn-danger { color: var(--fehler); }
.btn-danger:hover:not([disabled]) { background: var(--fehler-tint); }
.btn-arrow::after { content: "→"; content: "→" / ""; transition: transform var(--zeit) var(--kurve); }
.btn-arrow:hover::after { transform: translateX(4px); }
.btn-back::before { content: "←"; content: "←" / ""; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: var(--r2); }
.actions-end { justify-content: flex-end; margin-top: var(--r1); }

.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " ↗"; content: " ↗" / ""; }
.link-arrow:hover { text-decoration: underline; }
.link-back { font-weight: 600; text-decoration: none; font-size: 14px; }
.link-back::before { content: "← "; content: "← " / ""; }

/* ---------- Karten ---------- */

.card {
  background: var(--karte); border: 1px solid var(--line); border-radius: var(--rund-gross);
  box-shadow: var(--schatten); padding: 20px;
}
.card-title { margin-bottom: 12px; }
.card-accent { border-top: 3px solid var(--accent); }
.card-cta { background: linear-gradient(180deg, var(--accent-tint-2), var(--karte) 60%); }

.grid { display: grid; grid-template-columns: 1fr; gap: var(--r2); margin-top: var(--r3); }

/* ---------- Zustände ---------- */

.state-message { max-width: 620px; padding: var(--r4) 0; }
.state-message h1 { margin-bottom: var(--r2); }
.state-message .prose { margin-bottom: 12px; }

.skeleton { display: grid; gap: var(--r2); padding-top: var(--r2); }
.sk { background: linear-gradient(90deg, #e9ecea 0%, #f4f6f5 50%, #e9ecea 100%); background-size: 200% 100%;
  border-radius: var(--rund-klein); animation: shimmer 1.4s ease-in-out infinite; }
.sk-line { height: 12px; }
.sk-short { width: 30%; }
.sk-title { height: 28px; width: 70%; }
.sk-block { height: 120px; border-radius: var(--rund-gross); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Aufenthalt ---------- */

.hero { padding: var(--r2) 0 0; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--r1) 12px; margin-bottom: 4px; }
.hero-meta .eyebrow { margin-bottom: 0; }
.greeting { color: var(--text-2); margin-top: var(--r1); }

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin: var(--r3) 0 0; padding: var(--r2); background: var(--karte);
  border: 1px solid var(--line); border-radius: var(--rund-gross); box-shadow: var(--schatten);
}
.fact dt { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.fact-sub { display: block; font-weight: 400; color: var(--text-2); font-size: 14px; }

.address { font-style: normal; display: grid; margin-bottom: var(--r1); }
.plain-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 4px; color: var(--text-2); }
.plain-list li::before { content: "·"; content: "·" / ""; color: var(--accent); font-weight: 700; margin-right: var(--r1); }
.card .note { margin-top: 12px; }

.wifi { display: grid; gap: 12px; margin: 0; }
.wifi dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.wifi dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; word-break: break-all; }
.select-all { user-select: all; -webkit-user-select: all; }

.contact-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: var(--r1); }
.contact-list .label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.contact-list a { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Status ---------- */

.view-status { max-width: 680px; }
.card-status { padding: var(--r3) 20px; }
.card-status h1 { margin-bottom: 12px; }
.card-status .note { margin-top: var(--r2); }

.timeline { list-style: none; margin: var(--r3) 0 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--muted); }
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: 7px; top: 30px; bottom: -10px; width: 2px; background: var(--line);
}
.tl-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-stark); background: var(--karte); flex: none; }
.tl-done { color: var(--text-2); }
.tl-done .tl-dot { background: var(--erfolg); border-color: var(--erfolg); }
.tl-done:not(:last-child)::after { background: var(--erfolg); }
.tl-current { color: var(--text); font-weight: 600; }
.tl-current .tl-label { color: var(--text); }
.tl-todo .tl-label { color: var(--text-2); }
.tl-current .tl-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); background: var(--accent); }

/* ---------- Wizard ---------- */

.view-checkin { max-width: 760px; }
.wizard-head { padding-top: var(--r1); }

.steps {
  list-style: none; margin: var(--r3) 0 var(--r2); padding: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
}
.steps li { min-width: 0; }
.step-btn {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
  padding: 0 0 2px; background: none; border: 0; font: inherit; text-align: left; color: var(--muted);
}
button.step-btn { cursor: pointer; }
button.step-btn:hover .step-label { color: var(--accent); text-decoration: underline; }
.step-btn::before { content: ""; height: 4px; border-radius: 999px; background: var(--line); order: -1; }
.is-done .step-btn::before { background: var(--erfolg); }
.is-current .step-btn::before { background: var(--accent); }
.step-num { display: none; }
.step-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-current .step-label { color: var(--text); }
.is-done .step-label { color: var(--text-2); }

.wizard { display: grid; gap: var(--r2); }
.step-body { display: grid; gap: var(--r2); }

.subcard {
  margin: 0; min-width: 0; padding: 18px 16px 16px;
  background: var(--karte); border: 1px solid var(--line); border-radius: var(--rund-gross); box-shadow: var(--schatten);
  display: grid; gap: 14px;
}
.subcard legend {
  float: left; width: 100%; padding: 0; margin-bottom: 2px;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--r1); justify-content: space-between;
  font-size: 16px; font-weight: 600;
}
.subcard legend + * { clear: both; }
.subcard-head { display: flex; align-items: center; justify-content: space-between; gap: var(--r1); }
.subcard-title { font-size: 16px; }

.row-2, .row-zip { display: grid; gap: 14px; grid-template-columns: 1fr; }

.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 14px; color: var(--text); }
.field-help { font-size: 13px; color: var(--muted); }
.field-hint:empty, .field-error:empty { display: none; }
.field-hint { font-size: 13px; color: var(--warn); background: var(--warn-tint); border-radius: var(--rund-klein); padding: 6px 10px; }
.field-error { font-size: 13.5px; color: var(--fehler); font-weight: 600; }
.field-error::before { content: "! "; content: "! " / ""; }
.inline-row { display: flex; gap: var(--r1); align-items: center; }
.inline-row select { flex: 1; min-width: 0; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--karte); border: 1px solid var(--line-stark); border-radius: var(--rund-klein);
  transition: border-color var(--zeit) var(--kurve), box-shadow var(--zeit) var(--kurve);
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { border-color: var(--accent); border-radius: var(--rund-klein); }
input[readonly] { background: var(--flaeche); color: var(--text-2); }
[aria-invalid="true"] { border-color: var(--fehler); background-color: var(--fehler-tint); }

.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check label { font-weight: 600; }

details.rules { border: 1px solid var(--line); border-radius: var(--rund-klein); padding: 10px 12px; background: var(--accent-tint-2); }
details.rules summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.rules .prose { margin-top: var(--r1); }

.review-list { margin: 0; display: grid; gap: 12px; }
.review-row dt { font-weight: 600; }
.review-row dd { margin: 2px 0 0; display: grid; color: var(--text-2); font-variant-numeric: tabular-nums; }

.wizard-actions {
  display: flex; flex-wrap: wrap-reverse; gap: 12px; justify-content: space-between; align-items: center;
  padding-top: var(--r1);
}
.wizard-actions .btn { flex: 1 1 160px; }

.save-state { margin-top: var(--r2); font-size: 13px; color: var(--muted); }
.save-saved::before { content: "✓ "; content: "✓ " / ""; color: var(--erfolg); }
.save-error { color: var(--warn); }

.msg { border-radius: var(--rund); padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-tint-2); }
.msg p + p { margin-top: 6px; }
.msg-title { font-weight: 600; margin-bottom: 4px; }
.msg-info { border-left-color: var(--info); background: var(--info-tint); color: var(--text-2); }
.msg-error { border-left-color: var(--fehler); background: var(--fehler-tint); color: var(--text); margin-bottom: var(--r2); outline: none; }
.msg-error ul { margin: 6px 0 0; padding-left: 18px; }
.msg-error a { color: var(--fehler); font-weight: 600; }

/* ---------- Rechtsseiten ---------- */

.legal { max-width: 760px; }
.legal h1 { margin-bottom: 4px; }
.legal .link-back { display: inline-block; margin-bottom: var(--r2); }
.legal-card { margin-top: var(--r3); display: grid; gap: var(--r3); }
.legal-section h2 { margin-bottom: var(--r1); }
.legal-section p, .legal-section li, .legal-section address { color: var(--text-2); }
.legal-section p + p, .legal-section ul + p, .legal-section p + ul { margin-top: var(--r1); }
.legal-section ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal-section address { font-style: normal; margin-bottom: var(--r1); }

/* ---------- Fuß ---------- */

.footer { background: var(--karte); border-top: 1px solid var(--line); padding: var(--r3) 0 calc(var(--r3) + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: grid; gap: 12px; }
.footer-operator { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px var(--r3); font-size: 14px; }
.footer-links a { text-decoration: none; font-weight: 600; }
.footer-links a:hover, .footer-links a[aria-current="page"] { text-decoration: underline; }

/* ---------- Einblendung (einmalig) ---------- */

.view > *, .state-message, .legal-card { animation: rise var(--zeit-lang) var(--kurve) both; }
.grid > *:nth-child(2) { animation-delay: 40ms; }
.grid > *:nth-child(3) { animation-delay: 80ms; }
.grid > *:nth-child(n+4) { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.grid > * { animation: rise var(--zeit-lang) var(--kurve) both; }

/* ---------- Breiter ---------- */

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  h1 { font-size: 32px; }
  .row-2 { grid-template-columns: 1fr 1fr; }
  .row-zip { grid-template-columns: 140px 1fr; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 20px; }
  .subcard { padding: 22px 24px 24px; }
  .card { padding: 24px; }
  .step-num { display: inline; }
  .step-num::after { content: ". "; content: ". " / ""; }
  .step-btn { flex-direction: row; flex-wrap: wrap; column-gap: 4px; }
  .step-btn::before { flex: 1 0 100%; }
  .wizard-actions .btn { flex: 0 0 auto; }
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > .card-cta, .grid > .card-accent { grid-column: 1 / -1; }
  .grid > .card-wide { grid-column: 1 / -1; }
}

/* ---------- Bewegung reduzieren ---------- */

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