/* ============================================================
   temas.css — cores dos temas escuro e claro, por data-theme no <html>
   (sem atributo, com JavaScript desligado, vale o escuro).
   Os nomes curtos (--bg, --surface, --line, --text, --muted...) são
   apelidos no fim do arquivo.
   ============================================================ */

/* ---------------- Tema escuro (padrão) ---------------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --theme-color: #191b1f;

  /* Fundos */
  --bg-primary: #191b1f;
  --bg-sunken: #14161a;
  --bg-header: #202327;
  --bg-sidebar: #202327;

  /* Superfícies, do nível mais baixo ao mais alto */
  --surface-1: #202327;
  --surface-2: #26292e;
  --surface-3: #2d3036;
  --surface-hover: #26292e;

  /* Texto */
  --text-primary: #e2e6e9;
  --text-secondary: #c3c9cf;
  --text-tertiary: #a8afb8;
  --text-muted: #9aa1a9;
  --identity-nick: #ffffff;
  --identity-bg: #2d3236;
  --account-bg: #292e34;
  --account-gold: #c5a354;
  --account-nick: #f0f2f5;
  --account-rank: #c0c7d0;
  --account-portrait: #34393f;
  --identity-portrait: #dce0e3;

  /* Bordas: visíveis sem passar o rato (19/10/2026). A de cards, painéis, botões e campos
     tem 2:1 sobre a superfície; a suave (divisórias internas) e a forte (hover) seguem */
  --border-color: #4d525b;
  --border-soft: #383c43;
  --border-strong: #626872;

  /* Dourado institucional */
  --accent: #eaa506;
  --accent-hover: #d09405;
  --accent-strong: #7a5502;
  --accent-text: #eaa506;
  --accent-soft: rgba(234, 165, 6, .12);
  --on-accent: #1c1c1c;
  --focus-ring: #eaa506;
  --focus-halo: rgba(234, 165, 6, .18);

  /* Campos */
  /* Campos sobre a superfície elevada (--bg-3, tokens.css); placeholder em --text-4 */
  --input-bg: var(--surface-2);
  --input-border: #4d525b;
  --input-placeholder: var(--text-4);
  --input-autofill: #221f17;

  /* Estados */
  --success: #35c46a;
  --success-text: #6fe09a;
  --success-soft: rgba(53, 196, 106, .12);
  --success-border: rgba(53, 196, 106, .42);
  --warning: #f8a34f;
  --warning-text: #f0bd6d;
  --warning-soft: rgba(232, 161, 58, .14);
  --warning-border: rgba(232, 161, 58, .42);
  --danger: #e5484d;
  --danger-text: #ff8f92;
  --danger-soft: rgba(229, 72, 77, .12);
  --danger-border: rgba(229, 72, 77, .42);
  --info: #5aa0ff;
  --info-text: #9cc4ff;
  --info-soft: rgba(90, 160, 255, .1);
  --info-border: rgba(90, 160, 255, .4);

  /* Profundidade discreta; pixel art preservado nas imagens. */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .12);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .16);
  --shadow-3: 0 4px 12px rgba(0, 0, 0, .2);
  --shadow-up: 0 -3px 0 rgba(0, 0, 0, .25);
  --shadow-float: 0 20px 60px rgba(0, 0, 0, .5);
  --shadow-drawer: 12px 0 40px rgba(0, 0, 0, .5);
  --overlay: rgba(0, 0, 0, .6);
  --texture: rgba(255, 255, 255, .012);
  --logo-shadow: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
  --icon-shadow: drop-shadow(1px 1px 0 rgba(0, 0, 0, .5));
  --sprite-shadow: drop-shadow(2px 2px 0 rgba(0, 0, 0, .4));
  --brand-text-shadow: 2px 2px 0 rgba(0, 0, 0, .6);
  --scrollbar-thumb: #2d3036;

  /* Cores de conteúdo */
  --cyan-text: #00bfd8;

  /* Listagens: fundo neutro e moldura dourada dos retratos dos militares */
  --portrait-bg: #6f747c;
  --portrait-frame: #eaa506;

  /* Telas de acesso */
  --access-panel: #1c1e22;
  --access-visual-from: #262a2f;
  --access-visual-to: #16181b;
}

