:root {
  --bg: #0a0b12;
  --card: rgba(24, 26, 40, 0.72);
  --card-solid: #141626;
  --tile: #191c2e;
  --tile-hi: #20243a;
  --text: #f2f4ff;
  --muted: #949cc0;
  --faint: #5a6488;
  --line: rgba(255, 255, 255, 0.07);
  --brand: #7c6cff;
  --brand2: #4f8cff;
  --ok: #34d399;
  --err: #fb7185;
  --radius: 18px;

  --ig: #d62976;
  --tt: #25f4ee;
  --yt: #ff2d2d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 340px at 15% -5%, rgba(124, 108, 255, 0.20), transparent 60%),
    radial-gradient(560px 320px at 100% 8%, rgba(79, 140, 255, 0.16), transparent 60%),
    radial-gradient(700px 400px at 50% 108%, rgba(214, 41, 118, 0.10), transparent 60%),
    var(--bg);
}

.app {
  max-width: 500px;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px calc(26px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Cabeçalho ---------- */
.head { text-align: center; margin: 8px 0 24px; }
.brand-mark {
  width: 62px; height: 62px;
  display: inline-grid; place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand2));
  border-radius: 18px;
  box-shadow: 0 14px 34px -12px rgba(124, 108, 255, 0.7),
              inset 0 1px 0 rgba(255,255,255,0.25);
}
.brand-mark svg { width: 30px; height: 30px; }
.head h1 { margin: 14px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -0.03em; }
.head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px 22px;
  box-shadow: 0 30px 60px -28px rgba(0,0,0,0.75);
}

.step-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700;
  color: var(--muted);
  margin: 20px 2px 10px;
}
.step-label:first-of-type { margin-top: 0; }
.step-label i {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-style: normal; font-size: 11px; font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand2));
  border-radius: 7px;
}

/* ---------- Plataformas ---------- */
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.platform {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 15px 6px 12px;
  background: var(--tile);
  border: 1.5px solid transparent;
  border-radius: 15px;
  color: var(--text);
  cursor: pointer;
  transition: transform .14s ease, border-color .14s, background .14s, box-shadow .14s;
}
.platform:active { transform: scale(.95); }
.brand-ic {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  filter: saturate(1.05);
}
.brand-ic svg { width: 100%; height: 100%; }
.brand-ic.tt {
  background: #000;
  border-radius: 11px;
  padding: 8px;
}
.pf-name { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.platform small { font-size: 9px; color: var(--faint); font-weight: 600; line-height: 1; margin-top: -3px; }

/* Estado ativo por marca */
.platform.is-active { background: var(--tile-hi); }
.platform[data-platform="instagram"].is-active {
  border-color: var(--ig);
  box-shadow: 0 0 0 3px rgba(214,41,118,.15), 0 10px 24px -14px var(--ig);
}
.platform[data-platform="tiktok"].is-active {
  border-color: var(--tt);
  box-shadow: 0 0 0 3px rgba(37,244,238,.14), 0 10px 24px -14px var(--tt);
}
.platform[data-platform="youtube"].is-active {
  border-color: var(--yt);
  box-shadow: 0 0 0 3px rgba(255,45,45,.15), 0 10px 24px -14px var(--yt);
}

/* ---------- Formatos ---------- */
.formats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.format {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 14px;
  background: var(--tile);
  border: 1.5px solid transparent;
  border-radius: 15px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform .14s, border-color .14s, background .14s, box-shadow .14s;
}
.format:active { transform: scale(.97); }
.fmt-ic {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-radius: 11px;
  transition: color .14s, background .14s;
}
.fmt-ic svg { width: 20px; height: 20px; }
.fmt-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fmt-txt strong { font-size: 14.5px; font-weight: 700; }
.fmt-txt small { font-size: 10.5px; color: var(--faint); }
.format.is-active {
  background: var(--tile-hi);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,108,255,.14);
}
.format.is-active .fmt-ic {
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand2));
}

/* ---------- Input ---------- */
.input-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--tile);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 4px 4px 4px 12px;
  transition: border-color .14s, box-shadow .14s;
}
.input-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,108,255,.15);
}
.in-ic { flex: 0 0 auto; color: var(--faint); display: grid; place-items: center; }
.in-ic svg { width: 18px; height: 18px; }
#url {
  flex: 1; min-width: 0;
  padding: 13px 4px;
  font-size: 16px; /* evita zoom no iOS */
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
}
#url::placeholder { color: var(--faint); }
.paste {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: transform .14s, color .14s, background .14s;
}
.paste svg { width: 19px; height: 19px; }
.paste:active { transform: scale(.92); }
.paste:hover { color: var(--text); background: rgba(255,255,255,0.09); }

/* ---------- Botão baixar ---------- */
.btn-download {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  font-size: 16.5px; font-weight: 800; letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border: none;
  border-radius: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 16px 34px -14px rgba(124,108,255,.75),
              inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform .14s, opacity .14s, filter .14s;
}
.btn-download:active { transform: scale(.98); }
.btn-download:hover { filter: brightness(1.06); }
.btn-download:disabled { opacity: .65; cursor: default; filter: none; }
.btn-download:disabled .dl-ic { display: none; }
.dl-ic { width: 20px; height: 20px; }

.spinner {
  width: 19px; height: 19px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status {
  margin: 13px 4px 0;
  min-height: 18px;
  font-size: 13.5px;
  text-align: center;
  color: var(--muted);
  transition: color .14s;
}
.status.ok { color: var(--ok); font-weight: 600; }
.status.err { color: var(--err); font-weight: 600; }

/* ---------- Preview ---------- */
.preview {
  margin-top: 16px;
  display: flex; gap: 12px; align-items: center;
  padding: 11px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 14px;
  animation: fade .22s ease;
}
.preview img {
  width: 82px; height: 82px;
  object-fit: cover;
  border-radius: 11px;
  background: #0d1020;
  flex: 0 0 auto;
}
.preview-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.preview-info strong {
  font-size: 14px; line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.preview-info span { font-size: 12px; color: var(--muted); }
@keyframes fade { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; } }

/* ---------- Rodapé ---------- */
.foot { margin-top: auto; padding-top: 24px; text-align: center; }
.foot p { color: var(--faint); font-size: 11.5px; margin: 0; line-height: 1.5; }
