:root {
  color-scheme: light;
  --bg: #fbf6fa;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b6472;
  --line: #ead9e6;
  --primary: #d62976;
  --primary-dark: #b51e63;
  --accent: #fa7e1e;
  --gold: #feda75;
  --sky: #962fbf;
  --ig-gradient: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 55%, #962fbf 80%, #4f5bd5 100%);
  --shadow: 0 24px 70px rgba(60, 28, 56, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 41, 118, 0.14), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(150, 47, 191, 0.12), transparent 36rem),
    linear-gradient(145deg, #fbf6fa 0%, #f7edf7 50%, #fff5ea 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 16px 28px;
  display: grid;
  gap: 18px;
  align-content: center;
}

.ad-slot {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(104, 115, 133, 0.34);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  overflow: hidden;
}

.ad-slot::before {
  content: "Publicidade";
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
}

.ad-slot:has(.adsbygoogle)::before,
.ad-slot[hidden] {
  display: none;
}

.ad-slot-top,
.ad-slot-bottom {
  width: 100%;
}

.download-panel,
.phone-frame {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 224, 234, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.download-panel {
  border-radius: 28px;
  padding: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--ig-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 10px 24px rgba(214, 41, 118, 0.32);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 12vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.brand-row p,
.preview-copy p,
.status-message {
  color: var(--muted);
  line-height: 1.45;
}

.download-form {
  display: grid;
  gap: 16px;
}

label,
legend {
  font-size: 0.84rem;
  font-weight: 750;
  color: #263241;
}

.url-box {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.url-box:focus-within {
  border-color: rgba(214, 41, 118, 0.72);
  box-shadow: 0 0 0 4px rgba(214, 41, 118, 0.12);
}

.url-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 0 0 16px;
  color: var(--ink);
  background: transparent;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  margin-right: 6px;
  background: #eef2f7;
  color: #526071;
  cursor: pointer;
}

.platform-strip {
  min-height: 34px;
}

.platform-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fdeaf3;
  color: var(--primary-dark);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.2;
}

.platform-pill.idle {
  background: #eef2f7;
  color: #5d6877;
}

.platform-pill.error {
  background: #fff0f2;
  color: #bc2439;
}

.control-grid {
  display: grid;
  gap: 12px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 8px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7f9fc;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control label {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #526071;
  cursor: pointer;
}

.segmented-control input:checked + label {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(28, 39, 60, 0.1);
}

.toggle-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.toggle-row input {
  width: 48px;
  height: 28px;
  appearance: none;
  border-radius: 999px;
  background: #cfd8e3;
  cursor: pointer;
  position: relative;
  transition: background 160ms ease;
}

.toggle-row input::after {
  content: "";
  width: 22px;
  height: 22px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(28, 39, 60, 0.22);
  transition: transform 160ms ease;
}

.toggle-row input:checked {
  background: var(--primary);
  background-image: var(--ig-gradient);
}

.toggle-row input:checked::after {
  transform: translateX(20px);
}

.primary-button {
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: var(--ig-gradient);
  background-size: 140% 140%;
  background-position: 0% 50%;
  color: #fff;
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(214, 41, 118, 0.32);
  transition:
    transform 160ms ease,
    background-position 320ms ease,
    opacity 160ms ease;
}

.primary-button:hover {
  background-position: 100% 50%;
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.status-message {
  min-height: 42px;
  padding: 0 2px;
  font-size: 0.92rem;
}

.hint-note {
  margin: -6px 2px 0;
  font-size: 0.74rem;
  color: var(--muted);
  opacity: 0.62;
}

.status-message a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.preview-panel {
  display: none;
}

.phone-frame {
  border-radius: 34px;
  padding: 14px;
}

.video-preview {
  aspect-ratio: 9 / 14;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(250, 126, 30, 0.95), transparent 46%),
    linear-gradient(20deg, rgba(214, 41, 118, 0.95), transparent 50%),
    linear-gradient(300deg, rgba(150, 47, 191, 0.92), transparent 55%),
    #241826;
}

.video-preview::before,
.video-preview::after {
  content: "";
  position: absolute;
  inset: auto 18px 20px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
}

.video-preview::after {
  inset: 20px 18px auto;
  height: 10px;
  width: 44%;
  background: rgba(255, 255, 255, 0.42);
}

.play-mark {
  width: 70px;
  height: 70px;
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.play-mark::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 22px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 19px solid #d62976;
}

.preview-copy {
  padding: 16px 4px 2px;
}

.preview-copy h2 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

@media (min-width: 680px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 44px;
  }

  .download-panel {
    padding: 34px;
    align-self: center;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-panel {
    display: grid;
    align-items: center;
  }

  .ad-slot-top,
  .ad-slot-bottom {
    grid-column: 1 / -1;
  }
}

@media (min-width: 980px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  .download-panel {
    padding: 42px;
  }
}

/* Rodape com links de apoio */
.site-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 8px 4px 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  opacity: 0.78;
}

.site-footer a:hover {
  opacity: 1;
  color: var(--primary-dark);
}

.site-footer .footer-sep {
  opacity: 0.4;
}

@media (min-width: 680px) {
  .site-footer {
    grid-column: 1 / -1;
  }
}

/* Paginas de texto (privacidade, termos, contato) */
.legal-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: grid;
  gap: 18px;
}

.legal-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(234, 217, 230, 0.85);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 26px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 0.86rem;
  font-weight: 750;
  color: var(--primary-dark);
  text-decoration: none;
}

.legal-card h1 {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 6px;
}

.legal-updated {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.legal-card h2 {
  font-size: 1.1rem;
  margin: 26px 0 8px;
}

.legal-card p,
.legal-card li {
  color: #3b3340;
  line-height: 1.6;
  font-size: 0.95rem;
}

.legal-card ul {
  margin: 8px 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.legal-card a {
  color: var(--primary-dark);
  font-weight: 650;
}

@media (min-width: 680px) {
  .legal-card {
    padding: 40px;
  }
}