/* ---------------- Tema claro ---------------- */
[data-theme="light"] {
  color-scheme: light;
  --theme-color: #f3f3f0;

  --bg-primary: #f3f3f0;
  --bg-sunken: #ebebe6;
  --bg-header: #ffffff;
  --bg-sidebar: #ffffff;

  --surface-1: #ffffff;
  --surface-2: #f6f6f3;
  --surface-3: #ebebe6;
  --surface-hover: #f1f1ed;

  --text-primary: #1d2024;
  --text-secondary: #363a41;
  --text-tertiary: #4a4f57;
  --text-muted: #636872;
  --identity-nick: #000000;
  --identity-bg: #eef0f2;
  --account-bg: #f0f2f4;
  --account-gold: #ba943b;
  --account-nick: #242b33;
  --account-rank: #5b6470;
  --account-portrait: #e1e4e8;
  --identity-portrait: #e5e8eb;

  --border-color: #c4c4bb;
  --border-soft: #d6d6cf;
  --border-strong: #a8a89f;

  /* O dourado de marca continua a preencher botões e barras; para
     texto e ícones sobre fundo claro usa-se o tom escuro (contraste AA). */
  --accent: #eaa506;
  --accent-hover: #d99a05;
  --accent-strong: #b88300;
  --accent-text: #8f6000;
  --accent-soft: rgba(234, 165, 6, .15);
  --on-accent: #1c1c1c;
  --focus-ring: #a87300;
  --focus-halo: rgba(234, 165, 6, .25);

  --input-bg: var(--surface-2);
  --input-border: #bcbcb3;
  --input-placeholder: var(--text-4);
  --input-autofill: #fbf5e3;
  /* Camada curta de tokens.css no claro: --text-4 com 4,7:1 sobre os campos e sombras leves
     como as --shadow-* deste tema */
  --text-4: color-mix(in srgb, var(--text-muted) 95%, var(--bg-primary));
  --sh-1: 0 1px 2px rgba(29, 32, 36, .08);
  --sh-2: 0 4px 12px rgba(29, 32, 36, .08);
  --sh-3: 0 8px 24px rgba(29, 32, 36, .14);

  --success: #2f9e58;
  --success-text: #18703a;
  --success-soft: rgba(47, 158, 88, .12);
  --success-border: rgba(47, 158, 88, .45);
  --warning: #e08a1e;
  --warning-text: #9a5800;
  --warning-soft: rgba(224, 138, 30, .14);
  --warning-border: rgba(224, 138, 30, .45);
  --danger: #d93a40;
  --danger-text: #b3262c;
  --danger-soft: rgba(217, 58, 64, .1);
  --danger-border: rgba(217, 58, 64, .4);
  --info: #3b7be0;
  --info-text: #2458a8;
  --info-soft: rgba(59, 123, 224, .1);
  --info-border: rgba(59, 123, 224, .4);

  --shadow-1: 0 1px 2px rgba(29, 32, 36, .06);
  --shadow-2: 0 2px 8px rgba(29, 32, 36, .06);
  --shadow-3: 0 4px 12px rgba(29, 32, 36, .08);
  --shadow-up: 0 -1px 0 rgba(29, 32, 36, .04);
  --shadow-float: 0 20px 50px rgba(29, 32, 36, .18);
  --shadow-drawer: 12px 0 40px rgba(29, 32, 36, .16);
  --overlay: rgba(24, 26, 30, .45);
  --texture: rgba(0, 0, 0, .016);
  --logo-shadow: drop-shadow(0 1px 2px rgba(0, 0, 0, .2));
  --icon-shadow: none;
  --sprite-shadow: drop-shadow(2px 2px 0 rgba(0, 0, 0, .12));
  --brand-text-shadow: none;
  --scrollbar-thumb: #c4c4bb;

  --cyan-text: #00768c;

  --portrait-bg: #8b9097;
  --portrait-frame: var(--accent-strong);

  --access-panel: #ffffff;
  --access-visual-from: #ecece8;
  --access-visual-to: #dcdcd6;
}

/* ---------------- Apelidos dos nomes antigos ---------------- */
:root {
  --bg: var(--bg-primary);
  --surface: var(--surface-1);
  --line: var(--border-color);
  --line-soft: var(--border-soft);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --ok: var(--success);
  --warn: var(--warning);
}
