/* Shubh Labh Moments. One stylesheet for the attendee, gallery and privacy
   pages. Strict CSP: every style lives here, none inline. */

:root {
  color-scheme: light;
  --bg: #fbfaff;
  --lavender: #f3f0fb;
  --lavender-deep: #e8e2f8;
  --surface: #ffffff;
  --ink: #1e1b2e;
  --ink-soft: #3b3750;
  --muted: #5e5a72;
  --line: #e6e2f2;
  --coral: #f0505a;
  --coral-strong: #d63a45;
  --coral-text: #c9323d;
  --coral-wash: #fff0f0;
  --whatsapp: #25d366;
  --whatsapp-ink: #0b2e1a;
  --success: #1c7a4a;
  --radius: 20px;
  --radius-small: 12px;
  --shadow: 0 1px 2px rgba(30, 27, 46, 0.04), 0 8px 28px rgba(30, 27, 46, 0.07);
  --focus: 0 0 0 3px #ffffff, 0 0 0 6px var(--coral-strong);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Pages show and hide parts with the "hidden" attribute. Any rule below that
   sets "display" would otherwise win over the browser's own style for it. */
[hidden] { display: none !important; }

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 100% 0%, #fde8ea 0%, rgba(253, 232, 234, 0) 55%),
    radial-gradient(90% 50% at 0% 10%, var(--lavender) 0%, rgba(243, 240, 251, 0) 60%),
    var(--bg);
  background-repeat: no-repeat;
  font: 17px/1.5 var(--font);
}

img { max-width: 100%; }
a { color: var(--coral-text); text-underline-offset: 3px; }
strong { font-weight: 650; }
.nowrap { white-space: nowrap; }

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

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

/* ---------- Header and footer ---------- */

.site-header, main, .site-footer {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-top: 14px;
  padding-bottom: 6px;
}

.brand { display: flex; align-items: center; min-width: 0; }
.summit-logo { display: block; height: 40px; width: auto; }
.favcy-logo { display: block; height: 26px; width: auto; flex: none; }

.wordmark {
  display: flex;
  flex-direction: column;
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--coral-text);
}

.wordmark span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

main { flex: 1 0 auto; padding-top: 8px; padding-bottom: 32px; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  padding-top: 8px;
  padding-bottom: 24px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); }
.site-footer .sep { align-self: center; }
@media (max-width: 560px) { .site-footer { flex-direction: column; align-items: center; } .site-footer .sep { display: none; } }

/* ---------- Type ---------- */

h1, h2 { margin: 0; letter-spacing: -0.015em; }

.step-title {
  margin-bottom: 8px;
  font-size: 1.65rem;
  line-height: 1.2;
  font-weight: 800;
}

.hero-title {
  margin-bottom: 12px;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 800;
}

.lead { margin: 0 0 16px; color: var(--ink-soft); }
.muted, .hint, .fine { color: var(--muted); }
.fine { margin: 10px 0 0; font-size: 0.88rem; }
.center { text-align: center; }
.center-text { text-align: center; }
.block { display: block; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral-text);
}

.count { color: var(--coral); font-variant-numeric: tabular-nums; }

/* ---------- Surfaces ---------- */

.step { animation: rise 0.35s ease-out both; }

