/*
 * Digital IA — tema visual compartilhado
 * Etapa 1: tokens e fundação visual.
 * Este arquivo deve ser carregado depois de tokens.css e components.css.
 */

:root {
  --bg: #050b16;
  --background: #050b16;
  --surface: #0b1423;
  --panel: #0e1929;
  --surface2: #132238;
  --panel-hover: #172942;
  --surface3: #1c304b;
  --border: rgba(137, 164, 198, 0.18);
  --border-hover: rgba(232, 182, 75, 0.52);
  --surface-card: rgba(14, 25, 41, 0.92);
  --surface-card-hover: rgba(23, 41, 66, 0.96);
  --surface-overlay: rgba(4, 7, 15, 0.78);
  --surface-subtle: rgba(255, 255, 255, 0.035);
  --border-subtle: rgba(137, 164, 198, 0.16);
  --border-strong: rgba(232, 182, 75, 0.34);

  --gold: #e8b64b;
  --gold-light: #f8d477;
  --gold-dark: #b8892f;
  --gold-soft: #f4ca68;
  --gold-bg: rgba(232, 182, 75, 0.11);
  --gold-bg-hover: rgba(232, 182, 75, 0.18);

  --text: #f5f7fb;
  --foreground: #f5f7fb;
  --text-secondary: #a6b2c5;
  --muted: #91a0b8;
  --text-muted: #7d8ea8;

  --success: #48d6a2;
  --green: #48d6a2;
  --success-bg: rgba(72, 214, 162, 0.12);
  --danger: #ff7180;
  --red: #ff7180;
  --danger-bg: rgba(255, 113, 128, 0.12);
  --warning: #f5c451;
  --warning-bg: rgba(245, 196, 81, 0.13);
  --info: #83b5ff;
  --blue: #83b5ff;
  --info-bg: rgba(131, 181, 255, 0.12);
  --focus-ring: rgba(248, 212, 119, 0.34);
  --focus-ring-strong: rgba(248, 212, 119, 0.72);

  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-card: 18px;
  --radius-control: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.40);
  --shadow-gold: 0 0 0 1px rgba(232, 182, 75, 0.24), 0 14px 40px rgba(232, 182, 75, 0.10);
  --shadow-card: 0 18px 42px rgba(0, 0, 0, 0.24);
  --shadow-focus: 0 0 0 3px var(--focus-ring);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* Hardcoded color tokens (dark theme) */
  --sidebar-top: #0f1525;
  --sidebar-bottom: #111827;
  --topbar-bg: rgba(10, 14, 26, 0.9);
  --divider: rgba(255, 255, 255, 0.05);
  --row-hover: rgba(255, 255, 255, 0.03);
  --row-even: rgba(255, 255, 255, 0.02);
  --input-bg: rgba(0, 0, 0, 0.2);
  --input-focus-bg: rgba(0, 0, 0, 0.3);
  --overlay-bg: rgba(0, 0, 0, 0.6);
  --attention-bg: linear-gradient(145deg, #122039, #0d192c);
  --ai-bg: linear-gradient(160deg, #121a2e, #0c1424);
  --ai-border: rgba(212, 168, 67, 0.1);
  --upgrade-bg: linear-gradient(140deg, rgba(212,168,67,0.08), rgba(212,168,67,0.02));
  --upgrade-border: rgba(212,168,67,0.15);
  --avatar-gold-bg: #b9985d;
  --avatar-gold-text: #17130d;
  --body-glow-blue: rgba(28, 57, 91, 0.28);
  --body-glow-gold: rgba(232, 182, 75, 0.05);
  --badge-muted-bg: rgba(100, 100, 120, 0.12);
  --card-header-bg: linear-gradient(180deg, rgba(20, 37, 60, 0.44), rgba(12, 25, 42, 0.2));
  --search-compact-bg: rgba(7, 17, 31, 0.48);
  --table-pager-bg: rgba(7, 17, 31, 0.2);
  --attention-card-bg: rgba(7, 17, 31, 0.64);
  --ai-message-bg: rgba(7, 17, 31, 0.36);
  --ai-suggestion-bg: rgba(18, 36, 58, 0.72);
  --deadline-item-bg: rgba(18, 36, 58, 0.64);
  --ai-panel-bg: radial-gradient(circle at 14% 12%, rgba(232, 182, 75, 0.12), transparent 12rem), linear-gradient(155deg, rgba(35, 39, 46, 0.88), rgba(11, 25, 41, 0.96));
}

/* === Light Theme === */
[data-theme="light"] {
  --bg: #ffffff;
  --background: #ffffff;
  --surface: #ffffff;
  --panel: #ffffff;
  --surface2: #f5f7fa;
  --panel-hover: #f0f2f5;
  --surface3: #e5e8ed;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(184, 137, 47, 0.5);
  --surface-card: #ffffff;
  --surface-card-hover: #f9fafb;
  --surface-overlay: rgba(0, 0, 0, 0.3);
  --surface-subtle: rgba(0, 0, 0, 0.02);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(184, 137, 47, 0.45);

  --gold: #9a6d1f;
  --gold-light: #b8892f;
  --gold-dark: #7a5718;
  --gold-soft: #c9a24a;
  --gold-bg: rgba(184, 137, 47, 0.07);
  --gold-bg-hover: rgba(184, 137, 47, 0.12);

  --text: #111827;
  --foreground: #111827;
  --text-secondary: #4b5563;
  --muted: #6b7280;
  --text-muted: #9ca3af;

  --success: #059669;
  --green: #059669;
  --success-bg: rgba(5, 150, 105, 0.07);
  --danger: #dc2626;
  --red: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.07);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.07);
  --info: #2563eb;
  --blue: #2563eb;
  --info-bg: rgba(37, 99, 235, 0.07);
  --focus-ring: rgba(184, 137, 47, 0.25);
  --focus-ring-strong: rgba(184, 137, 47, 0.45);

  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-gold: 0 0 0 1px rgba(184, 137, 47, 0.15);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);

  /* Hardcoded color tokens (light theme) */
  --sidebar-top: #ffffff;
  --sidebar-bottom: #fafbfc;
  --topbar-bg: rgba(255, 255, 255, 0.95);
  --divider: rgba(0, 0, 0, 0.06);
  --row-hover: rgba(0, 0, 0, 0.025);
  --row-even: rgba(0, 0, 0, 0.015);
  --input-bg: #f9fafb;
  --input-focus-bg: #ffffff;
  --overlay-bg: rgba(0, 0, 0, 0.3);
  --attention-bg: #f9fafb;
  --ai-bg: #fffbeb;
  --ai-border: rgba(184, 137, 47, 0.12);
  --upgrade-bg: rgba(184, 137, 47, 0.04);
  --upgrade-border: rgba(184, 137, 47, 0.15);
  --avatar-gold-bg: #d4a843;
  --avatar-gold-text: #111827;
  --body-glow-blue: transparent;
  --body-glow-gold: transparent;
  --badge-muted-bg: rgba(0, 0, 0, 0.05);
  --card-header-bg: var(--surface-subtle);
  --search-compact-bg: var(--input-bg);
  --table-pager-bg: var(--surface-subtle);
  --attention-card-bg: var(--surface2);
  --ai-message-bg: var(--surface-subtle);
  --ai-suggestion-bg: var(--surface2);
  --deadline-item-bg: var(--surface2);
  --ai-panel-bg: var(--ai-bg);
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 80% -10%, var(--body-glow-blue), transparent 34rem),
    radial-gradient(circle at 10% 20%, var(--body-glow-gold), transparent 28rem),
    var(--bg);
}

