/* =============================================================================
   AprovAI — design system
   Tokens e linguagem visual derivados da logo e do card "Top 3 da semana":
   gradiente azul → roxo → rosa, cards brancos com borda suave e cantos largos.
   ========================================================================== */

:root {
  --blue: #2e5eff;
  --purple: #9b3fe8;
  --pink: #f23cc0;
  --amber: #f5a524;
  --green: #12a150;
  --red: #f31260;

  --bg: #f3f4fa;
  --card: #ffffff;
  --text: #12122b;
  --muted: #6b7280;
  --border: #e6e7f2;

  --gradient: linear-gradient(120deg, var(--blue), var(--purple) 60%, var(--pink));
  --gradient-soft: linear-gradient(120deg, rgba(46, 94, 255, 0.1), rgba(155, 63, 232, 0.1) 60%, rgba(242, 60, 192, 0.1));

  --radius-lg: 28px;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px -12px rgba(46, 54, 120, 0.25);
  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.1; font-weight: 800; }
:focus-visible { outline: 3px solid rgba(46, 94, 255, 0.45); outline-offset: 2px; border-radius: 8px; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.container.narrow { width: min(560px, 100% - 32px); }
.muted { color: var(--muted); }
.mb { margin-bottom: 22px; }
.mt-sm { margin-top: 8px; }
.small { font-size: 13.5px; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grad-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(243, 244, 250, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 800; font-size: 24px; letter-spacing: -0.04em; }
.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.brand b { color: var(--blue); font-weight: 800; }
.nav { display: flex; align-items: center; gap: 26px; font-weight: 600; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 720px) { .nav a:not(.btn) { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  background: var(--card); color: var(--text); border-color: var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--gradient); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }
.btn.light { background: #fff; color: var(--blue); border-color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: stretch; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-card {
  background: var(--gradient); color: #fff; border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 22px;
  position: relative; overflow: hidden;
}
.hero-card::after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; right: -90px; bottom: -120px; background: rgba(255, 255, 255, 0.12); }
.pill { display: inline-flex; align-self: flex-start; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); letter-spacing: -0.04em; }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); opacity: 0.95; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; position: relative; z-index: 1; }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }

.trust { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 22px 0 6px; color: var(--muted); font-weight: 600; font-size: 14px; justify-content: center; }

/* ---------- Phone mock ---------- */
.phone { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.phone-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.phone-head img { width: 38px; height: 38px; border-radius: 50%; }
.phone-head strong { display: block; line-height: 1.1; }
.phone-head small { color: var(--green); font-weight: 600; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-line; }
.bubble.bot { background: #eef0fb; border-top-left-radius: 4px; align-self: flex-start; }
.bubble.me { background: var(--gradient); color: #fff; border-top-right-radius: 4px; align-self: flex-end; font-weight: 700; }
.bubble.ok { background: #e7f8ee; color: #0d5c31; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; display: grid; gap: 12px; }
.section-head.left { text-align: left; margin: 0; max-width: none; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); }
.section-head p { color: var(--muted); font-size: 18px; }
.kicker { font-weight: 800; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--purple); }

.card { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 28px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }
.feature .icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--gradient-soft); font-size: 26px; margin-bottom: 16px; }
.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { color: var(--muted); }

