/* =========================================================
   BRsys Mix • Themes Advanced
   Sistema visual premium:
   1) tema base via [data-theme]
   2) fundo via [data-surface]
   3) acento via [data-accent]
   4) profundidade visual premium
   ========================================================= */

/* =========================================================
   ROOT BASE
   ========================================================= */
:root {
  color-scheme: light;

  --bg: #f4f8f5;
  --bg-soft: #edf4ef;
  --bg-elev: #ffffff;

  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --panel-soft: #f7faf8;

  --text: #182028;
  --text-soft: #465464;
  --muted: #6f7c8b;

  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --line-strong: color-mix(in srgb, var(--text) 18%, transparent);

  --primary: #2f7a46;
  --primary-strong: #205a33;
  --primary-contrast: #ffffff;

  --accent: #78a942;
  --accent-2: #c7b76e;

  --hero-overlay-from: rgba(8, 16, 12, 0.28);
  --hero-overlay-mid: rgba(8, 16, 12, 0.48);
  --hero-overlay-to: rgba(8, 16, 12, 0.72);

  --selection-bg: color-mix(in srgb, var(--primary) 22%, white);

  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 18px 38px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.12);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;

  --container: 1180px;

  --bg-glow-1: color-mix(in srgb, var(--primary) 8%, transparent);
  --bg-glow-2: color-mix(in srgb, var(--accent) 8%, transparent);
  --bg-dot: rgba(0, 0, 0, 0.03);
}

/* =========================================================
   TEMAS BASE
   ========================================================= */
html[data-theme="default"],
html:not([data-theme]) {
  color-scheme: light;

  --bg: #f4f8f5;
  --bg-soft: #edf4ef;
  --bg-elev: #ffffff;

  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --panel-soft: #f6faf7;

  --text: #18231d;
  --text-soft: #4a5d50;
  --muted: #718075;

  --primary: #2f7a46;
  --primary-strong: #205a33;
  --primary-contrast: #ffffff;

  --accent: #78a942;
  --accent-2: #c7b76e;

  --hero-overlay-from: rgba(8, 16, 12, 0.26);
  --hero-overlay-mid: rgba(8, 16, 12, 0.46);
  --hero-overlay-to: rgba(8, 16, 12, 0.70);
}

html[data-theme="ocean"] {
  color-scheme: light;

  --bg: #f4f8fc;
  --bg-soft: #edf4fa;
  --bg-elev: #ffffff;

  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --panel-soft: #f5f9fd;

  --text: #182533;
  --text-soft: #476173;
  --muted: #6d8294;

  --primary: #2776c8;
  --primary-strong: #1d5b9d;
  --primary-contrast: #ffffff;

  --accent: #4ab2df;
  --accent-2: #8ed0ec;

  --hero-overlay-from: rgba(8, 20, 34, 0.22);
  --hero-overlay-mid: rgba(8, 20, 34, 0.44);
  --hero-overlay-to: rgba(8, 20, 34, 0.68);
}

html[data-theme="forest"] {
  color-scheme: light;

  --bg: #f4f8f5;
  --bg-soft: #edf4ef;
  --bg-elev: #ffffff;

  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --panel-soft: #f6faf7;

  --text: #18231d;
  --text-soft: #4a5d50;
  --muted: #718075;

  --primary: #2f7a46;
  --primary-strong: #205a33;
  --primary-contrast: #ffffff;

  --accent: #78a942;
  --accent-2: #c7b76e;

  --hero-overlay-from: rgba(8, 16, 12, 0.26);
  --hero-overlay-mid: rgba(8, 16, 12, 0.46);
  --hero-overlay-to: rgba(8, 16, 12, 0.70);
}

html[data-theme="sand"] {
  color-scheme: light;

  --bg: #fcf8f1;
  --bg-soft: #f7f1e7;
  --bg-elev: #fffdfa;

  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #fffdf9;
  --panel-soft: #fbf6ee;

  --text: #2b241d;
  --text-soft: #66584b;
  --muted: #8a7a6b;

  --primary: #b88646;
  --primary-strong: #8e6533;
  --primary-contrast: #ffffff;

  --accent: #cf9f62;
  --accent-2: #dcc48d;

  --hero-overlay-from: rgba(33, 22, 10, 0.18);
  --hero-overlay-mid: rgba(33, 22, 10, 0.42);
  --hero-overlay-to: rgba(33, 22, 10, 0.66);
}

