/* Pozvánka Lukáš 40. Tokeny podle design systému swee, bez přechodů a stínů. */

:root {
  --pink: #ed0677;
  --pink-deep: #c4005f;
  --lime: #c0f787;
  --blush: #ffdbed;
  --white: #ffffff;
  --ink: #252122;
  --ink-muted: #5e575a;
  --font-display: "Nunito", ui-rounded, system-ui, sans-serif;
  --font-text: "Nunito Sans", system-ui, sans-serif;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

p, h1, h2, h3, dl, dd { margin: 0; }

a { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Rozvržení: úzký sloupec i na desktopu ---------- */

.page {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.screen {
  position: relative;
  overflow: hidden;
  padding: 32px 24px 48px;
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

/* Shluk 2×2 kruhů ukotvený k pravému hornímu rohu sloupce. */
.cluster {
  position: absolute;
  top: 0;
  right: 0;
  fill: var(--pink);
  pointer-events: none;
}

.row-circles {
  display: flex;
  margin-top: 48px;
}
.row-circles span {
  flex: none;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--pink);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--lime);
  color: var(--ink);
  font: 800 13px/16px var(--font-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero { position: relative; }

.hero__name {
  margin-top: 24px;
  font: 900 min(64px, 16.4vw)/1 var(--font-display);
  text-transform: uppercase;
}

.hero__number {
  margin-top: 4px;
  font: 900 min(210px, 53.8vw)/0.85 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--pink);
}

.h1 {
  font: 900 44px/1.05 var(--font-display);
  text-transform: uppercase;
  text-wrap: balance;
}
.h1--pink { color: var(--pink); }

.h2 {
  margin-bottom: 16px;
  font: 800 30px/1.15 var(--font-display);
}

.lead {
  margin-top: 16px;
  font-size: 20px;
  line-height: 30px;
  font-weight: 600;
}
.lead--small {
  font-size: 18px;
  line-height: 28px;
}

.label {
  font: 800 13px/16px var(--font-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pink-deep);
}
.label--blush { color: var(--blush); }

/* ---------- Úvod a odpočet ---------- */

.intro { margin-top: 12px; }

.countdown {
  margin-top: 24px;
  padding: 16px 12px;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--ink);
}
.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  text-align: center;
}
.countdown__num {
  display: block;
  font: 900 32px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--pink-deep);
}
.countdown__label {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-muted);
}
.countdown__done {
  padding: 6px 0;
  text-align: center;
  font: 900 32px/1.2 var(--font-display);
  color: var(--pink-deep);
}

/* ---------- Kdy a kde ---------- */

.details { margin-top: 32px; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--ink);
}
.card--large {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.card__title {
  margin-top: 6px;
  font: 800 22px/1.2 var(--font-display);
}
.card__text {
  margin-top: 4px;
  font-size: 18px;
  line-height: 28px;
}
.card__action,
.calendar-menu { margin-top: 14px; }

.calendar-menu > summary { list-style: none; }
.calendar-menu > summary::-webkit-details-marker { display: none; }
.calendar-menu > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin: -4px 0 0 4px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.calendar-menu[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}
.calendar-menu .btn-row { margin-top: 12px; }

.info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px;
}
.info__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blush);
  stroke: var(--ink);
}

/* ---------- Tlačítka ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 32px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: 800 19px/1 var(--font-display);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary { background: var(--pink); color: var(--white); }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--outline { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.card .btn:focus-visible { outline-color: var(--ink); }
.btn:disabled { opacity: 0.6; cursor: progress; }

@media (hover: hover) {
  .btn:hover { filter: brightness(0.94); }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Formulář ---------- */

.rsvp { margin-top: 48px; }
.rsvp .lead { margin: 12px 0 24px; }

.field {
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.field:first-child { margin-top: 0; }

.field__label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font: 800 14px/20px var(--font-text);
  color: var(--blush);
}

.input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--blush);
  color: var(--ink);
  font: 500 16px/1.4 var(--font-text);
  appearance: none;
}
.input::placeholder { color: var(--ink-muted); opacity: 1; }
.input--area {
  height: 96px;
  padding: 12px 16px;
  resize: none;
}
.input:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.input[aria-invalid="true"] { outline: 3px solid var(--pink); outline-offset: 3px; }
.input[aria-invalid="true"]:focus-visible { outline-color: var(--white); }
.input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 100px var(--blush) inset;
}
.input[type="number"] { -moz-appearance: textfield; }
.input::-webkit-inner-spin-button,
.input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.field__error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font: 800 14px/20px var(--font-text);
  color: var(--white);
}
.field__error::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pink);
}

/* Výběr odpovědi: radio skryté vizuálně, štítek vypadá jako tlačítko. */
.choices {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.choice {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.choice + .btn {
  background: var(--white);
  color: var(--ink);
  border-color: var(--ink);
}
.choice:checked + .btn {
  background: var(--pink);
  color: var(--white);
  border-color: var(--pink);
}
.choice:focus-visible + .btn { outline: 3px solid var(--white); outline-offset: 3px; }

/* Bez JS: „Nepřijdu“ schová počet osob (server stejně uloží 0). */
.rsvp-form:has(#st-no:checked) .field--guests { display: none; }

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit { margin-top: 24px; }

.hint {
  margin-top: 16px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--blush);
}

.notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--lime);
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}
.notice--error {
  margin: 20px 0 0;
  background: var(--blush);
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 800 16px/24px var(--font-text);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- Potvrzení ---------- */

.check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  margin-top: 32px;
  border-radius: 50%;
  background: var(--lime);
  stroke: var(--ink);
}

.confirmation .h1 { margin-top: 28px; }
.confirmation .h1:focus { outline: none; }

.summary { margin-top: 28px; }
.summary__list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 16px;
  line-height: 26px;
}
.summary__list dt { font-weight: 800; }
.summary__list dd { overflow-wrap: anywhere; }
.summary .btn-row { margin-top: 20px; }
.summary__hint {
  margin-top: 16px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-muted);
}
.summary__change { margin-top: 12px; }

/* ---------- Chybové a informační stránky ---------- */

.message .h1 { margin-top: 160px; }
.message ul { margin: 0; padding-left: 20px; }
.message .btn { margin-top: 32px; }

/* ---------- Konfety ---------- */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Animace (jen pokud je uživatel nevypnul) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .btn { transition: transform 120ms ease, filter 120ms ease; }
  .btn:active { transform: scale(0.97); }

  .cluster circle {
    transform-box: fill-box;
    transform-origin: center;
    animation: pop 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  .cluster circle:nth-child(2) { animation-delay: 90ms; }
  .cluster circle:nth-child(3) { animation-delay: 180ms; }
  .cluster circle:nth-child(4) { animation-delay: 270ms; }

  .hero__number { animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both; }

  .row-circles span {
    animation: pop 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }

  .confirmation:not([hidden]) .check { animation: pop 560ms cubic-bezier(0.34, 1.56, 0.64, 1) 80ms both; }
  .confirmation:not([hidden]) .check path {
    stroke-dasharray: 60;
    animation: draw 420ms ease-out 420ms both;
  }

  @keyframes pop {
    from { transform: scale(0); }
    to { transform: scale(1); }
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes draw {
    from { stroke-dashoffset: 60; }
    to { stroke-dashoffset: 0; }
  }
}
