/* =========================================================
   TEMPLATES BRIDAL CREATIVE · base comum
   Só o que funciona igual nos 5 templates (formulário, foto
   ampliada, aviso, botão de música). As cores e fontes vêm das
   variáveis que cada style.css define em :root:
   --ink --bg --accent --on-accent --line --f-serif --f-script
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* site travado nas laterais: flores e ramos que saem da tela são cortados
   e a página não escorrega para os lados no celular (iPhone incluído) */
html, body { overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; max-width: 100%; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; position: relative; -webkit-font-smoothing: antialiased; }
main, section, footer, header { max-width: 100vw; }
main > section, footer { overflow-x: clip; }
body.is-locked, body.menu-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, blockquote, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* revelar ao rolar (cada template pode trocar o movimento) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s cubic-bezier(.22,.7,.2,1) var(--d, 0s), transform 1.1s cubic-bezier(.22,.7,.2,1) var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- formulário ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; text-align: left; }
.field label, .field legend { font-size: .78em; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius, 0);
  background: rgba(255,255,255,.65); font-size: 16px; line-height: 1.4; color: var(--ink);
  transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field .is-invalid, .field input.is-invalid { border-color: #b3261e; box-shadow: 0 0 0 3px rgba(179,38,30,.12); }
.field--sub { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.field__count { font-size: .75em; opacity: .6; text-align: right; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0 0 18px; }
.choice legend { grid-column: 1 / -1; margin-bottom: 8px; font-size: .78em; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.choice label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius, 0); cursor: pointer; text-align: center; line-height: 1.25; transition: background .2s, color .2s, border-color .2s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice input:checked + span { font-weight: 600; }
.choice label:has(input:checked) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.form__error { min-height: 1.2em; margin: 0 0 12px; color: #b3261e; font-size: .9em; text-align: center; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading span::after { content: ''; display: inline-block; width: .9em; height: .9em; margin-left: .6em; vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- mural: recadinhos (como nos sites da Yasmin e da Gi) ----------
   Cartõezinhos de papel com um selo no topo, levemente tortos, passando
   sozinhos para o lado. Sem barra de rolagem aparente.
   Cada template pode trocar a cor do selo com --selo e o papel com --recado. */
.notes {
  display: flex; gap: 18px; min-width: 0;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 24px 6px 26px; scrollbar-width: none; -ms-overflow-style: none;
}
.notes::-webkit-scrollbar { display: none; }
.notes__empty { flex: 1 0 100%; padding: 40px 0; opacity: .7; font-style: italic; text-align: center; }
.note {
  position: relative; flex: 0 0 clamp(190px, 58vw, 230px); scroll-snap-align: start;
  margin: 0; padding: 30px 18px 16px;
  background: var(--recado, #FFFDF8); border: 1px solid var(--line);
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .45);
  transform: rotate(var(--r, 0deg)); text-align: center;
}
.note::before {
  content: ''; position: absolute; left: 50%; top: -13px; width: 28px; height: 28px; margin-left: -14px;
  border-radius: 48% 52% 50% 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--selo, var(--accent)) 60%, #fff) 0%, var(--selo, var(--accent)) 48%, color-mix(in srgb, var(--selo, var(--accent)) 60%, #000) 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35), inset 0 -2px 3px rgba(0, 0, 0, .3), inset 0 2px 2px rgba(255, 255, 255, .25);
}
.note blockquote { margin: 0; font-size: .9em; line-height: 1.6; overflow-wrap: anywhere; }
.note figcaption { margin-top: 10px; line-height: 1.3; }
.note.is-new { animation: recadoNovo .8s cubic-bezier(.22,.7,.2,1); }
@keyframes recadoNovo { from { opacity: 0; transform: translateY(-14px) rotate(0); } }
/* computador: 6 recados por vez (2 linhas × 3 colunas), passando coluna a coluna */
@media (min-width: 900px) {
  .notes { display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 18px) / 3); gap: 30px 18px; align-items: start; }
  .notes__empty { grid-column: span 3; grid-row: span 2; }
}

/* ---------- foto ampliada ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 56px 12px; background: rgba(12, 10, 10, .92); }
.lightbox figure { max-width: min(1100px, 100%); max-height: 100%; }
.lightbox img { max-height: calc(var(--app-h, 100vh) - 120px); width: auto; margin: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__nav--prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- aviso ---------- */
.toast { position: fixed; left: 50%; bottom: 92px; z-index: 210; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .35s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- música ---------- */
.music { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 150; display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid color-mix(in srgb, var(--on-accent) 35%, transparent); border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transition: opacity .6s, transform .2s; }
.is-revealed .music { opacity: 1; pointer-events: auto; }
.music:hover { transform: scale(1.06); }
.music svg { width: 22px; height: 22px; }
.music__bars { display: none; align-items: flex-end; gap: 3px; height: 18px; }
.music__bars i { width: 3px; height: 40%; background: currentColor; border-radius: 2px; animation: barra 1s ease-in-out infinite; }
.music__bars i:nth-child(2) { animation-delay: -.3s; } .music__bars i:nth-child(3) { animation-delay: -.6s; } .music__bars i:nth-child(4) { animation-delay: -.15s; }
.music.is-playing svg { display: none; }
.music.is-playing .music__bars { display: flex; }
@keyframes barra { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.yt { position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; left: -10px; bottom: 0; }

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