/* ═══════════════════════════════════════════════
   Telas do convidado: /fotos e /album (seção 7.0)
   Mesmos tokens do style.css do convite.
   ═══════════════════════════════════════════════ */

:root {
  --pink: #D4557B;
  --pink-dark: #B8395F;
  --pink-soft: #F5C6D0;
  --pink-bg: #FEF0F3;
  --gold: #C8946B;
  --gold-dark: #A67B55;
  --cream: #FDF3D0;
  --cream-light: #FFF8E5;
  --paper-inner: #FDF5E2;
  --white: #FFFFFF;
  --text-dark: #3D2B2B;
  --text-medium: #6B5050;
  --text-light: #8E7070;
  --ok: #4E8A5B;
  --warn: #B26B1E;

  --font-display: 'Great Vibes', cursive;
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Raleway', sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 2px 20px rgba(212, 85, 123, 0.08);
  --shadow-card: 0 4px 30px rgba(212, 85, 123, 0.1);
  --shadow-button: 0 8px 24px rgba(184, 57, 95, 0.28);
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --page-pad: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

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

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: var(--cream-light);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Papel envelhecido, versão leve da home */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 320px 240px at 4% 4%, rgba(225, 195, 110, 0.28) 0%, transparent 70%),
    radial-gradient(ellipse 300px 220px at 96% 6%, rgba(230, 200, 120, 0.24) 0%, transparent 70%),
    radial-gradient(ellipse 320px 220px at 94% 94%, rgba(220, 185, 100, 0.3) 0%, transparent 65%),
    radial-gradient(ellipse 300px 200px at 6% 92%, rgba(215, 180, 95, 0.26) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(255, 255, 248, 0.5) 0%, transparent 70%),
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 55%, rgba(200, 170, 80, 0.1) 100%);
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.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;
}

.icon {
  width: 1.2em; height: 1.2em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.2em;
}
[data-icon] { display: inline-flex; }

/* ── Ornamentos: flores pequenas nos cantos superiores ── */
/* As imagens já trazem a flor encostada na borda: sem deslocamento */
.corner { position: absolute; top: 0; z-index: 0; pointer-events: none; opacity: 0.95; }
.corner img { width: 46vw; max-width: 220px; height: auto; }
.corner-left { left: 0; }
.corner-right { right: 0; }
@media (min-width: 600px) { .corner img { max-width: 300px; } }

/* ── Página ── */
.page {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px var(--page-pad) calc(40px + env(safe-area-inset-bottom));
}

.hero { text-align: center; padding-top: 8px; margin-bottom: 24px; }
.brasao { width: 120px; height: auto; margin: 0 auto 4px; }
.script-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.1;
  color: var(--pink-dark);
}
.script-medium { font-size: 44px; }
.hero-subtitle {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.25;
  margin-top: 4px;
}
.hero-greeting {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 20px;
  color: var(--text-medium);
  margin-top: 8px;
}

.state { text-align: center; }
.state-title { font-family: var(--font-heading); font-weight: 500; font-size: 26px; margin-bottom: 12px; }

.hint { font-size: 15px; color: var(--text-medium); margin-top: 10px; }
.hint-warn { color: var(--warn); }

/* ── Botões ── */
.btn-main {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 64px; padding: 14px 24px;
  border-radius: var(--radius-md);
  background: var(--pink-dark);
  color: var(--white);
  font-family: var(--font-body); font-weight: 600; font-size: 20px; letter-spacing: 0.02em;
  box-shadow: var(--shadow-button);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn-main .icon { width: 28px; height: 28px; }
.btn-main:active { transform: scale(0.98); box-shadow: 0 4px 12px rgba(184, 57, 95, 0.25); }
.btn-main:focus-visible, .btn-outline:focus-visible, .challenge:focus-visible, .link-row:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 3px;
}
.btn-main[disabled] { opacity: 0.6; }

.btn-outline {
  min-height: 48px; padding: 10px 20px;
  border: 2px solid var(--pink-dark); border-radius: var(--radius-md);
  color: var(--pink-dark); font-weight: 600; font-size: 16px;
  background: rgba(255, 255, 255, 0.6);
}
.btn-outline[disabled] { opacity: 0.5; }

.btn-link {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 8px;
  color: var(--pink-dark); font-weight: 600; font-size: 15px;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ── Blocos e filete dourado ── */
.block { margin-top: 32px; text-align: left; }
.divider-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-heading); font-weight: 600; font-size: 20px;
  color: var(--gold-dark); margin-bottom: 14px;
}
.divider-title::before, .divider-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ── Desafios ── */
/* Até 3 desafios cabem lado a lado; com 4 ou 5, rolagem lateral */
.challenges {
  display: flex; gap: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--page-pad)); padding: 12px var(--page-pad) 8px;
  scrollbar-width: none;
}
.challenges::-webkit-scrollbar { display: none; }
.challenge {
  position: relative; flex: 1 0 100px; min-width: 100px; max-width: 160px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: 140px; padding: 16px 8px 14px;
  border: 1px solid rgba(200, 148, 107, 0.4); border-radius: var(--radius-md);
  background: var(--paper-inner); box-shadow: var(--shadow-soft);
  font-size: 14px; font-weight: 500; line-height: 1.3; text-align: center; color: var(--text-dark);
  transition: transform var(--transition);
}
.challenges .challenge:only-child { max-width: none; }
@media (min-width: 420px) { .challenge { font-size: 15px; } }
.challenge .icon { width: 36px; height: 36px; color: var(--pink); stroke-width: 1.5; }
.challenge:active { transform: scale(0.97); }
.challenge.done { border-color: var(--gold); background: #FFF6E0; }
.challenge.done::after {
  content: '✓ Cumprido!'; position: absolute; top: -10px; right: 8px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--gold); color: var(--white); font-size: 12px; font-weight: 600;
}

