/* Design system: É Golpe ou não é? */
/* Institutional, calm, high-legibility. Inspired by Brazilian government
   design principles but original. */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font: 'Public Sans', -apple-system, system-ui, sans-serif;

  /* Brand */
  --brand-navy: #0A2A66;
  --brand-blue: #1351B4;
  --brand-blue-soft: #E6EEFB;
  --brand-yellow: #FFCD07;

  /* Neutrals */
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF6;
  --border: #DDD8CB;
  --border-strong: #B9B2A0;
  --ink: #14181F;
  --ink-soft: #2B3441;
  --muted: #5E6573;
  --muted-2: #8A8E97;

  /* Status — clear, gov-clinic style */
  --danger: #B30015;
  --danger-strong: #800010;
  --danger-bg: #FDEAEC;
  --danger-line: #F4B7BE;

  --success: #167A3C;
  --success-bg: #E4F3EA;
  --success-line: #B7DCC6;

  --warn: #A65F00;
  --warn-bg: #FFF3DB;
  --warn-line: #F0CD8B;

  /* Spacing scale */
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 14px;

  /* Shadow */
  --shadow-1: 0 1px 0 rgba(20,24,31,.04), 0 1px 2px rgba(20,24,31,.06);
  --shadow-2: 0 4px 14px rgba(20,24,31,.08);
}

* { box-sizing: border-box; }
.app, .app * { font-family: var(--font); -webkit-font-smoothing: antialiased; }

.app {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Top "gov bar" — a thin id strip at the very top, like the official
   Brazilian government bar. Used on most screens. ─────────────── */
.gov-strip {
  height: 6px;
  background: linear-gradient(90deg, var(--brand-yellow) 0 33%, #1B9B47 33% 66%, var(--brand-blue) 66% 100%);
  flex: 0 0 6px;
}

/* ── App header ──────────────────────────────────────────────── */
.app-header {
  background: var(--brand-navy);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.app-header .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.2px; font-size: 17px;
}
.app-header .brand-mark {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--brand-yellow); color: var(--brand-navy);
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; letter-spacing: -1px;
}
.app-header .ic-btn {
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  width: 40px; height: 40px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
}
.app-header .spacer { flex: 1; }

/* ── Content ─────────────────────────────────────────────────── */
.content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 18px 100px;
}
.content.no-pad { padding: 0; }

.section-title {
  font-size: 14px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted);
  margin: 22px 0 10px;
}

h1.h1 {
  font-size: 28px; line-height: 1.15; font-weight: 800;
  letter-spacing: -0.5px; color: var(--ink);
  margin: 0 0 8px;
  text-wrap: balance;
}
h2.h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--ink); margin: 0 0 8px;
}
p.lede {
  font-size: 18px; color: var(--ink-soft);
  margin: 0 0 16px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  height: 54px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: 10px;
  font-family: inherit; font-size: 18px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform .04s ease;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--brand-blue); color: #fff;
}
.btn-primary:hover { background: #0E45A0; }
.btn-secondary {
  background: var(--surface); color: var(--brand-blue);
  border-color: var(--brand-blue);
}
.btn-quiet {
  background: transparent; color: var(--ink-soft);
}
.btn-danger {
  background: var(--danger); color: #fff;
}
.btn-link {
  background: transparent; color: var(--brand-blue);
  font-weight: 600; padding: 0; height: auto;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ── Action card (home menu items) ──────────────────────────── */
.action-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .04s;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}
.action-card:hover { border-color: var(--brand-blue); }
.action-card:active { transform: translateY(1px); }
.action-card .ic {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--brand-blue-soft); color: var(--brand-blue);
  display: grid; place-items: center;
}
.action-card .title {
  font-size: 19px; font-weight: 700; color: var(--ink);
  margin: 0 0 2px;
}
.action-card .desc {
  font-size: 15px; color: var(--muted); margin: 0;
}
.action-card .chev {
  color: var(--muted-2);
}

/* ── Result hero (scam / safe / suspicious) ─────────────────── */
.result-hero {
  border-radius: 0;
  padding: 36px 22px 28px;
  color: #fff;
}
.result-hero.scam { background: var(--danger); }
.result-hero.safe { background: var(--success); }
.result-hero.warn { background: var(--warn); }
.result-hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase;
}
.result-hero .verdict {
  font-size: 34px; font-weight: 800; line-height: 1.05;
  margin: 14px 0 8px; letter-spacing: -0.8px;
  text-wrap: balance;
}
.result-hero .summary {
  font-size: 17px; line-height: 1.45;
  opacity: .95; max-width: 32ch;
}
.result-hero .score {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 18px;
}
.result-hero .score .n { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.result-hero .score .l { font-size: 14px; opacity: .8; }

/* ── Lists & evidence ─────────────────────────────────────── */
.evidence {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 16px;
  margin-bottom: 12px;
}
.evidence .row {
  display: grid; grid-template-columns: 28px 1fr;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 16px;
}
.evidence .row:last-child { border-bottom: 0; }
.evidence .row .ic { color: var(--danger); padding-top: 2px; }
.evidence .row.safe .ic { color: var(--success); }
.evidence .row.warn .ic { color: var(--warn); }
.evidence .row .what { color: var(--ink); font-weight: 600; }
.evidence .row .why { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ── Inputs ──────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 15px; font-weight: 600;
  color: var(--ink); margin-bottom: 6px;
}
.field .help { font-size: 14px; color: var(--muted); margin-top: 4px; }
.input, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: inherit; font-size: 18px; color: var(--ink);
}
.textarea { resize: none; min-height: 140px; }
.input:focus, .textarea:focus { outline: none; border-color: var(--brand-blue); }

