:root {
  --sea-900: #062e55;
  --sea-700: #0a4f8c;
  --sea-500: #1479c9;
  --sea-300: #6cc3f2;
  --sea-100: #e3f3fd;
  --orange: #ff8a1f;
  --orange-600: #e66d00;
  --purple: #7b3fd1;
  --purple-100: #f1e9fd;
  --lime: #b6e62e;
  --lime-700: #5f8a00;
  --ink: #12253a;
  --muted: #55677c;
  --line: #d6e1ec;
  --bg: #f4f8fc;
  --card: #ffffff;
  --danger: #c62828;
  --danger-bg: #fdecec;
  --ok: #1d7c3a;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(6, 46, 85, .10);
  --focus: 0 0 0 4px rgba(255, 138, 31, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 17px;
}
[hidden] { display: none !important; }
a { color: var(--sea-700); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Hero (flyer language: sky/sea blue, glossy purple + orange title, lime highlights) ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(255,255,255,.25), transparent 70%),
    linear-gradient(180deg, #2a8de0 0%, #1466c0 55%, var(--sea-700) 100%);
  padding: calc(12px + env(safe-area-inset-top)) 16px 60px;
}
.hero::after { /* soft wave edge */
  content: ""; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 46px;
  background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-inner { position: relative; z-index: 2; max-width: 560px; margin: 0 auto; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.logo { width: 60px; height: 60px; object-fit: contain; background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 3px 10px rgba(6,46,85,.3); }
.noscript { max-width: 560px; margin: 0 auto 12px; padding: 12px 16px; background: #fff4cc; border-radius: 12px; position: relative; z-index: 4; }
.cal-link, .another {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 18px; margin-top: 8px;
  border-radius: 14px; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
}
.cal-link { background: var(--sea-700); color: #fff; }
.another { display: flex; width: 100%; margin-top: 16px; background: transparent; border: 2px solid var(--line); color: var(--sea-700); }
.org-chip {
  display: inline-block; background: var(--lime); color: var(--sea-900);
  padding: 3px 16px; font-weight: 800; font-size: 17px; transform: rotate(-1.5deg);
  border-radius: 6px 14px 6px 14px; box-shadow: 0 3px 0 rgba(6,46,85,.25);
}
.hero h1 { margin: 8px 0 4px; line-height: .95; font-weight: 800; }
.hero h1 .t1 {
  font-size: clamp(44px, 13.5vw, 72px); letter-spacing: -1px;
  background: linear-gradient(180deg, #f6eeff 0%, #c9a8ff 38%, #ffb347 52%, var(--orange) 78%, #ff6a00 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(6,46,85,.45)) drop-shadow(0 0 1px #fff);
}
.tagline { margin: 6px 0 0; }
.tagline span {
  display: inline-block; background: #efe6ff; color: var(--sea-900); font-weight: 800; font-size: 17px;
  padding: 4px 14px; border-radius: 4px 12px 4px 12px; transform: rotate(1deg);
}
.smiley { position: absolute; top: 6px; left: 0; width: 46px; height: 46px; fill: none; stroke: var(--lime); stroke-width: 4; stroke-linecap: round; transform: rotate(-12deg); }

/* ---------- Layout ---------- */
.wrap { max-width: 560px; margin: -52px auto 0; padding: 0 16px 24px; position: relative; z-index: 3; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px; margin-bottom: 16px; border: 1px solid #e8eef5;
}
.muted { color: var(--muted); margin: 0 0 12px; }

/* Opening photo: always shown whole (width 100%, natural height) so no face is ever cropped */
.photo { position: relative; margin: 0 0 18px; }
.photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 1055 / 304;
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(6,46,85,.25); border: 3px solid #fff; background: var(--sea-300);
}
.sticker {
  position: absolute; left: 10px; bottom: -18px; transform: rotate(-8deg);
  background: var(--lime); color: var(--sea-900); font-weight: 700; font-size: 12px; line-height: 1.05; text-align: center;
  padding: 7px 10px; border-radius: 14px; box-shadow: 0 4px 10px rgba(6,46,85,.25); border: 2px solid #fff;
}
.sticker b { font-size: 17px; font-weight: 800; }

/* Details */
.details { padding-top: 12px; padding-bottom: 14px; }
.date-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.date-big { font-size: clamp(30px, 9vw, 42px); font-weight: 800; color: var(--sea-900); letter-spacing: -.5px; line-height: 1.1; direction: ltr; }
.weekday { color: var(--muted); font-weight: 500; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.pill { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 16px; padding: 6px 8px; font-size: 13.5px; line-height: 1.25; text-align: center; }
.pill b { font-size: 22px; font-weight: 800; order: 2; }
.pill span { order: 1; }
.pill-open { background: var(--sea-100); color: var(--sea-900); border: 2px solid #c9e6fa; }
.pill-candles { background: linear-gradient(90deg, var(--purple), #9b5cf0); color: #fff; box-shadow: 0 0 0 3px #e3d6fb; }

.place {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px;
}
.place[href]:active { background: var(--sea-100); }
.place svg { flex: none; width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--lime); fill: none; stroke: var(--sea-900); stroke-width: 2.2; stroke-linejoin: round; }
.place b { display: block; font-size: 17px; }
.place small { color: var(--sea-700); font-size: 13px; }
.chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 13.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.chip-blue { background: var(--sea-100); color: var(--sea-700); }
.chip-orange { background: var(--orange); color: #fff; }
.chip-lime { background: var(--lime); color: var(--sea-900); }
.contact { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 15px; }
.contact a { font-weight: 700; text-decoration: none; white-space: nowrap; }

/* Full flyer (collapsed by default) – shown whole with object-fit: contain */
.flyer { margin: 0 0 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.flyer summary { cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--sea-700); }
.flyer img { display: block; width: 100%; height: auto; object-fit: contain; background: var(--sea-900); }

/* ---------- Form ---------- */
.form-card h2 { margin: 0 0 4px; font-size: 26px; color: var(--sea-900); }
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 700; margin-bottom: 6px; font-size: 17px; padding: 0; }
input[type=text], input[type=tel], input[type=number] {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 18px;
  transition: border-color .15s;
}
input[type=tel] { text-align: right; }
input:focus { border-color: var(--sea-500); }
input[aria-invalid=true] { border-color: var(--danger); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
#countHint { margin: -2px 0 8px; }
.err { margin: 6px 0 0; color: var(--danger); font-size: 15px; font-weight: 500; min-height: 0; }
.err:empty { display: none; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; margin: 0; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; padding: 10px; border-radius: 14px; border: 2px solid var(--line);
  font-weight: 700; background: #fff; transition: all .15s;
}
.opt input:focus-visible + span { box-shadow: var(--focus); }
.opt-yes input:checked + span { background: var(--sea-700); border-color: var(--sea-700); color: #fff; }
.opt-no input:checked + span { background: var(--purple-100); border-color: var(--purple); color: var(--purple); }

.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; max-width: 260px; }
.stepper input { text-align: center; font-weight: 800; font-size: 22px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step {
  border: 0; border-radius: 14px; background: var(--sea-100); color: var(--sea-700);
  font-size: 28px; font-weight: 700; min-height: 52px; cursor: pointer;
}
.step:active { background: var(--sea-300); }

.consents { margin: 4px 0 18px; padding: 14px; background: #f7fafd; border-radius: 14px; border: 1px solid var(--line); }
.consents.dim { opacity: .85; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 15.5px; margin: 0 0 10px; cursor: pointer; }
.check:last-child { margin-bottom: 0; }
.check input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--sea-700); cursor: pointer; }
.consents .err { margin: -4px 36px 10px 0; }

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

.alert { background: var(--danger-bg); color: var(--danger); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-weight: 500; }

.btn-primary {
  width: 100%; min-height: 58px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, #ff9a3c, var(--orange-600));
  color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .3px;
  box-shadow: 0 6px 0 #b85600, 0 10px 20px rgba(230,109,0,.25);
  transition: transform .06s, box-shadow .06s, opacity .2s;
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #b85600; }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-primary.loading::before {
  content: ""; display: inline-block; width: 18px; height: 18px; margin-left: 10px; vertical-align: -3px;
  border: 3px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Result ---------- */
.result { text-align: center; padding: 28px 20px; outline: none; }
.result h2 { margin: 8px 0 16px; font-size: 24px; color: var(--sea-900); line-height: 1.3; }
.badge-ok { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--lime); box-shadow: 0 0 0 10px #f2fbd9; }
.badge-ok svg { width: 40px; height: 40px; fill: none; stroke: var(--sea-900); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.badge-purple { background: var(--purple-100); box-shadow: 0 0 0 10px #f8f3ff; }
.badge-purple svg { stroke: var(--purple); }
.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 14px; }
.summary div { background: var(--sea-100); border-radius: 14px; padding: 10px; }
.summary div:first-child { background: #fff1e3; }
.summary dt { font-size: 13px; color: var(--muted); }
.summary dd { margin: 0; font-size: 22px; font-weight: 800; color: var(--sea-900); }
.summary .wide { grid-column: 1 / -1; background: #f2fbd9; }
.summary .wide dd { font-size: 19px; }
.alert .retry { display: block; margin-top: 10px; min-height: 44px; padding: 8px 18px; border: 0; border-radius: 12px; background: var(--danger); color: #fff; font-weight: 700; cursor: pointer; }

.jump {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #ff9a3c, var(--orange-600)); color: #fff; text-decoration: none; font-weight: 800; font-size: 17px;
  padding: 11px 26px; border-radius: 999px; box-shadow: 0 6px 18px rgba(230,109,0,.4); white-space: nowrap;
}
.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }

@media (min-width: 640px) {
  .hero { padding-top: 28px; padding-bottom: 72px; }
  .card { padding: 26px; }
  .smiley { width: 60px; height: 60px; }
}
@media (max-width: 360px) {
  .choice { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