.panel, .help-card {
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel.center .spinner { margin: 6px auto 16px; }
.center .guide-icon { margin-left: auto; margin-right: auto; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 32px 22px 24px;
  background: linear-gradient(160deg, #ffffff 0%, var(--lavender) 60%, #fde6e8 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero > * { position: relative; }

.note {
  margin: 14px 0;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  background: var(--lavender);
  border-radius: var(--radius-small);
}

.note strong { display: block; margin-bottom: 2px; color: var(--ink); }

.stack > * + * { margin-top: 18px; }

.actions { display: grid; gap: 10px; margin-top: 18px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-block { display: flex; width: 100%; }
.btn-large { min-height: 56px; font-size: 1.06rem; }

.btn-primary {
  color: #ffffff;
  background: var(--coral-strong);
  border-color: var(--coral-strong);
  box-shadow: 0 6px 18px rgba(214, 58, 69, 0.28);
}

.btn-primary:hover:not(:disabled) { background: var(--coral-text); }

.btn-secondary { border-color: var(--lavender-deep); background: var(--surface); }
.btn-secondary:hover:not(:disabled) { background: var(--lavender); }

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  font-weight: 600;
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-whatsapp {
  color: var(--whatsapp-ink);
  background: var(--whatsapp);
  border-color: var(--whatsapp);
  font-weight: 750;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.32);
}

.btn-whatsapp:hover:not(:disabled) { background: #3ddc78; }
.btn-whatsapp:disabled { color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.24); opacity: 1; }

.wa-icon {
  width: 24px;
  height: 24px;
  flex: none;
  background: url("/static/brand/whatsapp.svg") center / contain no-repeat;
}

.btn-whatsapp:disabled .wa-icon { opacity: 0.7; }

/* ---------- Spinner ---------- */

.spinner {
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--lavender-deep);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.spinner.light { border-color: rgba(255, 255, 255, 0.3); border-top-color: #ffffff; }

/* ---------- Welcome sparkles ---------- */

.sparkles i {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--coral);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0.85;
  animation: twinkle 3.2s ease-in-out infinite;
}

.sparkles i:nth-child(1) { top: 22px; right: 26px; width: 22px; height: 22px; }
.sparkles i:nth-child(2) { top: 64px; right: 70px; width: 10px; height: 10px; background: #8b7bd8; animation-delay: 0.6s; }
.sparkles i:nth-child(3) { top: 18px; right: 110px; width: 8px; height: 8px; background: #f7a23b; animation-delay: 1.2s; }
.sparkles i:nth-child(4) { bottom: 110px; right: 18px; width: 12px; height: 12px; background: #8b7bd8; animation-delay: 1.8s; }
.sparkles i:nth-child(5) { bottom: 32px; left: 14px; width: 9px; height: 9px; animation-delay: 0.9s; }

/* ---------- Instruction cards ---------- */

.cards {
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 6px 16px 26px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.cards::-webkit-scrollbar { display: none; }

.guide-card {
  flex: 0 0 100%;
  min-height: 430px;
  padding: 26px 22px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.guide-card h2 { margin-bottom: 12px; font-size: 1.42rem; line-height: 1.22; font-weight: 800; }
.guide-card p { margin: 0 0 12px; }

.guide-icon {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 18px;
  background-color: var(--coral-wash);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 30px;
}

.icon-shield { background-image: url("/static/brand/icon-shield.svg"); }
.icon-face { background-image: url("/static/brand/icon-face.svg"); }
.icon-mail { background-image: url("/static/brand/icon-mail.svg"); }

.tips { margin: 0 0 14px; padding: 0; list-style: none; }

.tips li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 30px;
}

.tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--coral-wash) url("/static/brand/icon-check.svg") center / 12px no-repeat;
}

.dots { display: flex; justify-content: center; gap: 4px; margin-top: -8px; }

.dot {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--lavender-deep);
  border-radius: 999px;
  transition: width 0.2s ease, margin 0.2s ease, background-color 0.2s ease;
}

.dot[aria-current="true"]::before { width: 26px; margin-left: -13px; background: var(--coral); }

/* ---------- Selfie ---------- */

.frame {
  position: relative;
  width: min(100%, 340px, 54vh * 0.75);
  aspect-ratio: 3 / 4;
  margin: 4px auto 0;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2640, var(--ink));
  border-radius: 32px;
  box-shadow: 0 14px 40px rgba(30, 27, 46, 0.22);
}

.frame video, .frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame video, .frame img.mirrored { transform: scaleX(-1); }

.guide-oval { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.oval-shade { fill: rgba(20, 17, 34, 0.38); }

.oval-line {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-dasharray: 10 8;
  stroke-linecap: round;
  opacity: 0.95;
}

.frame.is-blocked .oval-line { opacity: 0.35; }

.frame-message, .frame-busy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #ffffff;
  font-weight: 600;
  text-align: center;
}

.frame.is-blocked .spinner { display: none; }
.frame-busy { background: rgba(20, 17, 34, 0.62); }

.capture-controls { display: flex; justify-content: center; margin-top: 18px; }

.shutter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
}

.shutter-ring {
  display: block;
  width: 78px;
  height: 78px;
  border: 5px solid var(--coral);
  border-radius: 50%;
  background: var(--coral-strong);
  box-shadow: inset 0 0 0 4px #ffffff, 0 8px 22px rgba(214, 58, 69, 0.35);
  transition: transform 0.12s ease;
}

.shutter:active:not(:disabled) .shutter-ring { transform: scale(0.92); }
.shutter:disabled { opacity: 0.45; cursor: not-allowed; }

.consent-line {
  max-width: 340px;
  margin: 14px auto 0;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

.help-card { margin-top: 16px; }
.help-card h2 { margin-bottom: 8px; font-size: 1.2rem; }
.help-card > p { margin: 0 0 12px; color: var(--ink-soft); }
.help-card .btn { margin-top: 10px; }
.help-card .note .btn { margin-top: 10px; }

.link-box {
  display: block;
  margin: 8px 0 0;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  user-select: all;
}

/* ---------- Result ---------- */

.found { margin-bottom: 16px; }
.found .step-title { font-size: 1.9rem; }
.found .count { font-size: 1.15em; }
.found .note { margin-top: 0; }

/* ---------- Form ---------- */

.field label, .field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
}

.optional { font-weight: 500; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-small);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

textarea { min-height: 96px; resize: vertical; }

input:focus, textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--coral-strong);
  box-shadow: 0 0 0 4px rgba(240, 80, 90, 0.16);
}