/* ── Dropzone ────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
}
.dropzone .dz-ic {
  width: 64px; height: 64px; margin: 0 auto 10px;
  border-radius: 32px; background: var(--brand-blue-soft);
  color: var(--brand-blue);
  display: grid; place-items: center;
}
.dropzone .dz-t { font-size: 17px; font-weight: 700; }
.dropzone .dz-s { font-size: 14px; color: var(--muted); margin-top: 4px; }
.dropzone .dz-pill {
  display: inline-block; margin-top: 12px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--brand-blue); color: #fff;
  font-size: 14px; font-weight: 600;
}

/* ── Bottom bar (mobile) ─────────────────────────────────── */
.bottom-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid var(--border);
  padding: 12px 16px 18px;
  display: flex; gap: 10px;
}
.tab-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid var(--border);
  padding: 8px 8px 14px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.tab-bar .tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0;
  font-size: 12px; font-weight: 600;
  color: var(--muted-2);
}
.tab-bar .tab.active { color: var(--brand-blue); }
.tab-bar .tab .ic { width: 24px; height: 24px; }

/* ── Chips / pills ───────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-soft);
}
.chip.tone-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-strong); }
.chip.tone-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.chip.tone-safe { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.chip.tone-info { background: var(--brand-blue-soft); border-color: #BFD3F1; color: var(--brand-blue); }

/* ── Banner ──────────────────────────────────────────────── */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  font-size: 15px; line-height: 1.4;
  margin-bottom: 14px;
}
.banner.info { background: var(--brand-blue-soft); color: var(--brand-navy); border: 1px solid #BFD3F1; }
.banner.danger { background: var(--danger-bg); color: var(--danger-strong); border: 1px solid var(--danger-line); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.banner .ic { flex: 0 0 24px; padding-top: 1px; }
.banner b { font-weight: 700; }

/* ── Steps progress ──────────────────────────────────────── */
.steps {
  display: flex; gap: 6px; margin-bottom: 18px;
}
.steps .s {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--border);
}
.steps .s.done { background: var(--brand-blue); }
.steps .s.cur { background: var(--brand-blue); }

/* ── QR placeholder ──────────────────────────────────────── */
.qr-frame {
  width: 220px; height: 220px; margin: 8px auto 0;
  background: #fff; border: 2px solid var(--border-strong);
  border-radius: 12px; padding: 12px; position: relative;
}
.qr-frame .corner {
  position: absolute; width: 22px; height: 22px;
  border: 3px solid var(--brand-blue);
}
.qr-frame .c-tl { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.qr-frame .c-tr { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.qr-frame .c-bl { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.qr-frame .c-br { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

/* TTS button */
.tts-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-blue-soft);
  color: var(--brand-navy);
  border: 1.5px solid #BFD3F1;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.tts-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-blue); }

/* ── Loading dots ──────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}
.loading-dots { display: inline-flex; gap: 6px; }
.loading-dots span {
  width: 10px; height: 10px; border-radius: 5px;
  background: var(--brand-blue);
  animation: pulse-dot 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }

/* Scanning shimmer for processing screen */
@keyframes scan-line {
  0% { transform: translateY(-30%); }
  100% { transform: translateY(130%); }
}
.scan-doc {
  position: relative;
  width: 220px; height: 280px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px; margin: 8px auto;
  overflow: hidden;
}
.scan-doc .line {
  height: 8px; background: #ECE7DA; border-radius: 4px;
  margin-bottom: 10px;
}
.scan-doc .line.short { width: 60%; }
.scan-doc .line.med { width: 80%; }
.scan-doc .scan-bar {
  position: absolute; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(180deg, rgba(19,81,180,0) 0%, rgba(19,81,180,.25) 50%, rgba(19,81,180,0) 100%);
  animation: scan-line 1.8s infinite linear;
}

/* WhatsApp-message style chat preview */
.chat-prev {
  background: #ECE5DD; padding: 12px 10px;
  border-radius: 12px;
}
.chat-prev .bub {
  background: #fff; padding: 8px 10px;
  border-radius: 8px; max-width: 80%;
  font-size: 14px; color: #111; margin-bottom: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
  position: relative;
}
.chat-prev .bub.me {
  background: #DCF8C6; margin-left: auto;
}
.chat-prev .bub .time { font-size: 11px; color: #888; margin-left: 8px; }

/* Highlight in chat — for evidence */
.chat-prev .bub mark {
  background: #FFE9A6; color: var(--ink);
  padding: 1px 3px; border-radius: 3px;
  border-bottom: 2px solid var(--danger);
}

/* Audio waveform mock */
.wave { display: inline-flex; align-items: center; gap: 2px; }
.wave i { display: block; width: 3px; background: var(--brand-blue); border-radius: 2px; }

/* Desktop layout shell */
.desk {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
}
.desk .side {
  background: var(--brand-navy); color: #fff;
  padding: 24px 18px;
  display: flex; flex-direction: column;
  gap: 4px;
}
.desk .side .brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 30px;
}
.desk .side .brand-mark {
  width: 36px; height: 36px; border-radius: 7px;
  background: var(--brand-yellow); color: var(--brand-navy);
  display: grid; place-items: center; font-weight: 800; font-size: 20px; letter-spacing: -1px;
}
.desk .side .brand-name { font-weight: 700; font-size: 16px; line-height: 1.15; }
.desk .side .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px;
  border-radius: 8px;
  font-size: 15px; color: rgba(255,255,255,.85);
  cursor: pointer;
}
.desk .side .nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.desk .side .nav-item .ic { width: 20px; height: 20px; opacity: .9; }
.desk .main { overflow: auto; padding: 36px 44px; }
