/* Identidade Frédy: azul + branco, modo escuro automático (ou forçado via data-theme). */
:root {
  --navy: #0f2239;
  --navy-2: #16304f;
  --blue: #2e9fd9;
  --blue-2: #1f7fb5;
  --blue-soft: #e6f4fb;
  --blue-soft-2: #cfe9f7;
  --bg: #f3f7fb;
  --bg-2: #e9f0f6;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --text: #0f2239;
  --muted: #5b6b7f;
  --muted-2: #8a98a9;
  --border: #dfe7ef;
  --border-2: #c9d5e1;
  --accent: var(--blue);
  --accent-ink: #ffffff;
  --accent-text: #1a7ab3;
  --success: #1f9d6a;
  --success-soft: #e3f7ee;
  --warn: #c7811b;
  --warn-soft: #fff4e0;
  --danger: #d6455d;
  --danger-soft: #fdeaee;
  --shadow: 0 1px 2px rgba(15, 34, 57, 0.04), 0 8px 24px -12px rgba(15, 34, 57, 0.18);
  --shadow-lg: 0 2px 4px rgba(15, 34, 57, 0.06), 0 24px 48px -16px rgba(15, 34, 57, 0.28);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --hero-overlay: linear-gradient(180deg, rgba(15, 34, 57, 0.25) 0%, rgba(15, 34, 57, 0.72) 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0b1826;
    --navy-2: #122235;
    --blue: #3db0e8;
    --blue-2: #6cc4f0;
    --blue-soft: #10283d;
    --blue-soft-2: #163650;
    --bg: #0b1826;
    --bg-2: #0f1f31;
    --surface: #122235;
    --surface-2: #172b41;
    --text: #e8f0f7;
    --muted: #9fb1c4;
    --muted-2: #6f8398;
    --border: #1f3348;
    --border-2: #2b4259;
    --accent: #3db0e8;
    --accent-ink: #061320;
    --accent-text: #6cc4f0;
    --success: #3ccb8c;
    --success-soft: #0f3326;
    --warn: #f0b24a;
    --warn-soft: #3a2a0c;
    --danger: #ff7a8e;
    --danger-soft: #3c1420;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    --hero-overlay: linear-gradient(180deg, rgba(5, 12, 22, 0.35) 0%, rgba(5, 12, 22, 0.85) 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #0b1826;
  --navy-2: #122235;
  --blue: #3db0e8;
  --blue-2: #6cc4f0;
  --blue-soft: #10283d;
  --blue-soft-2: #163650;
  --bg: #0b1826;
  --bg-2: #0f1f31;
  --surface: #122235;
  --surface-2: #172b41;
  --text: #e8f0f7;
  --muted: #9fb1c4;
  --muted-2: #6f8398;
  --border: #1f3348;
  --border-2: #2b4259;
  --accent: #3db0e8;
  --accent-ink: #061320;
  --accent-text: #6cc4f0;
  --success: #3ccb8c;
  --success-soft: #0f3326;
  --warn: #f0b24a;
  --warn-soft: #3a2a0c;
  --danger: #ff7a8e;
  --danger-soft: #3c1420;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  --hero-overlay: linear-gradient(180deg, rgba(5, 12, 22, 0.35) 0%, rgba(5, 12, 22, 0.85) 100%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; }
p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
svg.ico { width: 18px; height: 18px; flex: none; vertical-align: -4px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  background: var(--surface); color: var(--text); border-color: var(--border-2);
}
.btn:hover { border-color: var(--blue); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(46, 159, 217, .6); }
.btn-primary:hover { background: var(--blue-2); border-color: transparent; }
.btn-navy { background: var(--navy); color: #fff; border-color: transparent; }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-soft { background: var(--blue-soft); color: var(--accent-text); border-color: transparent; }
.btn-soft:hover { background: var(--blue-soft-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn .ico { width: 16px; height: 16px; flex: none; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); background: var(--surface); }
.input.is-big { font-size: 20px; font-weight: 700; padding: 14px 14px; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.hint { font-size: 12px; color: var(--muted-2); line-height: 1.45; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); margin: 0; }
.radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.radio input { accent-color: var(--blue); margin: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Cartões / util ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--blue-soft); color: var(--accent-text); }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { height: 28px; width: auto; }
.brand-logo-dark { display: none; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; max-width: min(92vw, 420px); }
.toast.is-error { background: var(--danger); }
.toast.is-success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tema ---------- */
.theme-toggle { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.theme-toggle:hover { color: var(--accent-text); border-color: var(--blue); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* ---------- Skeleton / loading ---------- */
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
::selection { background: color-mix(in srgb, var(--blue) 35%, transparent); }