[aria-invalid="true"] { border-color: var(--coral-strong); background: var(--coral-wash); }

.phone { display: flex; gap: 8px; }
.phone input:first-child { flex: 0 0 76px; text-align: center; }
.phone input:last-child { flex: 1 1 auto; min-width: 0; letter-spacing: 0.02em; }

.hint { margin: 6px 0 0; font-size: 0.86rem; }
.counter { text-align: right; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--coral-text); font-weight: 650; }

.field-error, .form-error {
  margin: 6px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--coral-text);
}

.form-error {
  padding: 10px 12px;
  background: var(--coral-wash);
  border-radius: 10px;
}

.check {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-small);
}

.check input {
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  accent-color: var(--coral-strong);
}

.check label { font-size: 0.93rem; line-height: 1.45; }
.check .hint { margin-top: 2px; }
.check + .field-error { margin-top: 6px; }
.check:has(input[aria-invalid="true"]) { border-color: var(--coral-strong); background: var(--coral-wash); }

/* ---------- Previews ---------- */

.summary-pill {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--coral-text);
  background: var(--coral-wash);
  border-radius: 999px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--lavender);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.preview-badge {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 5px 4px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  text-align: center;
  background: rgba(20, 17, 34, 0.62);
  border-radius: 999px;
}

.preview.is-removed img { filter: grayscale(1); opacity: 0.35; }
.preview.is-removed { outline: 2px dashed var(--coral-strong); outline-offset: -2px; }
.preview.is-removed .preview-badge { background: var(--coral-strong); }

.sticky-actions {
  position: sticky;
  bottom: 0;
  margin: 14px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(251, 250, 255, 0), var(--bg) 30%);
}

/* ---------- Success ---------- */

.celebrate { position: relative; padding: 20px 4px 8px; text-align: center; }
.celebrate .lead { margin-bottom: 4px; }

.done-mark {
  display: block;
  width: 84px;
  height: 84px;
  margin: 6px auto 18px;
  border-radius: 50%;
  background: var(--coral-strong) url("/static/brand/icon-check-white.svg") center / 40px no-repeat;
  box-shadow: 0 0 0 10px var(--coral-wash), 0 12px 30px rgba(214, 58, 69, 0.35);
  animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: var(--coral);
  opacity: 0;
  animation: fall 1.8s ease-in 0.15s 1 both;
}

