/* CorretoresAI — tokens, reset e componentes compartilhados (tema preto e dourado) */

:root {
  --bg: #0e1012;
  --bg-alt: #121417;
  --bg-deep: #0a0c0d;
  --surface: #15181b;
  --surface-2: #1a1e22;
  --surface-3: #20252a;
  --border: #262b31;
  --border-soft: #1c2126;

  --text: #f3f5f6;
  --text-muted: #9aa1a8;
  --text-dim: #6b7379;

  --gold: #c9a227;
  --gold-soft: #ddc074;
  --gold-bright: #e3cb8a;
  --gold-deep: #8c6d1f;
  --on-gold: #17130a;

  --ok: #4ade80;
  --info: #60a5fa;
  --warn: #fbbf24;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --container: 1180px;

  /* Serifa de transição para títulos: formal, com contraste alto de traço.
     Sem webfont externa — a CSP da prévia publicada bloqueia CDN de fonte. */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system,
    BlinkMacSystemFont, system-ui, sans-serif;
  --shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.85);
  --shadow-gold: 0 12px 34px -14px rgba(201, 162, 39, 0.45);
}

:root[data-theme="light"] {
  --bg: #faf8f4;
  --bg-alt: #f4f1ea;
  --bg-deep: #efebe1;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --surface-3: #f2eee5;
  --border: #e3ded2;
  --border-soft: #ece8dd;

  --text: #17150f;
  --text-muted: #5c584e;
  --text-dim: #8a857a;

  --gold: #a8801d;
  --gold-soft: #8a6a19;
  --gold-bright: #7a5d15;
  --gold-deep: #6b5214;
  --on-gold: #fffdf7;

  --shadow: 0 20px 46px -30px rgba(60, 50, 20, 0.35);
  --shadow-gold: 0 12px 30px -14px rgba(168, 128, 29, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.icon { width: 1em; height: 1em; flex: none; }

/* ---------- Marca ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--gold-deep);
  color: var(--gold);
  background: linear-gradient(155deg, rgba(201, 162, 39, 0.2), transparent 70%);
}

.brand-mark svg { width: 20px; height: 20px; }
.brand-ai { color: var(--gold-soft); }

.brand-stack { display: grid; gap: 1px; }

.brand-tag {
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(150deg, var(--gold-bright), var(--gold) 48%, var(--gold-deep));
  color: var(--on-gold);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover { filter: brightness(1.07); }

.btn-outline {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.btn-outline:hover { border-color: var(--gold-deep); }

.btn-quiet {
  background: transparent;
  color: var(--text-muted);
  padding-inline: 8px;
}

.btn-quiet:hover { color: var(--text); }

.btn-lg { padding: 14px 28px; font-size: 15.5px; }
.btn-block { width: 100%; }

/* ---------- Peças reutilizadas ---------- */

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--gold-soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chip svg { width: 13px; height: 13px; }

.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--gold-soft);
}

.icon-tile svg { width: 19px; height: 19px; }
.icon-tile.is-gold {
  border-color: transparent;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold-deep));
  color: var(--on-gold);
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--gold-soft);
  cursor: pointer;
}

.theme-btn svg { width: 17px; height: 17px; }
.theme-btn:hover { border-color: var(--gold-deep); }
:root:not([data-theme="light"]) .theme-btn .icon-moon { display: none; }
:root[data-theme="light"] .theme-btn .icon-sun { display: none; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}

.tag {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
}

.plan-flag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold-deep));
  color: var(--on-gold);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.check-list li { display: flex; align-items: center; gap: 8px; }

.check-list li::before {
  content: "";
  flex: none;
  width: 11px;
  height: 6px;
  border-left: 1.8px solid var(--gold);
  border-bottom: 1.8px solid var(--gold);
  transform: rotate(-45deg) translateY(-2px);
}

/* ---------- Controles de formulário ---------- */

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field > label {
  display: block;
  margin-bottom: 9px;
  font-size: 13.5px;
  font-weight: 600;
}

.field > label small { color: var(--text-dim); font-weight: 400; }
.field .hint { margin: 8px 0 0; color: var(--text-dim); font-size: 12.5px; }
.field .hint a { color: var(--gold-soft); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.field select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 19px center, right 14px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field textarea { min-height: 108px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }

.field input:focus, .field select:focus, .field textarea:focus,
.btn:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-deep);
}

.field input:disabled, .field select:disabled { opacity: 0.55; cursor: not-allowed; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field-row > .field { margin-bottom: 0; }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }

.choice-row button {
  padding: 9px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
}

.choice-row button:hover { border-color: var(--gold-deep); color: var(--text); }

.choice-row button[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold-deep));
  color: var(--on-gold);
  font-weight: 600;
}

/* Interruptor */

.switch {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-soft);
}

.switch:last-child { border-bottom: 0; padding-bottom: 0; }
.switch-text { flex: 1; min-width: 0; }
.switch-text strong { display: block; font-size: 14px; font-weight: 600; }
.switch-text span { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; }

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

.switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--text-dim);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .switch-track {
  border-color: transparent;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold-deep));
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
  background: var(--on-gold);
}

.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

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

:root[data-anim="off"] * { transition: none !important; animation: none !important; }

/* ---------- Convite para instalar na tela de início ----------
   Folha de baixo no celular (é de onde vem o menu de compartilhar do Safari,
   então o olho já está ali) e cartão centralizado a partir do tablet. */

.instalar-fundo {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  animation: instalar-surge 0.22s ease-out;
}

.instalar-fundo[hidden] { display: none; }

body.instalar-aberto { overflow: hidden; }

.instalar-cartao {
  position: relative;
  width: 100%;
  max-width: 30rem;
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  background: var(--bg-alt);
  box-shadow: 0 -18px 50px -20px rgba(0, 0, 0, 0.7);
  animation: instalar-sobe 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes instalar-surge { from { opacity: 0; } to { opacity: 1; } }
@keyframes instalar-sobe { from { transform: translateY(14px); } to { transform: translateY(0); } }

.instalar-fechar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.instalar-fechar svg { width: 15px; height: 15px; }
.instalar-fechar:hover { color: var(--text); border-color: var(--gold-deep); }

.instalar-topo {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin: 0 34px 20px 0;
}

.instalar-logo {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.55);
}

.instalar-topo h2 {
  margin: 2px 0 6px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.15;
}

.instalar-topo p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.instalar-passos {
  display: grid;
  gap: 2px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.instalar-passo {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 13px 12px;
  border-radius: 12px;
}

.instalar-passo:nth-child(odd) { background: var(--surface); }

.instalar-numero {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold-deep));
  color: var(--on-gold);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.instalar-icone { display: grid; place-items: center; color: var(--gold-soft); }
.instalar-icone svg { width: 21px; height: 21px; }

.instalar-texto { display: grid; gap: 3px; }
.instalar-texto strong { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.instalar-texto span { color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.instalar-rodape { display: grid; gap: 10px; justify-items: center; }
.instalar-nunca { font-size: 13px; color: var(--text-dim); }

/* Tablet e desktop: deixa de ser folha de baixo e vira cartão centralizado. */
@media (min-width: 640px) {
  .instalar-fundo { align-items: center; padding: 24px; }

  .instalar-cartao {
    border-bottom: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px 28px 26px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  }

  @keyframes instalar-sobe { from { transform: scale(0.97); } to { transform: scale(1); } }
}

@media (prefers-reduced-motion: reduce) {
  .instalar-fundo, .instalar-cartao { animation: none; }
}