/* Ranking (reproduz o card "Top 3 da semana") */
.rank-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
@media (max-width: 900px) { .rank-wrap { grid-template-columns: 1fr; } }
.rank-card { background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 28px; display: grid; gap: 16px; }
.rank-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.rank-first { background: var(--gradient); color: #fff; border-radius: var(--radius); padding: 28px; }
.rank-first small { display: block; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.rank-first strong { display: block; font-size: 40px; letter-spacing: -0.04em; margin: 4px 0; }
.rank-first span { font-weight: 700; opacity: 0.95; }
.rank-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rank-mini { background: #fff; border: 2px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.rank-mini small { color: var(--purple); font-weight: 800; }
.rank-mini strong { display: block; font-size: 19px; letter-spacing: -0.02em; }
.rank-mini span { color: var(--muted); font-weight: 700; font-size: 13px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 70px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 22px; left: 28px; width: 38px; height: 38px; border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step h3 { font-size: 20px; margin-bottom: 6px; }
.step p { color: var(--muted); }
.step code, .code { background: #eef0fb; border-radius: 8px; padding: 2px 8px; font-weight: 700; color: var(--blue); }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 820px; margin: 0 auto; }
@media (max-width: 700px) { .pricing { grid-template-columns: 1fr; } }
.plan { position: relative; display: flex; flex-direction: column; gap: 18px; }
.plan.featured { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--gradient) border-box; box-shadow: var(--shadow); }
.plan .ribbon { position: absolute; top: -14px; right: 22px; background: var(--gradient); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; }
.plan h3 { font-size: 22px; }
.plan .price { font-size: 48px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.plan .price small { font-size: 16px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.plan .sub { color: var(--muted); font-weight: 600; min-height: 1.5em; }
.plan .save { color: var(--green); font-weight: 800; font-size: 14px; margin-top: -8px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; flex: 1; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li::before { content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--gradient); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 4px 22px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--purple); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 18px; color: var(--muted); }

.cta-band { background: var(--gradient); color: #fff; border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 52px); display: grid; gap: 18px; justify-items: center; text-align: center; }
.cta-band h2 { font-size: clamp(26px, 4vw, 38px); }

/* Footer */
.site-footer { padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.site-footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; border-top: 1px solid var(--border); padding-top: 24px; }
.site-footer a { color: var(--muted); font-weight: 600; margin-left: 18px; }

/* ---------- Forms / checkout ---------- */
.page-checkout { padding: 28px 0 64px; }
.checkout-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } .summary { position: static !important; } }
.checkout-grid h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label, .legend { font-weight: 700; font-size: 14px; }
.field small { color: var(--muted); }
.input {
  width: 100%; padding: 14px 16px; font: inherit; font-size: 16px; color: var(--text);
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius-sm); transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(46, 94, 255, 0.12); }
.input.invalid { border-color: var(--red); }
.row-inline { display: flex; gap: 10px; }
.row-inline .input { flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.plan-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .plan-choices { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice .box { display: grid; gap: 2px; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.choice input:checked + .box { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(46, 94, 255, 0.12); }
.choice input:focus-visible + .box { outline: 3px solid rgba(46, 94, 255, 0.45); outline-offset: 2px; }
.choice .box strong { font-size: 17px; }
.choice .box span { color: var(--muted); font-weight: 600; font-size: 14px; }
.choice .box .tag { color: var(--green); font-weight: 800; font-size: 12px; }
.choice.best .box { border-color: rgba(46, 94, 255, 0.35); }
.choice .best-badge {
  position: absolute; top: -11px; left: 14px; background: var(--gradient); color: #fff;
  font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 999px;
}
.choice .box-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.choice .box-price b { color: var(--text); font-size: 18px; font-weight: 800; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--blue); }

.summary { position: sticky; top: 92px; display: grid; gap: 14px; }
.summary h2 { font-size: 20px; }
.line { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.line.total { font-size: 22px; font-weight: 800; padding-top: 14px; border-top: 2px dashed var(--border); letter-spacing: -0.02em; }
.line .off { color: var(--green); }
.safe { display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); }
.safe div { display: flex; gap: 8px; }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px; }
.alert.error { background: #fde8ef; color: #9b0f3f; }
.alert.ok { background: #e7f8ee; color: #0d5c31; }
.alert.warn { background: #fff4e0; color: #8a5300; }
.field-note { font-size: 13.5px; font-weight: 600; }
.field-note.ok { color: var(--green); }
.field-note.error { color: var(--red); }

/* ---------- Estados (obrigado) ---------- */
.state { text-align: center; display: grid; gap: 16px; justify-items: center; padding: 40px 28px; }
.state .big { font-size: 56px; line-height: 1; }
.state h1 { font-size: 30px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid var(--border); border-top-color: var(--blue); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Painéis (admin / parceiro) ---------- */
.panel-wrap { padding: 28px 0 80px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-head h1 { font-size: 30px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab { padding: 10px 18px; border-radius: 999px; border: 2px solid var(--border); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--gradient); color: #fff; border-color: transparent; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 22px 20px; text-align: center; }
.kpi .v { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.kpi .l { color: var(--muted); font-weight: 600; font-size: 14px; margin-top: 8px; }
.kpi.hero { background: var(--gradient); color: #fff; border-color: transparent; }
.kpi.hero .l { color: rgba(255, 255, 255, 0.9); }
.table-wrap { overflow-x: auto; background: #fff; border: 2px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; padding: 14px 16px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table small { color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { margin: 0; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eef0fb; color: var(--blue); white-space: nowrap; }
.badge.ok { background: #e7f8ee; color: #0d5c31; }
.badge.warn { background: #fff4e0; color: #8a5300; }
.badge.bad { background: #fde8ef; color: #9b0f3f; }
.badge.gray { background: #eceef3; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .input { max-width: 280px; padding: 10px 14px; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; }
.inline-form .field { gap: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.login-card { max-width: 440px; margin: 12vh auto 0; display: grid; gap: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 50; max-width: 90vw; }
.toast.error { background: var(--red); }

/* Legal */
.prose { display: grid; gap: 14px; }
.prose h1 { font-size: 34px; }
.prose h2 { font-size: 22px; margin-top: 18px; }
.prose p, .prose li { color: #3b3b55; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }

/* Simulador (dev) */
.badge-dev { background: #fff4e0; color: #8a5300; border: 2px dashed var(--amber); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 700; margin: 24px 0 12px; text-align: center; font-size: 14px; }
body.dev .container { padding-bottom: 40px; }
body.dev form { margin: 10px 0; }
