/* ClipTogether — estilo "Estendal". Regras completas em DESIGN.md */
:root {
  --sky: #EEF4FB;        /* fundo */
  --card: #FFFFFF;       /* cartões, inputs, moldura dos vídeos */
  --anil: #1B3A8C;       /* texto, botões principais, fio do estendal */
  --anil-soft: #3A4F86;  /* texto secundário */
  --line: #C9D8EE;       /* divisores, bordas */
  --sol: #FFC93C;        /* destaques */
  --mola: #D7263D;       /* molas e avisos, em doses pequenas */
  --err: #B81F33;        /* texto de erro */
  --err-bg: #FCE4E7;
  --ok: #1F7A4D;
  --ok-bg: #DDF1E6;
  --tile-1: #FFC93C;
  --tile-2: #BFD6F2;
  --tile-3: #F6C3CA;
  --display: "Bagel Fat One", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--sky); color: var(--anil);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 4.5vw, 2.3rem); }
h3 { font-family: var(--body); font-weight: 700; font-size: 1.1rem; line-height: 1.4; margin: 0 0 .3em; }
p { margin: 0 0 1em; }
a { color: var(--anil); }
a:hover { color: var(--mola); }
:focus-visible { outline: 3px solid var(--sol); outline-offset: 2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 600px; }
.muted { color: var(--anil-soft); }
.lead { font-size: 1.15rem; line-height: 1.6; color: var(--anil-soft); max-width: 36em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Topo e rodapé */
header.top { padding: 16px 0; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font-family: var(--display); font-size: 1.5rem; line-height: 1; text-decoration: none; color: var(--anil); text-transform: lowercase; }
.logo.small { font-size: 1.1rem; color: var(--anil-soft); }
footer { padding: 28px 0 36px; color: var(--anil-soft); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; }
section { padding: 48px 0 0; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border: 0; border-radius: 12px;
  background: var(--anil); color: #fff; font: 700 1.05rem/1.2 var(--body);
  cursor: pointer; text-decoration: none; transition: transform .12s, background .12s;
}
.btn:hover { background: #142E72; color: #fff; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--anil); }
.btn.ghost:hover { background: #E2EBF8; color: var(--anil); }
.btn.sun { background: var(--sol); color: var(--anil); }
.btn.sun:hover { background: #F5BD25; color: var(--anil); }
.btn.soft { background: var(--sky); color: var(--anil); }
.btn.soft:hover { background: #E2EBF8; color: var(--anil); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.btn.block { width: 100%; }
.btn svg { flex-shrink: 0; }
.quiet { background: none; border: 0; padding: 0 4px; min-height: 44px; font: 700 .95rem var(--body); color: var(--anil); text-decoration: underline; cursor: pointer; }

/* Cartões e blocos */
.card { background: var(--card); border-radius: 20px; padding: 22px 20px; }
.sunbox { background: var(--sol); border-radius: 20px; padding: 24px 22px; }
.dark { background: var(--anil); color: #fff; }
.dark a:not(.btn) { color: var(--sol); }
.band { margin-top: 56px; padding: 44px 0 48px; }

/* Estendal (fio + vídeos pendurados com molas) */
.estendal { position: relative; padding-top: 22px; }
.estendal::before {
  content: ""; position: absolute; left: -20px; right: -20px; top: 0; height: 40px;
  background: no-repeat center/100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40' preserveAspectRatio='none'%3E%3Cpath d='M0 6 Q200 38 400 6' fill='none' stroke='%231B3A8C' stroke-width='2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  pointer-events: none;
}
.line { display: flex; gap: 16px; justify-content: center; position: relative; }
.peg {
  position: relative; flex: 0 0 auto; width: 104px; aspect-ratio: 9/16;
  border: 5px solid #fff; border-radius: 6px; background: var(--tile-2);
}
.peg::before { content: ""; position: absolute; left: 50%; top: -18px; width: 12px; height: 26px; margin-left: -6px; border-radius: 3px; background: var(--mola); z-index: 2; }
.peg { transform-origin: 50% -14px; transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)); }
.peg:nth-child(3n+1) { background: var(--tile-1); --r: -4deg; }
.peg:nth-child(3n+2) { background: var(--tile-2); --r: 2deg; --y: 10px; }
.peg:nth-child(3n)   { background: var(--tile-3); --r: 5deg; }
/* Bonecos animados nas fotos (estilo C). O fio baloiça, o Tio Zé acena, os netos saltitam, os olhos piscam */
.estendal .peg { animation: sway 4.5s ease-in-out infinite; }
.estendal .peg:nth-child(1) { animation-delay: -1s; }
.estendal .peg:nth-child(2) { animation-delay: -2.4s; }
.estendal .peg:nth-child(3) { animation-delay: -.3s; }
.peg .art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 2px; overflow: hidden; }
.peg.sun { background: var(--tile-1); }
.peg .tag { z-index: 2; }
.peg.intro .art { height: 62%; }
.peg.intro b, .peg.intro span { position: relative; z-index: 2; }
.art .waveC { transform-origin: 72px 130px; animation: wave 3.2s ease-in-out infinite; }
.art .bob1 { animation: bob 1.8s ease-in-out infinite; }
.art .bob2 { animation: bob 1.8s ease-in-out -.9s infinite; }
.art .eye { transform-box: fill-box; transform-origin: center; animation: blink 4s infinite; }
.art .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .5s ease-in-out infinite alternate; }
@keyframes sway { 0%,100% { transform: rotate(calc(var(--r, 0deg) - 1.2deg)) translateY(var(--y, 0px)); } 50% { transform: rotate(calc(var(--r, 0deg) + 1.2deg)) translateY(var(--y, 0px)); } }
@keyframes wave { 0%,55%,100% { transform: rotate(0); } 65% { transform: rotate(-16deg); } 75% { transform: rotate(8deg); } 85% { transform: rotate(-12deg); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes blink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes flick { from { transform: scale(1, 1); } to { transform: scale(.8, 1.15); } }
.peg .tag { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 1px 8px; border-radius: 6px; background: #fff; font-size: .75rem; font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peg.intro { background: var(--anil); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; }
.peg.intro b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; line-height: 1.1; }
.peg.intro span { color: var(--sol); font-weight: 700; font-size: .85rem; }

/* Passos */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps .n { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--sol); display: grid; place-items: center; font-weight: 700; }
.steps li:last-child .n { background: var(--mola); color: #fff; }
.steps p { margin: 6px 0 0; }

/* Bolha de WhatsApp */
.bubble { background: #fff; border-radius: 4px 16px 16px 16px; padding: 14px 16px; color: #22305A; }
.bubble .url { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--sky); font-weight: 700; font-size: .9rem; color: var(--anil); }

/* Preço */
.price .amount { font-family: var(--display); font-size: 3.4rem; line-height: 1; margin: 0 0 6px; }
.price ul { margin: 0 0 22px; padding-left: 20px; display: grid; gap: 6px; }

/* Formulários */
form .field { margin-bottom: 18px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=date], textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font: 16px/1.4 var(--body); background: #fff; color: var(--anil);
}
input:focus, textarea:focus { outline: none; border-color: var(--anil); box-shadow: 0 0 0 3px var(--sol); }
input[readonly] { background: var(--sky); color: var(--anil-soft); }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: .9rem; line-height: 1.45; color: var(--anil-soft); }
.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--anil); }
.hint { font-size: .88rem; line-height: 1.45; color: var(--anil-soft); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--sky); color: var(--anil); font: 500 .95rem var(--body); cursor: pointer; }
.chip[aria-pressed=true] { background: var(--anil); color: #fff; font-weight: 700; }
hr.soft { border: 0; border-top: 1.5px solid var(--line); margin: 22px 0; }
.alert { padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-size: .92rem; font-weight: 500; }
.alert.err { background: var(--err-bg); color: var(--err); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--sol); color: var(--anil); }
.linkbox { display: flex; gap: 8px; margin: 12px 0 0; }
.linkbox input { flex: 1; min-width: 0; font-size: .9rem; min-height: 48px; }