html[data-theme="wine"] {
  color-scheme: light;

  --bg: #fbf6f8;
  --bg-soft: #f5eef2;
  --bg-elev: #fffdfd;

  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #fffdfd;
  --panel-soft: #faf4f7;

  --text: #2a1b22;
  --text-soft: #694d5b;
  --muted: #896f7c;

  --primary: #8f2f58;
  --primary-strong: #6f2343;
  --primary-contrast: #ffffff;

  --accent: #be6f92;
  --accent-2: #d8a3b9;

  --hero-overlay-from: rgba(28, 10, 18, 0.22);
  --hero-overlay-mid: rgba(28, 10, 18, 0.46);
  --hero-overlay-to: rgba(28, 10, 18, 0.70);
}

html[data-theme="rose"] {
  color-scheme: light;

  --bg: #fdf7fa;
  --bg-soft: #f8eff4;
  --bg-elev: #fffefe;

  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #fffefe;
  --panel-soft: #fcf3f7;

  --text: #2d1f29;
  --text-soft: #745666;
  --muted: #947888;

  --primary: #cf6f99;
  --primary-strong: #b05780;
  --primary-contrast: #ffffff;

  --accent: #e59ab7;
  --accent-2: #f0bfd2;

  --hero-overlay-from: rgba(38, 15, 28, 0.18);
  --hero-overlay-mid: rgba(38, 15, 28, 0.40);
  --hero-overlay-to: rgba(38, 15, 28, 0.64);
}

html[data-theme="dark-premium"] {
  color-scheme: dark;

  --bg: #0f1722;
  --bg-soft: #141f2c;
  --bg-elev: #182433;

  --panel: rgba(18, 28, 42, 0.76);
  --panel-strong: rgba(16, 24, 36, 0.94);
  --panel-soft: rgba(22, 32, 48, 0.84);

  --text: #ecf3fb;
  --text-soft: #bfd0e2;
  --muted: #8fa3b8;

  --line: rgba(196, 214, 233, 0.10);
  --line-strong: rgba(196, 214, 233, 0.18);

  --primary: #41b883;
  --primary-strong: #2e8f63;
  --primary-contrast: #ffffff;

  --accent: #63c8ff;
  --accent-2: #8dd8bf;

  --hero-overlay-from: rgba(3, 7, 18, 0.28);
  --hero-overlay-mid: rgba(3, 7, 18, 0.54);
  --hero-overlay-to: rgba(3, 7, 18, 0.84);

  --shadow-sm: 0 14px 28px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 24px 48px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 34px 72px rgba(0, 0, 0, 0.42);

  --bg-dot: rgba(255, 255, 255, 0.05);
}

/* =========================================================
   SUPERFÍCIES
   ========================================================= */
html[data-surface="mist"] {
  --bg: #f3f6f4;
  --bg-soft: #edf2ef;
  --panel: rgba(255,255,255,0.88);
  --panel-strong: #ffffff;
  --panel-soft: #f7faf8;
}

html[data-surface="sage"] {
  --bg: #eef5ef;
  --bg-soft: #e6efe7;
  --panel: rgba(255,255,255,0.86);
  --panel-strong: #fbfefb;
  --panel-soft: #f3f8f3;
}

html[data-surface="linen"] {
  --bg: #faf5ee;
  --bg-soft: #f4ede3;
  --panel: rgba(255,255,255,0.90);
  --panel-strong: #fffdf9;
  --panel-soft: #faf4eb;

  --line: rgba(120, 92, 52, 0.12);
  --line-strong: rgba(120, 92, 52, 0.22);
}

