/* ============================================
   DESIGN TOKENS — Max Monitoramento
   Premium dual-theme (light + dark)
   ============================================ */

:root {
  /* ---- BRAND COLORS (fixed) ---- */
  --brand-navy: #0a2540;
  --brand-navy-deep: #061a30;
  --brand-blue: #1b4f8c;
  --brand-accent: #1e6fd9;
  --brand-accent-hover: #1759b5;
  --brand-accent-light: #4a8fe3;
  --brand-cyan: #38bdf8;

  /* ---- TYPOGRAPHY ---- */
  --font-display: "Sora", system-ui, -apple-system, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;
  --fs-4xl: clamp(2.5rem, 5vw, 3.5rem);
  --fs-5xl: clamp(3rem, 6vw, 4.5rem);
  --fs-6xl: clamp(3.5rem, 7vw, 5.5rem);

  --lh-tight: 1.05;
  --lh-snug: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  --tracking-tighter: -0.04em;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.08em;

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* ---- SPACING ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---- RADII ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* ---- LAYOUT ---- */
  --container-max: 1280px;
  --container-padding: clamp(1.25rem, 4vw, 2rem);
  --section-padding-y: clamp(5rem, 10vw, 8rem);

  /* ---- MOTION ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 450ms;
  --duration-slower: 700ms;

  /* ---- Z-INDEX ---- */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-tooltip: 600;
  --z-floating: 999;
}

/* ============================================
   LIGHT THEME (default)
   ============================================ */
