/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  --pink: #fe2c55;
  --cyan: #25f4ee;
  --bg: #0f0f12;
  --bg-2: #17171c;
  --surface: #1f1f27;
  --text: #f1f1f3;
  --muted: #a8a8b3;
  --border: #2a2a33;
  --success: #22c55e;
  --error: #ef4444;
  --gradient: linear-gradient(135deg, #25f4ee 0%, #fe2c55 100%);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.2; font-weight: 800; }

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

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* === Header === */
.site-header {
  padding: 14px 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; }
.logo-icon { font-size: 1.4rem; }
.logo-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* === Hero === */
.hero {
  padding: 32px 0 24px;
  background:
    radial-gradient(800px 300px at 80% -20%, rgba(254,44,85,.18), transparent 60%),
    radial-gradient(800px 300px at 0% 0%, rgba(37,244,238,.14), transparent 60%);
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  margin-bottom: 10px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  color: var(--muted);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto 22px;
}

/* === Form === */
.download-form { max-width: 560px; margin: 0 auto; }
.input-wrapper {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrapper:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(254,44,85,.15);
}
#tiktok-url {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  padding: 16px 14px;
  min-width: 0;
}
#tiktok-url::placeholder { color: var(--muted); }

.paste-btn {
  background: transparent;
  color: var(--cyan);
  border: 0;
  border-left: 1px solid var(--border);
  padding: 0 16px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}
.paste-btn:hover { background: rgba(37,244,238,.08); }

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 16px 22px;
  font-size: 1.05rem;
  font-weight: 800;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, box-shadow .2s, opacity .2s;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(254,44,85,.35);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { opacity: .75; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }

/* Spinner */
.btn-spinner {
  display: none;
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.is-loading .btn-label { display: none; }
.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  margin-top: 12px;
  color: #fff;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.4);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .95rem;
}

/* === Ad slots === */
.ad-slot {
  margin: 28px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}
.ad-placeholder {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: repeating-linear-gradient(45deg, #1a1a22, #1a1a22 10px, #1f1f27 10px, #1f1f27 20px);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot-2 .ad-placeholder { max-width: 300px; min-height: 250px; }

@media (max-width: 600px) {
  .ad-slot-1 .ad-placeholder { max-width: 320px; min-height: 50px; }
}

/* === Result === */
.result {
  padding: 8px 0 24px;
  animation: fadeIn .35s ease;
}
@keyframes fadeIn { from { opacity:0; transform: translateY(8px);} to {opacity:1; transform:none;} }

.result-title { text-align: center; margin-bottom: 16px; font-size: 1.3rem; }
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.result-preview video {
  width: 100%;
  max-height: 480px;
  border-radius: 10px;
  background: #000;
}
.result-info { margin: 14px 0 4px; }
.video-title { font-weight: 700; }
.video-author { color: var(--muted); font-size: .9rem; }
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* === How-to === */
.how-to { padding: 36px 0 24px; }
.how-to h2, .faq h2 {
  text-align: center;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin-bottom: 22px;
}
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
}
.step-icon { font-size: 2rem; margin-bottom: 8px; }
.step-number {
  position: absolute;
  top: 10px; left: 14px;
  width: 28px; height: 28px;
  background: var(--gradient);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .9rem;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .95rem; }

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* === FAQ === */
.faq { padding: 24px 0 36px; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .2s;
}
.faq-item[open] { border-color: var(--pink); }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--cyan);
  transition: transform .2s;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--muted); margin-top: 10px; font-size: .95rem; }

/* === Footer === */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 22px 0;
  margin-top: 24px;
  text-align: center;
}
.footer-nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-nav a { color: var(--muted); font-size: .95rem; }
.footer-nav a:hover { color: var(--cyan); }
.copyright { color: var(--muted); font-size: .85rem; }

/* === Mobile tweaks === */
@media (max-width: 480px) {
  .hero { padding: 24px 0 18px; }
  .paste-btn { padding: 0 12px; font-size: .85rem; }
  #tiktok-url { padding: 14px 12px; font-size: .95rem; }
}

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

/* === Páginas legais (termos, privacidade, contato, 404) === */
.legal { padding: 32px 0 48px; max-width: 760px; }
.legal h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: 8px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.legal h2 { font-size: 1.15rem; margin: 28px 0 10px; }
.legal p, .legal li { color: var(--muted); margin-bottom: 10px; font-size: .98rem; }
.legal ul { padding-left: 20px; margin-bottom: 12px; }
.legal a { color: var(--cyan); }
.legal a:hover { text-decoration: underline; }
.legal .updated { font-size: .85rem; color: var(--muted); margin-bottom: 18px; opacity: .8; }
.legal code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
}

/* === Banner LGPD === */
.cookie-banner {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 100;
  animation: slideUp .35s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.cookie-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
}
.cookie-text strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.cookie-text p { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.cookie-text a { color: var(--cyan); text-decoration: underline; }

.cookie-actions { display: flex; gap: 10px; }
.btn-cookie {
  flex: 1;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: opacity .2s, transform .12s;
}
.btn-cookie-primary { background: var(--gradient); color: #fff; }
.btn-cookie-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-cookie:hover { opacity: .9; }
.btn-cookie:active { transform: translateY(1px); }

@media (min-width: 720px) {
  .cookie-banner { left: 24px; right: 24px; bottom: 24px; padding: 18px 22px; }
  .cookie-inner { flex-direction: row; align-items: center; }
  .cookie-text { flex: 1; }
  .cookie-actions { flex: 0 0 auto; }
  .btn-cookie { min-width: 110px; flex: initial; }
}

/* === Botão flutuante WhatsApp === */
.wa-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(37,211,102,.45);
  z-index: 90;
  transition: transform .15s ease, box-shadow .2s;
}
.wa-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37,211,102,.55); }
.wa-fab svg { display: block; }

/* No mobile, mostra só o ícone para não atrapalhar */
@media (max-width: 600px) {
  .wa-fab { padding: 12px; bottom: 84px; }
  .wa-fab-label { display: none; }
}

/* Quando o banner LGPD está aberto, sobe o botão WhatsApp para não sobrepor */
body.cookie-open .wa-fab { bottom: 180px; }
@media (min-width: 720px) {
  body.cookie-open .wa-fab { bottom: 100px; }
}

