/* ============================================================
   ClipSaver — Design system (redesign 2026-08-02)
   Inspirado em Linear/Vercel/Raycast/Stripe/Notion/Arc: minimalista,
   dark mode como padrão (sem preto puro), muito espaço em branco,
   tipografia forte, poucas cores, glassmorphism só no header sticky.
   Vanilla CSS de propósito — projeto sem bundler (ver CLAUDE.md).
   ============================================================ */

:root,
[data-theme="dark"] {
  --bg: #0b0c10;
  --bg-elevated: #111217;
  --surface: #16171d;
  --surface-2: #1c1e26;
  --border: #26282f;
  --border-strong: #34373f;
  --text: #f2f2f5;
  --text-muted: #9a9ba5;
  --text-faint: #62636d;

  --primary: #7c6ff0;
  --primary-hover: #8f84f3;
  --primary-text: #ffffff;
  --primary-soft: rgba(124, 111, 240, 0.14);
  --primary-ring: rgba(124, 111, 240, 0.35);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --error: #f87171;
  --error-soft: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.32);
  --shadow-glow: 0 0 0 1px var(--primary-ring), 0 8px 32px rgba(124, 111, 240, 0.18);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f1f6;
  --border: #e5e5ec;
  --border-strong: #d5d5e0;
  --text: #14151a;
  --text-muted: #6b6c78;
  --text-faint: #9a9ba5;

  --primary: #6355e0;
  --primary-hover: #574abf;
  --primary-text: #ffffff;
  --primary-soft: rgba(99, 85, 224, 0.08);
  --primary-ring: rgba(99, 85, 224, 0.3);

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.1);
  --error: #dc2626;
  --error-soft: rgba(220, 38, 38, 0.1);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.1);

  --shadow-sm: 0 1px 2px rgba(15, 15, 25, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 15, 25, 0.08);
  --shadow-glow: 0 0 0 1px var(--primary-ring), 0 8px 24px rgba(99, 85, 224, 0.14);

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: inherit;
}

/* Foco visível sempre — teclado precisa saber onde está (WCAG). */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.container {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header (sticky, glass) ─────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: var(--bg); /* fallback pra navegador sem color-mix() */
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #ff7ab8);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.brand-mark svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.theme-toggle:active {
  transform: scale(0.94);
}
.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ── Layout geral ────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  padding-bottom: 4rem;
}

section {
  padding: 4.5rem 0;
}
section.tight {
  padding: 2.5rem 0;
}

.section-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
.section-head h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}
.section-head p {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin: 0;
  line-height: 1.55;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3.5rem 0 1rem;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -4rem 0 auto;
  height: 22rem;
  background: radial-gradient(ellipse 40rem 18rem at 50% 0%, var(--primary-soft), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 0.9rem;
}
.hero .highlight {
  background: linear-gradient(135deg, var(--primary), #ff7ab8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0 auto;
  line-height: 1.6;
}
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
}
.hero-badge svg { width: 0.9rem; height: 0.9rem; color: var(--success); }

/* ── Card genérico ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Card de input (o coração da conversão) ─────────────────────── */
.input-card {
  padding: 1.75rem;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.input-card.is-focused {
  box-shadow: var(--shadow-glow);
  border-color: var(--primary-ring);
}

.url-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.4rem 0.4rem 1.1rem;
  transition: border-color 0.15s ease;
}
.url-field:focus-within {
  border-color: var(--primary);
}
.platform-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 1.5rem;
  justify-content: center;
}
.platform-indicator svg {
  width: 1.3rem;
  height: 1.3rem;
  flex-shrink: 0;
}
.platform-indicator .ph-generic { color: var(--text-faint); }

#url-input {
  flex: 1;
  min-width: 0;
  height: 3.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
#url-input::placeholder {
  color: var(--text-faint);
}
#url-input:focus {
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.85rem;
  padding: 0 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.96);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  flex-shrink: 0;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(124, 111, 240, 0.35);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
}
.btn .spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.85; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.paste-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 0.9rem 0.2rem 0;
}
.paste-hint kbd {
  font-family: inherit;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  color: var(--text-muted);
}

