/* countdown-zum-urlaub.de – Styles
   Keine externen Schriften (DSGVO-freundlich): System-Schriften mit runden Varianten, wo vorhanden. */

:root {
  --text: #fff;
  --muted: rgba(255, 255, 255, .78);
  --faint: rgba(255, 255, 255, .55);
  --glass: rgba(10, 16, 38, .34);
  --glass-strong: rgba(10, 16, 38, .62);
  --field: rgba(255, 255, 255, .12);
  --field-hover: rgba(255, 255, 255, .18);
  --line: rgba(255, 255, 255, .22);
  --accent: #ffcf6e;
  --accent-2: #ff9f6e;
  --accent-ink: #3a2300;
  --danger: #ffb4a8;
  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .28);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: #14204a;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

[hidden] { display: none !important; }

/* ---------- Hintergrund ---------- */

#scene {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: -2;
  display: block;
  transition: opacity .45s ease;
}
#scene.is-fading { opacity: 0; }

.shade {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(6, 10, 30, .38), rgba(6, 10, 30, 0) 22%, rgba(6, 10, 30, 0) 62%, rgba(6, 10, 30, .5)),
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(6, 10, 30, var(--scrim, .22)), rgba(6, 10, 30, 0) 75%);
  transition: background .6s ease;
}

/* ---------- Kopfzeile ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 3vw, 32px) 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .01em;
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.brand .dim { opacity: .7; font-weight: 500; }
.brand-icon { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }

.tools { display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons & Formular ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .15s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .chip input:focus-visible + span, .field input:focus-visible, .field select:focus-visible, .select select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(255, 160, 90, .35);
}
.btn-primary:hover { background: linear-gradient(135deg, #ffd98a, #ffb184); border-color: transparent; }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }
.btn-ghost { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn-icon { width: 42px; padding: 0; }
.btn[hidden] { display: none; }

.badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .78rem;
  line-height: 22px;
  text-align: center;
}

.select { position: relative; display: inline-flex; }
.select select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  padding: 9px 36px 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
}
.select::after {
  content: "";
  position: absolute;
  right: 16px; top: 50%;
  width: 7px; height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select option { background: #1b2550; color: #fff; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(8px, 3vh, 40px) 16px 24px;
}

.panel {
  width: 100%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.setup {
  max-width: 680px;
  padding: clamp(22px, 4vw, 40px);
  background: var(--glass-strong);
}
.setup h1 {
  margin: 0 0 6px;
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.lead { margin: 0 0 24px; color: var(--muted); font-size: 1.05rem; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: .92rem; }
.field em, summary em { font-style: normal; font-weight: 400; color: var(--faint); }
.field input, .field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: background .2s, border-color .2s;
}
.field input::placeholder { color: rgba(255, 255, 255, .45); }
.field input:hover, .field select:hover { background: var(--field-hover); }
.field input:focus, .field select:focus { background: var(--field-hover); border-color: rgba(255, 255, 255, .5); }
.field select { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 40px; text-overflow: ellipsis; }
.field select, .field select:hover, .field select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px 8px;
}
.field option { background: #1b2550; color: #fff; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .8; cursor: pointer; }

.motifs { margin: 22px 0 0; padding: 0; border: 0; }
.motifs legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  user-select: none;
}
.chip span:hover { background: var(--field-hover); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.more { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.more summary { cursor: pointer; font-weight: 600; font-size: .95rem; list-style: none; border-radius: 6px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "＋"; display: inline-block; width: 1.4em; transition: transform .2s; }
.more[open] summary::before { transform: rotate(45deg); }
.more .grid { margin-top: 14px; }

.form-error {
  margin: 18px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 90, 70, .22);
  border: 1px solid rgba(255, 140, 120, .5);
  font-weight: 600;
}

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.privacy-note { margin: 16px 0 0; font-size: .85rem; color: var(--faint); }

/* ---------- Countdown ---------- */

.countdown {
  width: 100%;
  max-width: 920px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 2px 18px rgba(0, 0, 0, .4);
}