.confetti i:nth-child(2n) { background: #8b7bd8; }
.confetti i:nth-child(3n) { background: #f7a23b; width: 10px; height: 10px; border-radius: 50%; }
.confetti i:nth-child(1) { left: 8%; animation-delay: 0.1s; }
.confetti i:nth-child(2) { left: 20%; animation-delay: 0.35s; }
.confetti i:nth-child(3) { left: 32%; animation-delay: 0.2s; }
.confetti i:nth-child(4) { left: 46%; animation-delay: 0.5s; }
.confetti i:nth-child(5) { left: 58%; animation-delay: 0.15s; }
.confetti i:nth-child(6) { left: 70%; animation-delay: 0.4s; }
.confetti i:nth-child(7) { left: 82%; animation-delay: 0.25s; }
.confetti i:nth-child(8) { left: 92%; animation-delay: 0.55s; }

.invite {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  padding: 28px 22px 24px;
  color: #ffffff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(240, 80, 90, 0.55) 0%, rgba(240, 80, 90, 0) 60%),
    radial-gradient(100% 70% at 0% 100%, rgba(139, 123, 216, 0.5) 0%, rgba(139, 123, 216, 0) 60%),
    var(--ink);
  border-radius: 28px;
  box-shadow: 0 18px 44px rgba(30, 27, 46, 0.28);
}

.invite::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 20px;
  width: 30px;
  height: 30px;
  background: #ffd6d9;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.invite-eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffc2c6;
}

.invite h2 {
  margin-bottom: 10px;
  padding-right: 34px;
  font-size: 1.7rem;
  line-height: 1.16;
  font-weight: 800;
}

.invite p { margin: 0 0 14px; color: rgba(255, 255, 255, 0.86); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }

.chips li {
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.invite-soon { margin: 10px 0 0 !important; font-size: 0.9rem; text-align: center; }

/* ---------- Gallery page ---------- */

.gallery-hero { margin: 6px 0 18px; }
.gallery-hero .step-title { font-size: 1.75rem; }
.gallery-hero .lead { margin-bottom: 0; }

.toolbar { display: grid; gap: 10px; margin-bottom: 16px; }

.save-progress {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.save-progress p { margin: 0 0 10px; font-weight: 600; }

progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  appearance: none;
  background: var(--lavender);
  border: 0;
  border-radius: 999px;
}

progress::-webkit-progress-bar { background: var(--lavender); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--coral); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--coral); border-radius: 999px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 -8px;
}

.photo {
  display: block;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--lavender);
  border: 0;
  border-radius: 6px;
  cursor: zoom-in;
}

.photo { position: relative; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.photo-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}