/* Perguntas */
details { border-bottom: 1.5px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 8px 0 0; color: var(--anil-soft); }

.hidden { display: none !important; }
.center { text-align: center; }

/* Gravação */
.invite { position: relative; margin-top: 30px; background: #fff; border-radius: 8px; padding: 26px 20px 22px; transform: rotate(-1.2deg); }
.invite::before { content: ""; position: absolute; left: 50%; top: -18px; width: 14px; height: 30px; margin-left: -7px; border-radius: 3px; background: var(--mola); }
.invite .kicker { color: var(--mola); font-weight: 700; margin: 0 0 6px; }
.invite h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
.stage { position: relative; background: #0F2257; border-radius: 16px; overflow: hidden; aspect-ratio: 9/16; max-height: 70vh; margin: 0 auto 16px; }
.stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage video.mirror { transform: scaleX(-1); }
.stage.preview { border: 7px solid #fff; border-radius: 8px; transform: rotate(-1.5deg); max-width: 300px; }
.rec-badge { position: absolute; top: 14px; left: 14px; background: #fff; color: var(--anil); padding: 6px 14px; border-radius: 12px; font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.rec-badge::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mola); margin-right: 8px; vertical-align: 1px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
.stack { display: grid; gap: 12px; }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; background: var(--anil); width: 0; transition: width .2s; }
.tips { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Painel */
.clips { list-style: none; margin: 0; padding: 30px 0 0; display: grid; gap: 34px 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.clip { position: relative; }
.clip::after { content: ""; position: absolute; left: -10px; right: -10px; top: -14px; height: 2px; background: var(--anil); border-radius: 2px; }
.clip .frame { position: relative; border: 5px solid #fff; border-radius: 6px; background: var(--tile-2); }
.clip:nth-child(3n+1) .frame { transform: rotate(-3deg); }
.clip:nth-child(3n+2) .frame { transform: rotate(2deg); }
.clip:nth-child(3n) .frame { transform: rotate(4deg); }
.clip .frame::before { content: ""; position: absolute; left: 50%; top: -18px; width: 12px; height: 26px; margin-left: -6px; border-radius: 3px; background: var(--mola); z-index: 2; }
.clip video { width: 100%; aspect-ratio: 9/16; object-fit: cover; background: #0F2257; display: block; border-radius: 2px; }
.clip .meta { padding: 10px 2px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.clip .meta strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.del { background: none; border: 0; min-height: 44px; padding: 0 4px; color: var(--err); font: 700 .88rem var(--body); cursor: pointer; text-decoration: underline; }
.stat { font-family: var(--display); font-size: 2.4rem; line-height: 1; }
.status { display: inline-block; padding: 2px 10px; border-radius: 8px; font-size: .88rem; font-weight: 700; background: var(--sol); color: var(--anil); }
.status.rendering { background: #fff; }
.status.done { background: var(--ok-bg); color: var(--ok); }
.paybar { position: sticky; bottom: 0; margin-top: 32px; padding: 14px 20px 20px; background: var(--anil); color: #DCE6F7; border-radius: 20px 20px 0 0; }
.paybar .btn { width: 100%; }
.paybar p { margin: 8px 0 0; font-size: .85rem; text-align: center; }
.final { border: 8px solid #fff; border-radius: 8px; max-width: 320px; width: 100%; display: block; margin: 14px auto 18px; background: #0F2257; }

@media (min-width: 760px) {
  section { padding-top: 72px; }
  .peg { width: 150px; }
  .line { gap: 32px; }
  .hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
}

/* Painel: extras (música e transições) */
.status.failed { background: var(--err-bg); color: var(--err); }
.tracks { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1.5px solid var(--line); display: grid; gap: 8px; }
.track { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 12px; background: var(--sky); }
.track.on { background: #E2EBF8; outline: 2px solid var(--anil); }
.track .play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--anil); color: #fff; font-size: .9rem; cursor: pointer; flex-shrink: 0; }