.kicker {
  margin: 0;
  font-size: clamp(.85rem, 2.2vw, 1rem);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.dest {
  margin: 2px 0 clamp(16px, 3vh, 28px);
  font-size: clamp(2.6rem, 9vw, 5.6rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 18px);
  max-width: 760px;
  margin: 0 auto;
}
.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(12px, 2.4vw, 22px) 6px clamp(10px, 2vw, 18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow);
}
.num {
  font-size: clamp(2.1rem, 8.5vw, 5.4rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.lbl {
  margin-top: 6px;
  font-size: clamp(.68rem, 1.8vw, .85rem);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint {
  margin: clamp(16px, 3vh, 26px) 0 4px;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 700;
}
.when { margin: 0 auto; max-width: 640px; color: var(--muted); font-size: clamp(.92rem, 2.2vw, 1.05rem); }

.info {
  margin: clamp(18px, 4vh, 34px) auto 0;
  max-width: 760px;
  padding: clamp(16px, 3vw, 26px);
  text-align: left;
  text-shadow: none;
}

.progress-head { display: flex; justify-content: space-between; font-weight: 700; font-size: .95rem; }
.bar {
  position: relative;
  height: 12px;
  margin: 10px 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fd3ff, var(--accent), var(--accent-2));
  transition: width .8s ease;
}
.bar > i {
  position: absolute;
  top: 50%;
  left: 0;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  transform: translate(-50%, -55%);
  transition: left .8s ease;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
}
.progress small { color: var(--faint); font-size: .85rem; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .09);
}
.facts strong { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.facts span { font-size: .85rem; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---------- Dialog & Toast ---------- */

.dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 22, 50, .9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(4, 8, 24, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dialog-head h2 { margin: 0; font-size: 1.3rem; }

.saved-list { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 8px; }
.saved-list li { display: flex; align-items: center; gap: 8px; }
.saved-open {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .07);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.saved-open:hover { background: rgba(255, 255, 255, .14); }
.saved-open b { display: block; }
.saved-open small { color: var(--muted); }
.saved-open .days { font-weight: 800; white-space: nowrap; }
.saved-empty { color: var(--muted); padding: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Packliste */
.dialog-wide { width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 820px); }
.dialog-wide > .muted { margin: -6px 0 8px; }
.badge-soft { background: rgba(255, 255, 255, .2); color: var(--text); }
.btn-primary .badge-soft { background: rgba(0, 0, 0, .15); color: inherit; }
.pack-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-bottom: 14px; }
.pack-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; }
.pack-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 18px; }
.pack-group { margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.pack-group legend { padding: 0; margin-bottom: 4px; font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pack-item { display: flex; align-items: center; gap: 6px; }
.pack-item label { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.pack-item input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.pack-item input:checked + span { color: var(--faint); text-decoration: line-through; }
.btn-mini { width: 30px; min-height: 30px; font-size: .8rem; }
.pack-add { display: flex; gap: 8px; margin: 8px 0 12px; }
.pack-add input {
  flex: 1; min-width: 0; min-height: 42px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--text); font: inherit;
}
.pack-add input::placeholder { color: rgba(255, 255, 255, .45); }
.pack-add input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pack-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* Pause-Schalter */
#pause .i-play { display: none; }
#pause[aria-pressed="true"] .i-pause { display: none; }
#pause[aria-pressed="true"] .i-play { display: inline; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 50;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(16, 22, 50, .92);
  border: 1px solid var(--line);
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding: 12px clamp(16px, 3vw, 32px) max(14px, env(safe-area-inset-bottom));
  font-size: .82rem;
  color: var(--muted);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.footer nav { display: flex; gap: 16px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; color: #fff; }

.noscript { position: fixed; inset: auto 16px 16px; padding: 12px; border-radius: 12px; background: #b33; text-align: center; }

#confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; }

/* ---------- Rechtliche Seiten ---------- */

.legal-page {
  background:
    radial-gradient(circle at 75% 18%, rgba(255, 207, 110, .55), rgba(255, 207, 110, 0) 28%),
    linear-gradient(#24194f, #7a3a7c 45%, #e0606a 75%, #ff9d5c);
  background-attachment: fixed;
}
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px);
  background: var(--glass-strong);
}
.legal h1 { margin-top: 0; font-size: clamp(1.7rem, 4vw, 2.3rem); hyphens: auto; overflow-wrap: break-word; }
.legal h2 { margin-top: 1.8em; font-size: 1.2rem; }
.legal p, .legal li { color: rgba(255, 255, 255, .88); overflow-wrap: break-word; }
.legal .todo { padding: 2px 6px; border-radius: 6px; background: rgba(255, 207, 110, .25); }
.legal main { display: block; }

/* ---------- Responsiv ---------- */

@media (max-width: 720px) {
  .hide-sm { display: none; }
  .tools .btn { width: 42px; padding: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .brand { font-size: .95rem; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .brand > span { display: none; }
  .tools { gap: 6px; }
  .select select { max-width: 132px; padding-left: 12px; padding-right: 30px; text-overflow: ellipsis; }
  .select::after { right: 13px; }
  .unit { border-radius: 16px; }
  .actions .btn { flex: 1 1 auto; }
}

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