/* ───────────────────────────────────────────────────────────────
   Base: tokens, reset, botões, formulários, cartões, modal, toast
   Para trocar a identidade visual, altere só as variáveis em :root.
   ─────────────────────────────────────────────────────────────── */
:root {
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-serif: "Fraunces", Georgia, serif;

  --brand: #ed2721;          /* vermelho da logomarca */
  --brand-hover: #d4211c;
  --brand-dark: #c01f1a;
  --brand-50: #fef1f0;
  --brand-100: #fde4e2;
  --brand-ring: rgba(237, 39, 33, .22);

  --accent: #ed2721;         /* destaque da página inicial (mesmo vermelho) */
  --accent-hover: #c91f1a;
  --night: #1a1a1a;          /* preto da logomarca: seções escuras */

  --ink: #1a1a1a;
  --ink-2: #27272a;
  --muted: #52525b;
  --muted-2: #71717a;
  --muted-3: #a1a1aa;

  --bg: #f5f5f5;
  --card: #ffffff;
  --line: #e4e4e7;
  --line-2: #f4f4f5;

  --violet-bg: #eeedfe;
  --violet: #3c3489;
  --amber: #d97706;
  --amber-bg: #fdf4e6;
  --blue: #3b82f6;
  --blue-bg: #e8f1fb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --green: #16a34a;
  --green-bg: #e9f8ee;

  --r-sm: 8px;
  --r: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.ic { flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* ── Botões ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r);
  font-size: 14px; font-weight: 500; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-50); }
.btn-ghost { color: #4b5563; }
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-bg); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.cta-grande { padding: 14px 28px; font-size: 16px; min-height: 52px; }

/* ── Formulários ──────────────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > .lbl, .lbl { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { display: block; font-size: 12px; color: var(--muted-2); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: #fff; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: 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='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 6px; color: var(--muted-2); border-radius: 8px; }
.input-wrap .eye:hover { background: var(--line-2); }
.row { display: grid; gap: 14px; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

/* Segmentado ("Você é…" / "Tem prova marcada?") */
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #fff;
  font-size: 14px; font-weight: 600; transition: all .15s;
}
.seg input:checked + span { background: var(--brand-100); border-color: var(--brand); color: var(--brand-dark); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-ring); }

/* Interruptor (Ativa) */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #d6d3d1; border-radius: 99px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--brand-ring); }

/* ── Cartão ───────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--line-2); color: var(--muted); }
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-warn { background: var(--amber-bg); color: var(--amber); }
.badge-brand { background: var(--brand-100); color: var(--brand-dark); }
.badge-red { background: var(--red-bg); color: var(--red); }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-back { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(28, 25, 23, .5); backdrop-filter: blur(2px); }
.modal-back.open { display: flex; }
.modal { width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 26px; animation: pop .18s ease-out; }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal .sub { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Toast ────────────────────────────────────────────────────── */
.toast-box { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: var(--r-md); background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--brand-dark); }

/* ── Alertas inline ───────────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 14px; }
.alert-ok { background: var(--green-bg); color: #166534; }
.alert-err { background: var(--red-bg); color: #991b1b; }
.alert-info { background: #f4f4f5; color: #3f3f46; }

/* Carregando */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #ececeb 25%, #f4f4f3 37%, #ececeb 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-md); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