html[data-surface="pearl"] {
  --bg: #f4f5f7;
  --bg-soft: #eceff2;
  --panel: rgba(255,255,255,0.90);
  --panel-strong: #ffffff;
  --panel-soft: #f6f8fa;

  --text: color-mix(in srgb, var(--text) 90%, #1d2530);
  --text-soft: color-mix(in srgb, var(--text-soft) 88%, #556170);
  --muted: color-mix(in srgb, var(--muted) 84%, #6b7684);
}

html[data-surface="premium"] {
  --bg: #f6f4ef;
  --bg-soft: #f0ebe2;
  --panel: rgba(255,255,255,0.92);
  --panel-strong: #fffdf8;
  --panel-soft: #faf6ee;

  --line: rgba(120, 92, 52, 0.12);
  --line-strong: rgba(120, 92, 52, 0.22);

  --bg-glow-1: rgba(184, 134, 70, 0.08);
  --bg-glow-2: rgba(215, 194, 122, 0.09);
}

html[data-surface="slate"] {
  color-scheme: dark;

  --bg: #111a26;
  --bg-soft: #172231;
  --bg-elev: #1d2a3b;

  --panel: rgba(25, 37, 54, 0.86);
  --panel-strong: rgba(21, 31, 46, 0.96);
  --panel-soft: rgba(31, 44, 62, 0.92);

  --text: #edf4fb;
  --text-soft: #c3d1df;
  --muted: #95a7b9;

  --line: rgba(211, 224, 238, 0.12);
  --line-strong: rgba(211, 224, 238, 0.20);

  --shadow-sm: 0 14px 28px rgba(0,0,0,0.22);
  --shadow-md: 0 24px 48px rgba(0,0,0,0.32);
  --shadow-lg: 0 34px 72px rgba(0,0,0,0.40);

  --bg-dot: rgba(255,255,255,0.045);
}

/* =========================================================
   ACENTOS
   ========================================================= */
html[data-accent="emerald"] {
  --primary: #2f7a46;
  --primary-strong: #205a33;
  --primary-contrast: #ffffff;
  --accent: #84b94e;
  --accent-2: #c7d98d;
}

html[data-accent="ocean"] {
  --primary: #2776c8;
  --primary-strong: #1d5b9d;
  --primary-contrast: #ffffff;
  --accent: #5cc2e7;
  --accent-2: #95daf0;
}

html[data-accent="gold"] {
  --primary: #b88646;
  --primary-strong: #8e6533;
  --primary-contrast: #ffffff;
  --accent: #d3a25d;
  --accent-2: #e5c78f;
}

html[data-accent="rose"] {
  --primary: #cf6f99;
  --primary-strong: #b05780;
  --primary-contrast: #ffffff;
  --accent: #e7a8c3;
  --accent-2: #f2cadb;
}

html[data-accent="wine"] {
  --primary: #8f2f58;
  --primary-strong: #6f2343;
  --primary-contrast: #ffffff;
  --accent: #c27c9c;
  --accent-2: #ddb1c5;
}

html[data-accent="charcoal"] {
  --primary: #253446;
  --primary-strong: #182433;
  --primary-contrast: #ffffff;
  --accent: #6d8aa4;
  --accent-2: #a9bccd;
}

/* =========================================================
   BASE GLOBAL
   ========================================================= */
html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  background-image:
    radial-gradient(circle at top left, var(--bg-glow-1), transparent 28%),
    radial-gradient(circle at 85% 16%, var(--bg-glow-2), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 50%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 35%),
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 30%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--bg-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.22;
}

::selection {
  background: var(--selection-bg);
  color: var(--text);
}

html[data-theme="dark-premium"] ::selection,
html[data-surface="slate"] ::selection {
  background: color-mix(in srgb, var(--primary) 28%, transparent);
  color: #ffffff;
}

/* =========================================================
   CHIPS BASE
   ========================================================= */
.theme-options {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.theme-chip,
.surface-chip,
.accent-chip {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 8px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.theme-chip:hover,
.surface-chip:hover,
.accent-chip:hover {
  transform: translateY(-1px) scale(1.05);
}

.theme-chip:focus-visible,
.surface-chip:focus-visible,
.accent-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 3px;
}

.theme-chip.is-active,
.surface-chip.is-active,
.accent-chip.is-active {
  transform: scale(1.08);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent),
    0 2px 12px rgba(15, 23, 42, 0.12);
}

/* tema */
.theme-chip[data-theme-value="ocean"] {
  background: linear-gradient(135deg, #2a78cb, #68c8ea);
}

.theme-chip[data-theme-value="forest"] {
  background: linear-gradient(135deg, #2f7a46, #8fbe4b);
}

.theme-chip[data-theme-value="sand"] {
  background: linear-gradient(135deg, #b88646, #dec28b);
}

.theme-chip[data-theme-value="wine"] {
  background: linear-gradient(135deg, #8f2f58, #ca86a5);
}

.theme-chip[data-theme-value="rose"] {
  background: linear-gradient(135deg, #cf6f99, #f0bfd2);
}

.theme-chip[data-theme-value="dark-premium"] {
  background: linear-gradient(135deg, #0f1725, #2f8f63);
  border-color: rgba(255, 255, 255, 0.16);
}

/* surface */
.surface-chip[data-surface-value="mist"] {
  background: linear-gradient(135deg, #eef2ef, #ffffff);
}

.surface-chip[data-surface-value="sage"] {
  background: linear-gradient(135deg, #dce9dd, #f8fcf8);
}

.surface-chip[data-surface-value="linen"] {
  background: linear-gradient(135deg, #efe4d2, #fffaf2);
}

.surface-chip[data-surface-value="pearl"] {
  background: linear-gradient(135deg, #e9edf2, #ffffff);
}

.surface-chip[data-surface-value="premium"] {
  background: linear-gradient(135deg, #e8dcc6, #fffaf0);
}

.surface-chip[data-surface-value="slate"] {
  background: linear-gradient(135deg, #182535, #314761);
  border-color: rgba(255, 255, 255, 0.16);
}

/* accent */
.accent-chip[data-accent-value="emerald"] {
  background: linear-gradient(135deg, #2f7a46, #8fc56a);
}

.accent-chip[data-accent-value="ocean"] {
  background: linear-gradient(135deg, #2776c8, #6dd5ed);
}

.accent-chip[data-accent-value="gold"] {
  background: linear-gradient(135deg, #b88646, #e4c285);
}

.accent-chip[data-accent-value="rose"] {
  background: linear-gradient(135deg, #cf6f99, #f2bfd4);
}

.accent-chip[data-accent-value="wine"] {
  background: linear-gradient(135deg, #8f2f58, #d29ab5);
}

.accent-chip[data-accent-value="charcoal"] {
  background: linear-gradient(135deg, #253446, #8ba0b6);
}

html[data-theme="dark-premium"] .theme-chip,
html[data-theme="dark-premium"] .surface-chip,
html[data-theme="dark-premium"] .accent-chip,
html[data-surface="slate"] .theme-chip,
html[data-surface="slate"] .surface-chip,
html[data-surface="slate"] .accent-chip {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 10px rgba(0, 0, 0, 0.24);
}

/* =========================================================
   CONTROLES
   ========================================================= */
input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  color: var(--text);
  background: var(--panel-strong);
  border-color: var(--line);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

html[data-theme="dark-premium"] input,
html[data-theme="dark-premium"] select,
html[data-theme="dark-premium"] textarea,
html[data-surface="slate"] input,
html[data-surface="slate"] select,
html[data-surface="slate"] textarea {
  background: rgba(17, 27, 40, 0.88);
  color: var(--text);
}

/* =========================================================
   BOTÕES
   ========================================================= */
a {
  color: inherit;
}

.btn-primary,
.btn.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--primary-contrast);
  border-color: color-mix(in srgb, var(--primary) 34%, transparent);
  box-shadow:
    0 14px 24px color-mix(in srgb, var(--primary) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary::after,
.btn.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.18),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::after,
.btn.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:hover,
.btn.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-secondary,
.btn.btn-secondary {
  background: color-mix(in srgb, var(--panel-strong) 92%, white);
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="dark-premium"] .btn-secondary,
html[data-theme="dark-premium"] .btn.btn-secondary,
html[data-surface="slate"] .btn-secondary,
html[data-surface="slate"] .btn.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--line);
}

/* =========================================================
   UTILITÁRIOS
   ========================================================= */
.theme-surface-soft {
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.theme-surface-strong {
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.theme-gradient-soft {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 88%, white), var(--panel-soft));
}

.theme-accent-line {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
}

.theme-accent-text {
  color: var(--primary);
}