:root,
[data-theme="light"] {
  color-scheme: light;

  --color-bg: #ffffff;
  --color-bg-alt: #f7f9fc;
  --color-bg-soft: #eef2f8;
  --color-bg-elevated: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #f6f8fc;
  --color-surface-translucent: rgba(255, 255, 255, 0.72);

  --color-surface-dark: #0a2540;
  --color-surface-dark-alt: #0c2c4a;

  --color-border: #e4e9f2;
  --color-border-soft: #eff2f7;
  --color-border-strong: #cfd7e4;

  --color-text: #0a2540;
  --color-text-secondary: #4a5a75;
  --color-text-muted: #8593a8;
  --color-text-inverse: #ffffff;

  --color-primary: var(--brand-navy);
  --color-primary-light: var(--brand-blue);
  --color-accent: var(--brand-accent);
  --color-accent-hover: var(--brand-accent-hover);
  --color-accent-light: var(--brand-accent-light);

  --color-danger: #e53e3e;
  --color-danger-soft: rgba(229, 62, 62, 0.1);
  --color-success: #10b981;
  --color-warning: #f59e0b;

  --gradient-primary: linear-gradient(135deg, #1e6fd9 0%, #4a8fe3 100%);
  --gradient-primary-soft: linear-gradient(
    135deg,
    rgba(30, 111, 217, 0.1) 0%,
    rgba(74, 143, 227, 0.05) 100%
  );
  --gradient-dark: linear-gradient(135deg, #0a2540 0%, #1b4f8c 100%);
  --gradient-hero:
    radial-gradient(
      circle at 20% 0%,
      rgba(30, 111, 217, 0.12) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 30%,
      rgba(74, 143, 227, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(10, 37, 64, 0.04) 0%,
      transparent 60%
    );
  --gradient-mesh:
    radial-gradient(at 20% 20%, rgba(30, 111, 217, 0.1) 0px, transparent 50%),
    radial-gradient(at 80% 30%, rgba(74, 143, 227, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(10, 37, 64, 0.05) 0px, transparent 50%);
  --gradient-text: linear-gradient(
    135deg,
    #0a2540 0%,
    #1e6fd9 60%,
    #4a8fe3 100%
  );
  --gradient-card: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(247, 249, 252, 0.4) 100%
  );

  --shadow-xs: 0 1px 2px rgba(10, 37, 64, 0.05);
  --shadow-sm:
    0 2px 6px rgba(10, 37, 64, 0.07), 0 1px 2px rgba(10, 37, 64, 0.04);
  --shadow-md:
    0 6px 18px rgba(10, 37, 64, 0.09), 0 3px 6px rgba(10, 37, 64, 0.05);
  --shadow-lg:
    0 18px 40px rgba(10, 37, 64, 0.12), 0 6px 16px rgba(10, 37, 64, 0.06);
  --shadow-xl:
    0 28px 72px rgba(10, 37, 64, 0.15), 0 10px 28px rgba(10, 37, 64, 0.08);
  --shadow-2xl:
    0 56px 112px rgba(10, 37, 64, 0.2), 0 16px 36px rgba(10, 37, 64, 0.1);
  --shadow-glow:
    0 0 0 1px rgba(30, 111, 217, 0.1), 0 8px 32px rgba(30, 111, 217, 0.16);
  --shadow-glow-strong:
    0 0 0 1px rgba(30, 111, 217, 0.2), 0 16px 48px rgba(30, 111, 217, 0.28);
  --shadow-inner: inset 0 1px 2px rgba(10, 37, 64, 0.05);

  --grid-color: rgba(10, 37, 64, 0.06);
  --grid-color-strong: rgba(10, 37, 64, 0.1);
  --noise-opacity: 0.018;

  /* Subtle textured background — visible only on bg, very gentle */
  --bg-texture:
    radial-gradient(
      circle at 15% 12%,
      rgba(30, 111, 217, 0.035) 0%,
      transparent 30%
    ),
    radial-gradient(
      circle at 85% 88%,
      rgba(74, 143, 227, 0.028) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(10, 37, 64, 0.015) 0%,
      transparent 45%
    );
}

/* ============================================
   DARK THEME — premium tech aesthetic
   ============================================ */
[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #07101f;
  --color-bg-alt: #0a1626;
  --color-bg-soft: #0e1b2e;
  --color-bg-elevated: #0f1e33;
  --color-surface: #0e1b2e;
  --color-surface-alt: #122440;
  --color-surface-translucent: rgba(14, 27, 46, 0.72);

  --color-surface-dark: #050b16;
  --color-surface-dark-alt: #08111f;

  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-soft: rgba(255, 255, 255, 0.05);
  --color-border-strong: rgba(255, 255, 255, 0.14);

  --color-text: #f0f4fa;
  --color-text-secondary: rgba(240, 244, 250, 0.72);
  --color-text-muted: rgba(240, 244, 250, 0.48);
  --color-text-inverse: #0a2540;

  --color-primary: #ffffff;
  --color-primary-light: #4a8fe3;
  --color-accent: #4a8fe3;
  --color-accent-hover: #6ba4ed;
  --color-accent-light: #7cb2ee;

  --color-danger: #fb7185;
  --color-danger-soft: rgba(251, 113, 133, 0.12);
  --color-success: #34d399;
  --color-warning: #fbbf24;

  --gradient-primary: linear-gradient(135deg, #4a8fe3 0%, #38bdf8 100%);
  --gradient-primary-soft: linear-gradient(
    135deg,
    rgba(74, 143, 227, 0.15) 0%,
    rgba(56, 189, 248, 0.08) 100%
  );
  --gradient-dark: linear-gradient(135deg, #07101f 0%, #122440 100%);
  --gradient-hero:
    radial-gradient(
      circle at 20% 0%,
      rgba(74, 143, 227, 0.22) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 30%,
      rgba(56, 189, 248, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(30, 111, 217, 0.1) 0%,
      transparent 60%
    );
  --gradient-mesh:
    radial-gradient(at 20% 20%, rgba(74, 143, 227, 0.18) 0px, transparent 50%),
    radial-gradient(at 80% 30%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(30, 111, 217, 0.1) 0px, transparent 50%);
  --gradient-text: linear-gradient(
    135deg,
    #ffffff 0%,
    #7cb2ee 60%,
    #38bdf8 100%
  );
  --gradient-card: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );

  --shadow-xs:
    0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-sm:
    0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-md:
    0 6px 18px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-lg:
    0 18px 40px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --shadow-xl:
    0 28px 72px rgba(0, 0, 0, 0.6), 0 10px 28px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-2xl:
    0 56px 112px rgba(0, 0, 0, 0.65), 0 16px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-glow:
    0 0 0 1px rgba(74, 143, 227, 0.25), 0 8px 32px rgba(74, 143, 227, 0.28);
  --shadow-glow-strong:
    0 0 0 1px rgba(74, 143, 227, 0.4), 0 16px 48px rgba(74, 143, 227, 0.4);
  --shadow-inner: inset 0 1px 2px rgba(0, 0, 0, 0.4);

  --grid-color: rgba(255, 255, 255, 0.04);
  --grid-color-strong: rgba(255, 255, 255, 0.08);
  --noise-opacity: 0.025;

  /* Dark theme texture — subtle blue/cyan radials */
  --bg-texture:
    radial-gradient(
      circle at 15% 12%,
      rgba(74, 143, 227, 0.06) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 85% 88%,
      rgba(56, 189, 248, 0.04) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(30, 111, 217, 0.02) 0%,
      transparent 50%
    );
}

/* ============================================
   THEME TRANSITION (suave entre temas)
   ============================================ */
html {
  transition: background-color var(--duration-slow) var(--ease-out);
}

body,
.header,
.card,
section,
.btn,
input,
select,
textarea {
  transition:
    background-color var(--duration-slow) var(--ease-out),
    color var(--duration-slow) var(--ease-out),
    border-color var(--duration-slow) var(--ease-out),
    box-shadow var(--duration-slow) var(--ease-out);
}