/* ── Campos ── */
.field { display: block; margin-top: 28px; text-align: left; }
.field-label { display: block; font-family: var(--font-heading); font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 1px solid rgba(200, 148, 107, 0.55); border-radius: var(--radius-sm);
  background: var(--white); font-size: 18px;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(212, 85, 123, 0.15); }

/* ── Wi-Fi ── */
.wifi {
  margin-top: 20px; padding: 0 16px;
  border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(200, 148, 107, 0.35); text-align: left; font-size: 16px;
}
.wifi summary {
  display: flex; align-items: center; gap: 8px; min-height: 52px;
  font-weight: 600; cursor: pointer; list-style: none;
}
.wifi summary::-webkit-details-marker { display: none; }
.wifi summary::after { content: '▾'; margin-left: auto; color: var(--gold-dark); }
.wifi[open] summary::after { content: '▴'; }
.wifi p { padding-bottom: 8px; }
.wifi-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

.consent { margin-top: 20px; font-size: 13px; color: var(--text-light); line-height: 1.45; }

/* ── Enviando ── */
.progress { height: 6px; border-radius: 999px; background: rgba(212, 85, 123, 0.15); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--pink); transition: width var(--transition); }
.status-banner {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--paper-inner); border: 1px solid rgba(200, 148, 107, 0.45);
  font-size: 16px; color: var(--text-medium);
}
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--paper-inner) center / cover no-repeat;
  border: 1px solid rgba(200, 148, 107, 0.3);
}
@supports not (aspect-ratio: 1 / 1) { .thumb { height: 0; padding-bottom: 100%; } }
.thumb-badge {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(61, 43, 43, 0.25); color: var(--white);
}
.thumb-badge .icon { width: 34px; height: 34px; stroke-width: 2.5; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.thumb[data-status="done"] .thumb-badge, .thumb[data-status="duplicate"] .thumb-badge { background: rgba(78, 138, 91, 0.35); }
.thumb[data-status="waiting"] .thumb-badge { background: rgba(255, 248, 229, 0.35); }
.thumb[data-status="failed"] .thumb-badge { background: rgba(178, 107, 30, 0.55); flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.thumb-ring { width: 40px; height: 40px; }
.thumb-ring circle { fill: none; stroke-width: 4; }
.thumb-ring .ring-bg { stroke: rgba(255, 255, 255, 0.45); }
.thumb-ring .ring-fg { stroke: var(--white); stroke-linecap: round; transition: stroke-dashoffset 200ms linear; }
.thumb-label {
  position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.55); color: var(--white); font-size: 12px; font-weight: 600;
}
.thumb-name { position: absolute; inset: auto 4px 4px; font-size: 11px; color: var(--text-medium); word-break: break-all; }
.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Obrigada ── */
.state-thanks { position: relative; }
.state-thanks .btn-main { margin-top: 28px; }
.message-form { margin-top: 8px; }
.message-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.counter { font-size: 13px; color: var(--text-light); }
.message-done { margin-top: 20px; font-family: var(--font-heading); font-size: 22px; color: var(--pink-dark); }

.petals { position: absolute; inset: -40px 0 auto; height: 260px; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -20px; width: 14px; height: 10px;
  border-radius: 70% 0 70% 0; background: var(--pink-soft); opacity: 0.9;
  animation: fall 2.2s ease-in forwards;
}
.petal:nth-child(3n) { background: #F2D7B4; }
@keyframes fall {
  to { transform: translate(var(--dx, 20px), 260px) rotate(320deg); opacity: 0; }
}

.mine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mine-item { display: flex; flex-direction: column; gap: 4px; }
.mine-item .thumb { width: 100%; }
.mine-remove { min-height: 40px; font-size: 14px; color: var(--pink-dark); font-weight: 600; text-decoration: underline; }

/* ── Encerrado ── */
.closed-text { font-family: var(--font-heading); font-size: 24px; line-height: 1.35; padding: 24px 8px; }

/* ── Mini-grade (6 mais recentes) ── */
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mini-grid a { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--paper-inner); }
@supports not (aspect-ratio: 1 / 1) { .mini-grid a { height: 0; padding-bottom: 100%; } }
.mini-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ── Links do rodapé ── */
.links { margin-top: 36px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 4px; border-bottom: 1px solid rgba(200, 148, 107, 0.3);
  font-size: 17px; color: var(--text-dark);
}
.link-row span { display: inline-flex; align-items: center; gap: 8px; }
.link-row .icon { color: var(--gold-dark); }
.link-strong { font-weight: 600; color: var(--pink-dark); }
.link-strong .icon { color: var(--pink-dark); }
.social, .help { font-size: 15px; color: var(--text-medium); padding: 14px 4px 0; }
.social strong { color: var(--pink-dark); font-weight: 600; white-space: nowrap; }

/* ── Avisos ── */
.inapp-banner {
  position: relative; z-index: 2; padding: 10px 16px;
  background: var(--paper-inner); border-bottom: 1px solid rgba(200, 148, 107, 0.45);
  font-size: 15px; text-align: center;
}
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--text-dark); color: var(--white); font-size: 16px; text-align: center;
  transform: translate(-50%, 140%); opacity: 0; transition: transform var(--transition), opacity var(--transition);
  pointer-events: none;
}
.toast-show { transform: translate(-50%, 0); opacity: 1; }
.toast-error { background: var(--pink-dark); }
.noscript { position: relative; z-index: 2; padding: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .petals { display: none; }
}
