/* ---------- tokens ---------- */
:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --text: #0f1424;
  --muted: #5b6478;
  --line: #e4e7ef;
  --primary: #5b5bf0;
  --primary-ink: #ffffff;
  --primary-soft: #eef0ff;
  --accent: #19d3a2;
  --accent-ink: #04251c;
  --danger: #d92d4a;
  --hero-a: #0a0e1d;
  --hero-b: #141a38;
  --shadow: 0 1px 2px rgba(15, 20, 36, 0.05), 0 12px 32px rgba(15, 20, 36, 0.08);
  --radius: 18px;
  color-scheme: light;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b16;
    --surface: #10162a;
    --text: #eef1f8;
    --muted: #97a1b8;
    --line: #202945;
    --primary: #8686ff;
    --primary-ink: #0a0e1d;
    --primary-soft: #1a2147;
    --danger: #ff7a8e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2397a1b8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary); }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; }
.muted { color: var(--muted); }
/* foco por teclado em botoes/links: contorno fino; nos campos, so a cor da borda muda */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ---------- topo ---------- */
.topbar { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), #5b8cff); color: #04131a; box-shadow: 0 6px 18px rgba(25, 211, 162, 0.35); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: rgba(255, 255, 255, 0.72); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav .nav-cta { color: #fff; border: 1px solid rgba(255, 255, 255, 0.22); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  padding: 128px 0 108px;
  background:
    radial-gradient(800px 380px at 50% -80px, rgba(91, 91, 240, 0.55), transparent 70%),
    radial-gradient(520px 260px at 88% 30%, rgba(25, 211, 162, 0.16), transparent 70%),
    linear-gradient(180deg, var(--hero-a), var(--hero-b));
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%);
}
.hero-in { position: relative; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #f5b83d; box-shadow: 0 0 0 0 rgba(245, 184, 61, 0.6); }
.dot.on { background: var(--accent); animation: pulse 2s infinite; }
.dot.off { background: #ff6b81; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(25, 211, 162, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(25, 211, 162, 0); } 100% { box-shadow: 0 0 0 0 rgba(25, 211, 162, 0); } }

.hero h1 { margin: 22px 0 14px; font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; }
.grad { background: linear-gradient(90deg, #8fa2ff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 0 auto 34px; max-width: 580px; color: rgba(255, 255, 255, 0.72); font-size: 1.1rem; }

.addr-card {
  max-width: 720px; margin: 0 auto; padding: 18px; text-align: left;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.addr-label { display: block; margin: 2px 6px 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.addr-row { display: flex; gap: 10px; }
.addr-input {
  flex: 1; min-width: 0; padding: 16px 18px; font-size: clamp(1.05rem, 2.6vw, 1.45rem); font-weight: 700;
  color: #fff; background: rgba(5, 8, 20, 0.55); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-overflow: ellipsis;
}
.addr-input:focus { outline: none; border-color: rgba(255, 255, 255, 0.4); }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font: inherit; font-size: 0.93rem; font-weight: 600;
  color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px; cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.pill:hover { background: rgba(255, 255, 255, 0.16); }
.pill:active { transform: translateY(1px); }
.pill-danger:hover { background: rgba(255, 107, 129, 0.2); border-color: rgba(255, 107, 129, 0.5); }
.hint { margin: 16px 0 0; font-size: 0.86rem; color: rgba(255, 255, 255, 0.55); }

/* ---------- botoes (admin/api/leitura) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; font: inherit; font-size: 0.95rem; font-weight: 600;
  border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, filter 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-lg { padding: 0 24px; font-size: 1.05rem; border-radius: 14px; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-danger { color: var(--danger); }

/* ---------- caixa de entrada ---------- */
.inbox-wrap { margin-top: -52px; position: relative; z-index: 2; }
.inbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-height: 260px; }
.inbox-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.inbox-head h2 { margin: 0; font-size: 1.05rem; }
.count { min-width: 26px; padding: 2px 9px; text-align: center; font-size: 0.82rem; font-weight: 700; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }

.row { display: flex; gap: 14px; align-items: flex-start; padding: 16px 22px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--primary-soft); }
.row.is-new { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
.avatar { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 1.05rem; }
.r-main { flex: 1; min-width: 0; }
.r-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.r-from { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-time { flex: none; font-size: 0.82rem; color: var(--muted); }
.r-subj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-prev { color: var(--muted); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 54px 20px 60px; }
.empty h3 { margin: 22px 0 6px; font-size: 1.2rem; }
.empty p { margin: 0 auto; max-width: 420px; color: var(--muted); }
.radar { position: relative; width: 72px; height: 72px; margin: 0 auto; display: grid; place-items: center; color: var(--primary); }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary); opacity: 0; animation: ping 2.8s cubic-bezier(0, 0, 0.2, 1) infinite; }
.radar span:nth-child(2) { animation-delay: 0.9s; }
.radar span:nth-child(3) { animation-delay: 1.8s; }
.radar svg { position: relative; background: var(--surface); border-radius: 50%; padding: 18px; width: 66px; height: 66px; box-sizing: border-box; }
@keyframes ping { 0% { transform: scale(0.55); opacity: 0.55; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .radar span, .dot.on, .row.is-new { animation: none; } }

/* ---------- leitura ---------- */
.reader { padding: 20px 24px 28px; }
.reader h2 { margin: 18px 0 12px; font-size: 1.45rem; overflow-wrap: anywhere; }
.r-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.attachments a, .attachments span { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.88rem; text-decoration: none; color: var(--text); background: var(--bg); }
.attachments a:hover { border-color: var(--primary); }
.r-body { margin-top: 18px; }
.r-body iframe { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-height: 200px; }
.r-body pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0; padding: 16px; background: var(--bg); border-radius: 12px; }
.r-foot { margin-top: 20px; }

/* ---------- vantagens / info ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.f-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); }
.feature h3 { margin: 16px 0 6px; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.96rem; }

.info { margin-top: 60px; }
.info h2 { font-size: 1.65rem; margin: 0 0 20px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps .n { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 800; }
.steps p { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
.faq { display: grid; gap: 10px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; }
summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
details p { margin: 0 0 16px; color: var(--muted); }

.footer { margin-top: 72px; padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 20;
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px;
  font-size: 0.93rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- paginas internas (admin / api) ---------- */
.page-top { background: linear-gradient(180deg, var(--hero-a), var(--hero-b)); }
.page-top .topbar { position: static; }
.addr-label.dark { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 0.9rem; margin: 0 0 6px; }
.dom { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }

/* ---------- responsivo ---------- */
@media (max-width: 720px) {
  .features, .steps { grid-template-columns: 1fr; }
  .addr-row { flex-direction: column; }
  .btn-lg { padding: 14px 24px; }
  .hero { padding: 108px 0 96px; }
  .nav a:not(.nav-cta) { display: none; }
  .row { padding: 14px 16px; }
}

/* ---------- controles de formulario no padrao do site ---------- */
::selection { background: color-mix(in srgb, var(--primary) 32%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
input, select, button, textarea { font-family: inherit; }
::placeholder { color: var(--muted); opacity: 0.75; }
input, select { caret-color: var(--primary); }

/* select: seta propria, sem a aparencia do sistema */
select,
select.input {
  -webkit-appearance: none; appearance: none;
  padding-right: 40px;
  background-color: var(--bg);
  background-image: var(--chev);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
select:hover, select.input:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
select:focus-visible, select.input:focus-visible { outline: none; border-color: var(--primary); }
select option { background: var(--surface); color: var(--text); }

/* numero: sem as setas nativas (usa .stepper) */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.stepper {
  display: inline-flex; align-items: stretch; flex: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: border-color 0.15s;
}
.stepper:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.stepper:focus-within { border-color: var(--primary); }
.stepper input {
  width: 58px; min-width: 0; padding: 12px 0; text-align: center; font: inherit; font-weight: 600;
  color: var(--text); background: transparent; border: 0; outline: 0;
}
.stepper .step {
  width: 38px; display: grid; place-items: center; padding: 0; font-size: 1.15rem; font-weight: 700; line-height: 1;
  color: var(--muted); background: transparent; border: 0; cursor: pointer; user-select: none;
  transition: background 0.12s, color 0.12s;
}
.stepper .step:hover { background: var(--primary-soft); color: var(--primary); }
.stepper .step:active { transform: translateY(1px); }
.stepper .step:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; color: var(--muted); }

/* autopreenchimento do navegador sem o fundo amarelo/azul */
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 100px var(--bg) inset;
  transition: background-color 9999s ease-out;
}

/* perguntas frequentes: marcador proprio */
details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.2s;
}
details[open] > summary::after { transform: rotate(-135deg); }

/* ---------- menu suspenso proprio (substitui a lista nativa do select) ---------- */
.dd { position: relative; display: inline-block; }
.dd-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 13px 14px; font: inherit; color: var(--text); text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color 0.15s;
}
.dd-btn:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.dd-btn:focus-visible, .dd.open .dd-btn { outline: none; border-color: var(--primary); }
.dd-chev { flex: none; color: var(--muted); transition: transform 0.18s; }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-menu {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 100%;
  margin: 0; padding: 6px; list-style: none; outline: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); animation: dd-in 0.12s ease-out;
}
.dd-menu.up { top: auto; bottom: calc(100% + 6px); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.dd-opt.active { background: var(--primary-soft); }
.dd-opt[aria-selected="true"] { font-weight: 700; color: var(--primary); }
.dd-opt[aria-selected="true"]::after { content: ""; width: 5px; height: 10px; margin-right: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px, -2px); }
@media (prefers-reduced-motion: reduce) { .dd-menu { animation: none; } }