.not-me {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-height: 28px;
  padding: 4px 9px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(20, 17, 34, 0.62);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.not-me.is-armed { background: var(--coral-strong); }

.help-line { margin: 16px 0 0; font-size: 0.92rem; color: var(--muted); text-align: center; }

/* A photo still being prepared: a soft shimmer instead of a broken image. */
.photo.is-loading,
.preview.is-loading {
  background: linear-gradient(100deg, var(--lavender) 30%, var(--lavender-deep) 50%, var(--lavender) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.photo.is-loading img,
.photo.is-failed img,
.preview.is-loading img,
.preview.is-failed img,
.viewer-stage.is-loading img,
.viewer-stage.is-failed img { visibility: hidden; }

.photo-note {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.photo.is-failed .photo-note { display: flex; }

.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  color: #ffffff;
  background: #0d0b14;
  border: 0;
}

.viewer::backdrop { background: #0d0b14; }

.viewer-inner {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
}

.viewer-bar.bottom { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.viewer-count { font-weight: 650; font-variant-numeric: tabular-nums; }

.viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
}

.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-loading { position: absolute; top: 50%; left: 50%; margin: -18px 0 0 -18px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.icon-btn:disabled { opacity: 0.3; cursor: default; }
.viewer .btn-primary { flex: 1 1 auto; max-width: 260px; box-shadow: none; }
.viewer-status { min-height: 1.4em; margin: 0; padding: 0 16px; font-size: 0.9rem; text-align: center; color: rgba(255, 255, 255, 0.8); }

.manage-section + .manage-section { margin-top: 16px; }
.manage-section h2 { margin-bottom: 8px; font-size: 1.2rem; }
.manage-section p { margin: 0 0 12px; color: var(--ink-soft); }
.manage-section ul { margin: 0 0 14px; padding-left: 20px; color: var(--ink-soft); }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  font-weight: 650;
  cursor: pointer;
}

.switch input {
  position: relative;
  flex: none;
  width: 54px;
  height: 32px;
  margin: 0;
  appearance: none;
  background: var(--lavender-deep);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(30, 27, 46, 0.3);
  transition: transform 0.2s ease;
}

.switch input:checked { background: var(--coral-strong); }
.switch input:checked::after { transform: translateX(22px); }
.switch input:focus-visible { box-shadow: var(--focus); }

.saved-note { min-height: 1.4em; margin: 6px 0 0 !important; font-size: 0.88rem; color: var(--success) !important; font-weight: 600; }

.btn-danger { color: #ffffff; background: #b4232f; border-color: #b4232f; }
.btn-danger:hover:not(:disabled) { background: #9a1d28; }
.danger-text { color: #b4232f; }

.confirm-box {
  margin-top: 12px;
  padding: 16px;
  background: var(--coral-wash);
  border: 1.5px solid #f6c3c7;
  border-radius: var(--radius-small);
}

.confirm-box p { color: var(--ink); }
.confirm-box .actions { margin-top: 12px; }

.gallery-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 24px; }
.gallery-footer-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* ---------- Privacy page ---------- */

.prose h1 { margin-bottom: 6px; font-size: 1.9rem; line-height: 1.2; font-weight: 800; }
.prose h2 { margin: 26px 0 8px; font-size: 1.15rem; font-weight: 750; color: var(--ink); }
.prose p, .prose li { color: var(--ink-soft); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose .updated { font-size: 0.88rem; color: var(--muted); }

/* ---------- Email code and finding ---------- */

.code-input {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.45em;
  text-align: center;
}

.finding { padding-top: 40px; padding-bottom: 40px; }

.finding-stack {
  position: relative;
  display: block;
  width: 120px;
  height: 96px;
  margin: 0 auto 22px;
}

.finding-stack i {
  position: absolute;
  top: 8px;
  left: 22px;
  width: 76px;
  height: 76px;
  background: var(--surface);
  border: 6px solid #ffffff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: shuffle 1.6s ease-in-out infinite;
}

.finding-stack i:nth-child(1) { --tilt: -10deg; --shift: -18px; background: var(--lavender-deep); }
.finding-stack i:nth-child(2) { --tilt: 8deg; --shift: 18px; background: var(--coral-wash); animation-delay: 0.2s; }
.finding-stack i:nth-child(3) { --tilt: 0deg; --shift: 0; background: var(--coral); animation-delay: 0.4s; }

/* ---------- Motion ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shuffle {
  0%, 100% { transform: translateX(0) rotate(var(--tilt)); }
  50% { transform: translateX(var(--shift)) rotate(calc(var(--tilt) * -1)); }
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; } 50% { transform: scale(0.6) rotate(25deg); opacity: 0.4; } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fall {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(320px) rotate(300deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .confetti { display: none; }
}

/* ---------- Larger screens ---------- */

@media (min-width: 720px) {
  .site-header { padding-top: 22px; }
  main.wide, .site-footer.wide { max-width: 1040px; }
  .site-header.wide { max-width: 1040px; }
  .hero { padding: 44px 40px 32px; }
  .hero-title { font-size: 2.5rem; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 0; }
  .toolbar { grid-template-columns: auto auto; justify-content: start; }
}

@media (max-width: 360px) {
  .hero-title { font-size: 1.7rem; }
  .step-title { font-size: 1.45rem; }
  .favcy-logo { height: 22px; }
}