/* ── Mensagens de estado (erro / info) ───────────────────────── */
.message {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 1.1rem;
  animation: fade-in 0.2s ease;
}
.message svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; margin-top: 0.1rem; }
.message.error {
  background: var(--error-soft);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--error);
}
.message.warning {
  background: var(--warning-soft);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warning);
}
.message.success {
  background: var(--success-soft);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--success);
}

/* ── Loading em etapas ───────────────────────────────────────── */
.loading-card {
  padding: 2rem 1.75rem;
  text-align: center;
  animation: fade-in 0.25s ease;
}
.loading-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  color: var(--primary);
  animation: pulse-ring 1.6s ease-in-out infinite;
}
.loading-icon svg { width: 1.4rem; height: 1.4rem; }
.loading-step {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.9rem;
  min-height: 1.4em;
  transition: opacity 0.2s ease;
}
.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
  max-width: 22rem;
  margin: 0 auto;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), #ff7ab8);
  width: 8%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-soft); }
  50% { box-shadow: 0 0 0 10px transparent; }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Card de resultado (preview) ────────────────────────────── */
.result-card {
  padding: 1.75rem;
  animation: fade-in 0.3s ease;
}
.result-body {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
#result-thumb {
  width: 9rem;
  height: 15.75rem;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.result-info {
  flex: 1;
  min-width: 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.result-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
}
.result-eyebrow svg { width: 1rem; height: 1rem; }
#result-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}
#result-author {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}
.badge svg { width: 0.85rem; height: 0.85rem; }
.result-actions {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
#result-download {
  text-decoration: none;
}
#result-download .btn {
  background: var(--success);
  color: #06281c;
}
#result-download .btn:hover {
  filter: brightness(1.08);
}

/* ── Ad slots — espaço sempre reservado, evita CLS ──────────── */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-faint);
  font-size: 0.75rem;
  position: relative;
  overflow: hidden;
}
.ad-slot::before {
  content: "Publicidade";
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.ad-slot--leaderboard { min-height: 90px; }
.ad-slot--rectangle { min-height: 250px; max-width: 336px; margin: 0 auto; }
.ad-slot--inline { min-height: 120px; }

/* ── Como funciona ───────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.step-card {
  padding: 1.75rem;
  text-align: left;
}
.step-number {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.step-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.step-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ── Plataformas suportadas ─────────────────────────────────── */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
}
.platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  text-align: center;
}
.platform-card svg {
  width: 2rem;
  height: 2rem;
  color: var(--text-muted);
}
.platform-card span {
  font-weight: 600;
  font-size: 0.9rem;
}
.platform-card .status {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
}
.platform-card.is-live .status {
  background: var(--success-soft);
  color: var(--success);
}
.platform-card.is-soon .status {
  background: var(--surface-2);
  color: var(--text-faint);
}
.platform-card.is-soon {
  opacity: 0.65;
}

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 42rem;
  margin: 0 auto;
}
.faq-item {
  padding: 0;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  font-size: 0.98rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chevron {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary .chevron {
  transform: rotate(180deg);
}
.faq-item .faq-answer {
  padding: 0 1.4rem 1.15rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

/* ── Galeria "Últimos downloads" ────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.1rem;
}
@media (max-width: 1000px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.gallery-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.gallery-thumb-wrap {
  aspect-ratio: 9 / 16;
  background: var(--surface-2);
  overflow: hidden;
}
.gallery-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-card-body {
  padding: 0.7rem 0.8rem;
}
.gallery-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gallery-card-author {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 0;
}
.gallery-empty,
.gallery-loading {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}
.gallery-loading[hidden],
.gallery-empty[hidden] {
  display: none;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 1rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links a:hover {
  color: var(--text);
}
.footer-copy {
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  section { padding: 3rem 0; }
  .url-field {
    flex-wrap: wrap;
    padding: 0.75rem;
  }
  #url-input {
    width: 100%;
    order: 1;
    height: 2.75rem;
  }
  .platform-indicator { order: 0; }
  .btn-primary.submit-btn {
    order: 2;
    width: 100%;
  }
  .steps-grid { grid-template-columns: 1fr; }
  .result-body { flex-direction: column; align-items: center; text-align: center; }
  .result-actions { justify-content: center; }
  #result-thumb { width: 8rem; height: 14rem; }
}

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