button,
a,
.form-input,
.search-button,
.nav-item,
.panel,
.card,
.stat-card {
  -webkit-tap-highlight-color: transparent;
}

button:active,
.btn:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .nav-item,
  .panel,
  .card,
  .stat-card,
  .feature-card,
  .landing-preview {
    transition-timing-function: var(--ease-out);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* === Light theme overrides for login/landing === */
[data-theme="light"] .landing-nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .landing-nav .btn-outline {
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary);
}

[data-theme="light"] .landing .feature-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .landing .feature-card .feature-icon {
  border-color: rgba(184, 137, 47, 0.15);
  background: rgba(184, 137, 47, 0.06);
}

[data-theme="light"] .landing .cta-section .cta-card {
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .landing .landing-footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .auth-showcase {
  background: linear-gradient(135deg, rgba(249, 250, 251, 0.66), rgba(255, 255, 255, 0.10) 58%),
    radial-gradient(circle at 25% 50%, rgba(184, 137, 47, 0.04), transparent 26rem);
}

[data-theme="light"] .auth-form-panel {
  background: rgba(249, 250, 251, 0.52);
}

[data-theme="light"] .auth-form-card {
  background: #ffffff;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .auth-form-card .form-input {
  border-color: rgba(0, 0, 0, 0.1);
  background: #f9fafb;
}

[data-theme="light"] .auth-benefit {
  background: rgba(249, 250, 251, 0.6);
}

[data-theme="light"] .auth-screen::before {
  background: rgba(184, 137, 47, 0.04);
}

[data-theme="light"] .auth-screen::after {
  background: rgba(37, 99, 235, 0.04);
}

[data-theme="light"] .chat-bubble.assistant {
  background: #f5f7fa;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .sidebar {
  border-right-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

[data-theme="light"] .modal {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .confirm-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cmdk-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .trust-strip {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .trust-item {
  border-right-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .trust-icon {
  border-color: rgba(184, 137, 47, 0.15);
}

[data-theme="light"] .landing-footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .features-section {
  border-top-color: rgba(0, 0, 0, 0.06);
}
