/* Anthropic-inspired Design System CSS */

/* Design System Variables */
:root {
  /* Light mode (default) - Premium Legal SaaS */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F7F4;
  --bg-tertiary: #E8E5DF;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #5A5A6E;
  --text-tertiary: #1A1A2E;
  --text-muted: #8E8E9A;
  --border-color: rgba(26, 26, 46, 0.1);
  --border-hover: rgba(184, 134, 11, 0.5);
  --scrollbar-track: #F8F7F4;
  --scrollbar-thumb: #D4CFC5;
  --nav-bg: rgba(248, 247, 244, 0.95);
  --input-bg: #FFFFFF;
  --input-border: #E8E5DF;
}

html.dark {
  /* Dark mode — neutral black/charcoal palette (no blue tint) */
  --bg-primary: #111111;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2a2a2a;
  --bg-card: #1c1c1c;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #e2e8f0;
  --text-muted: rgba(203, 213, 225, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(245, 158, 11, 0.7);
  --scrollbar-track: #1a1a1a;
  --scrollbar-thumb: #3a3a3a;
  --nav-bg: rgba(10, 10, 10, 0.95);
  --input-bg: #242424;
  --input-border: #3a3a3a;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Example Query Buttons - Override defaults */
button[data-action*="standalone-ai-chat#useExample"],
button[data-action*="ai-chat#useExampleFromWelcome"] {
  background-color: #E8E5DF !important;
  color: #1A1A2E !important;
  border-color: #D4CFC5 !important;
}

button[data-action*="standalone-ai-chat#useExample"]:hover,
button[data-action*="ai-chat#useExampleFromWelcome"]:hover {
  background-color: #F8F7F4 !important;
  border-color: #B8860B !important;
}

button[data-action*="standalone-ai-chat#useExample"]:hover span,
button[data-action*="ai-chat#useExampleFromWelcome"]:hover {
  color: #B8860B !important;
}

/* AI Research Send Button */
button[type="submit"] svg {
  color: #666666 !important;
  stroke: #666666 !important;
}

/* AI Research dropdown menu text */
button[data-action*="ai-chat#selectAgent"] span {
  color: #1A1A1A !important;
}

button[data-action*="ai-chat#selectAgent"] p {
  color: #666666 !important;
}

/* Base Typography & Body */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Fix: Ensure white text works on dark backgrounds (overrides body color) */
.bg-ink,
.bg-ink\/90,
.bg-ink\/80,
.bg-primary-dark {
  color: #FFFFFF;
}

.text-white {
  color: #FFFFFF !important;
}

/* Pricing button hover state - ensures white text on dark background */
.pricing-btn-outline:hover {
  background-color: #111827 !important; /* gray-900 */
  color: #FFFFFF !important;
  border-color: #111827 !important;
}

/* Heading Styles with Serif Font */
/* Exclude markdown content from these global styles */
h1:not(.markdown-content h1):not(.markdown-content *),
h2:not(.markdown-content h2):not(.markdown-content *),
h3:not(.markdown-content h3):not(.markdown-content *),
h4:not(.markdown-content h4):not(.markdown-content *),
h5:not(.markdown-content h5):not(.markdown-content *),
h6:not(.markdown-content h6):not(.markdown-content *) {
  font-family: 'GFS Didot', 'Libre Baskerville', Georgia, serif;
  font-weight: 400;
  color: #1A1A2E;
  letter-spacing: -0.025em;
}

h1:not(.markdown-content h1):not(.markdown-content *) {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.15;
  font-weight: 400;
}

h2:not(.markdown-content h2):not(.markdown-content *) {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
  font-weight: 400;
}

h3:not(.markdown-content h3):not(.markdown-content *) {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.3;
  font-weight: 400;
}

/* Underline decoration for emphasis */
.underline-decoration {
  text-decoration: underline;
  text-decoration-color: #B8860B;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}


/* Link Styles - exclude navigation links to allow Tailwind classes to work */
a:not(header a):not(nav a):not(header nav a) {
  color: #1A1A2E;
  text-decoration: none;
  transition: all 0.2s ease;
}

a:not(header a):not(nav a):not(header nav a):hover {
  text-decoration: underline;
  text-decoration-color: #B8860B;
  text-underline-offset: 4px;
}

/* CTA Button Styles */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background-color: #1e3d2a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-cta:hover {
  background-color: #152b1e;
  box-shadow: 0 4px 12px rgba(30, 61, 42, 0.3);
  text-decoration: none;
}

.btn-cta:active {
  transform: translateY(0);
}

/* btn-cta-green: gold bg with dark text for WCAG AA contrast (7:1 ratio) */
.btn-cta-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background-color: #bf9e5b;
  color: #2d1a00;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-cta-green:hover {
  background-color: #a8894d;
  color: #2d1a00;
  text-decoration: none;
}

/* ── Footer social icon buttons ──────────────────────────────────────────
   Light mode: cream bg + dark ink icon → subtle, elegant
   Dark mode:  white/10 bg + white/70 icon → visible against dark footer bg
   The global `a { color: #1A1A2E }` rule would otherwise make icons
   dark-on-dark in dark mode, which is why we use !important overrides here.
   ─────────────────────────────────────────────────────────────────────── */
.social-icon-btn {
  background-color: #F5F2ED;
  color: rgba(26, 26, 26, 0.55);
  text-decoration: none !important;
}

.social-icon-btn:hover {
  background-color: #1a1a1a;
  color: #ffffff;
  text-decoration: none !important;
}

html.dark .social-icon-btn {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.75) !important;
}

html.dark .social-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

/* Gold outline button — dark text (#4a2e00) on gold border for WCAG AA contrast */
/* #4a2e00 on white = 9.8:1 ✅  |  #4a2e00 on cream #F5F2ED = 8.7:1 ✅ */
.btn-gold-outline {
  border: 1.5px solid #bf9e5b;
  color: #4a2e00;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn-gold-outline:hover {
  background-color: rgba(191, 158, 91, 0.12);
  color: #3a2200;
  text-decoration: none;
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background-color: transparent;
  color: #1A1A2E;
  border: 2px solid #1A1A2E;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #1e3d2a;
  color: #ffffff;
  text-decoration: none;
}

/* Card Styles */
.card {
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 32px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

html.dark .card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Content Container */
.container-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .container-content {
    padding: 0 20px;
  }
}

/* Section Spacing */
.section-spacing {
  padding: 80px 0;
}

@media (max-width: 768px) {
  .section-spacing {
    padding: 40px 0;
  }
}

/* Dropdown Menu Animation */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Arrow Icon for Links */
.arrow-link::after {
  content: "→";
  margin-left: 8px;
  transition: margin-left 0.3s ease;
}

.arrow-link:hover::after {
  margin-left: 12px;
}

/* Grid Layout */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid #B8860B;
  outline-offset: 4px;
}

button:focus,
a:focus {
  outline: 2px solid #B8860B;
  outline-offset: 4px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #B8860B;
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Navigation Transition */
.nav-transition {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-scrolled {
  background-color: rgba(248, 247, 244, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Illustration Accent Color */
.illustration-accent {
  color: #B8860B;
}

/* Text Balance for Headings */
h1, h2, h3 {
  text-wrap: balance;
}

/* Smooth Image Loading - only apply when no explicit height/width is set */
img:not([class*="h-"]):not([class*="w-"]):not([class*="size-"]) {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Utilities */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Home Page Components - Using Tailwind @apply and theme() */
@layer components {
  /* Hero Section Enhancements */
  .hero-section {
    @apply relative overflow-hidden;
  }

  .hero-underline-thick {
    text-decoration: underline;
    text-decoration-color: #B8860B;
    text-decoration-thickness: 4px;
    text-underline-offset: 8px;
  }

  /* Stats Section */
  .stats-section {
    @apply py-16 border-y transition-all duration-300;
    background: linear-gradient(to bottom, #E8E5DF, #F8F7F4);
    border-color: #D4CFC5;
  }

  .stat-card {
    @apply transition-all duration-300 cursor-pointer;
  }

  .stat-card:hover {
    @apply scale-110;
    filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.2));
  }

  .stat-number {
    @apply font-serif text-4xl font-bold mb-2 transition-all duration-300;
    color: #B8860B;
  }

  .stat-card:hover .stat-number {
    @apply scale-110;
  }

  /* CTA Section Enhancements */
  .cta-section {
    @apply relative overflow-hidden;
  }

  .cta-gradient-bg {
    @apply absolute inset-0 -z-10;
    background: linear-gradient(to bottom right,
      rgb(245 158 11 / 0.05),
      rgb(245 242 237 / 1),
      rgb(245 158 11 / 0.1));
  }

  .cta-decorative-blob {
    @apply absolute rounded-full blur-3xl -z-10;
    background-color: rgb(245 158 11 / 0.05);
  }

  .cta-decorative-blob-top {
    @apply cta-decorative-blob top-0 right-0;
    width: 24rem;
    height: 24rem;
  }

  .cta-decorative-blob-bottom {
    @apply cta-decorative-blob bottom-0 left-0;
    width: 24rem;
    height: 24rem;
  }

  /* Feature Highlight Cards */
  .feature-highlight-card {
    @apply p-6 rounded-xl border transition-all duration-300;
    background-color: rgb(255 255 255 / 0.5);
    backdrop-filter: blur(4px);
    border-color: rgb(212 207 197 / 0.3);
  }

  .feature-highlight-card:hover {
    @apply bg-white shadow-lg scale-105;
    border-color: rgb(245 158 11 / 0.5);
  }

  .feature-highlight-icon {
    @apply flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center font-bold text-lg transition-all duration-300;
    background-color: rgb(245 158 11 / 0.1);
    color: #B8860B;
  }

  .feature-highlight-card:hover .feature-highlight-icon {
    @apply bg-amber-500 text-white;
  }

  /* Trust Indicator Cards */
  .trust-indicator-card {
    @apply h-20 rounded-2xl flex items-center justify-center transition-all duration-300 border;
    background-color: rgb(255 255 255 / 0.6);
    backdrop-filter: blur(4px);
    border-color: rgb(212 207 197 / 0.3);
  }

  .trust-indicator-card:hover {
    @apply bg-white shadow-lg scale-105;
  }

  .trust-indicator-text {
    @apply text-sm font-semibold text-ink-light transition-colors duration-300;
  }

  .trust-indicator-card:hover .trust-indicator-text {
    @apply text-amber-500;
  }

  /* How It Works Section */
  .how-it-works-gradient-bg {
    @apply bg-gradient-to-b from-cream to-white;
  }

  .how-it-works-badge {
    @apply inline-block px-4 py-2 rounded-full mb-6;
    background-color: rgb(245 158 11 / 0.1);
  }

  .how-it-works-badge-text {
    @apply text-sm font-semibold uppercase tracking-wider;
    color: #B8860B;
  }

  /* Step Card Components */
  .step-card-wrapper {
    @apply relative;
  }

  .step-card-glow {
    @apply absolute inset-0 rounded-2xl blur-sm opacity-0 transition-opacity duration-300;
    background: linear-gradient(to bottom right,
      rgb(245 158 11 / 0.05),
      rgb(245 158 11 / 0.1));
  }

  .step-card-wrapper:hover .step-card-glow {
    @apply opacity-100;
  }

  .step-card-main {
    @apply relative rounded-2xl shadow-lg p-8 border transition-all duration-300;
    background-color: #E8E4DD;
    border-color: rgb(212 207 197 / 0.3);
  }

  .step-card-wrapper:hover .step-card-main {
    @apply shadow-2xl scale-105;
    border-color: rgb(245 158 11 / 0.5);
  }

  .step-card-number {
    @apply absolute left-1/2 w-16 h-16 rounded-full flex items-center justify-center font-serif text-2xl font-bold text-white shadow-xl z-10 transition-transform duration-300;
    top: -1.5rem;
    transform: translateX(-50%);
    background: linear-gradient(to bottom right, #B8860B, rgb(245 158 11 / 0.8));
  }

  .step-card-wrapper:hover .step-card-number {
    @apply scale-110;
  }

  .step-card-icon {
    @apply text-5xl mb-6 mt-6 text-center transition-transform duration-300;
  }

  .step-card-wrapper:hover .step-card-icon {
    @apply scale-110;
  }

  .step-card-title {
    @apply text-center mb-4 transition-colors duration-300;
  }

  .step-card-wrapper:hover .step-card-title {
    color: #B8860B;
  }

  .step-card-description {
    @apply text-base text-ink-light leading-relaxed text-center;
  }

  .step-card-divider {
    @apply mt-6 pt-6 border-t;
    border-color: rgb(212 207 197 / 0.2);
  }

  .step-card-decoration {
    @apply flex justify-center;
  }

  .step-card-decoration-line {
    @apply h-1 rounded-full transition-all duration-300;
    width: 3rem;
    background: linear-gradient(to right,
      transparent,
      rgb(245 158 11 / 0.4),
      transparent);
  }

  .step-card-wrapper:hover .step-card-decoration-line {
    width: 6rem;
    background: linear-gradient(to right,
      transparent,
      rgb(245 158 11 / 1),
      transparent);
  }

  /* Mobile Connecting Arrows */
  .mobile-connector {
    @apply flex justify-center py-2;
  }

  .mobile-connector-arrow {
    @apply text-2xl;
    color: #B8860B;
  }

  /* Desktop Connecting Line */
  .steps-connecting-line {
    @apply absolute left-0 right-0 -z-10;
    top: 5rem;
    height: 2px;
    background: linear-gradient(to right,
      rgb(245 158 11 / 0.3),
      rgb(245 158 11 / 0.7),
      rgb(245 158 11 / 0.3));
    box-shadow: 0 0 8px rgba(120, 140, 93, 0.3);
  }

  .steps-connecting-line::after {
    content: '';
    @apply absolute inset-0;
    background: linear-gradient(to right,
      transparent,
      rgb(245 158 11 / 0.8),
      transparent);
    animation: shimmer 3s ease-in-out infinite;
  }

  @keyframes shimmer {
    0%, 100% {
      opacity: 0.3;
      transform: translateX(-100%);
    }
    50% {
      opacity: 1;
      transform: translateX(100%);
    }
  }

  /* Enhanced Feature Cards */
  .feature-card {
    @apply transition-all duration-300;
  }

  .feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  }
}

/* Global Dark Mode Styles */
html.dark {
  /* Cards and containers */
  .bg-white {
    background-color: var(--bg-card) !important;
  }

  .bg-cream,
  .bg-gray-50,
  .bg-\[\#F5F2ED\] {
    background-color: var(--bg-primary) !important;
  }

  .bg-gray-100,
  .bg-taupe\/10,
  .bg-sky\/30 {
    background-color: var(--bg-secondary) !important;
  }

  /* Text colors */
  .text-ink,
  .text-gray-900 {
    color: var(--text-primary) !important;
  }

  /* Opacity variants of text-ink — Tailwind generates these as separate classes.
     In dark mode the ink color (#1a1a1a) at any opacity is invisible on dark backgrounds. */
  .text-ink\/10,
  .text-ink\/20,
  .text-ink\/30,
  .text-ink\/40,
  .text-ink\/50,
  .text-ink\/60,
  .text-ink\/70,
  .text-ink\/80,
  .text-ink\/90 {
    color: var(--text-secondary) !important;
  }

  .text-gray-700,
  .text-ink-light {
    color: var(--text-secondary) !important;
  }

  .text-gray-600,
  .text-gray-500 {
    color: var(--text-muted) !important;
  }

  /* Borders */
  .border-gray-200,
  .border-taupe\/30,
  .border-primary-dark\/10 {
    border-color: var(--border-color) !important;
  }

  /* Input fields */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  textarea,
  select {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
  }

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

  /* Buttons */
  .btn-secondary,
  button:not(.bg-ink):not(.bg-amber-500):not(.bg-green-600):not(.bg-red-600):not([class*="bg-"]) {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
  }

  /* Hover states */
  .hover\:bg-sky\/30:hover,
  .hover\:bg-taupe\/10:hover {
    background-color: var(--bg-tertiary) !important;
  }

  /* Links */
  a:not([class*="bg-"]):not(nav a):not(header a) {
    color: var(--text-secondary);
  }

  a:hover:not(nav a):not(header a) {
    color: var(--text-primary);
  }

  /* Navigation links - ensure Tailwind classes work properly */
  header nav a {
    /* Let Tailwind dark: classes work - don't override */
  }

  /* Headings in dark mode - ensure visibility */
  h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
  }

  /* Paragraphs */
  p {
    color: var(--text-secondary);
  }

  /* Specific component overrides */
  .card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
  }

  /* Dropdown menus */
  [role="menu"],
  .dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
  }

  /* Tables */
  table {
    color: var(--text-primary);
  }

  th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
  }

  td {
    border-color: var(--border-color);
  }

  /* Code blocks */
  code, pre {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
  }

  /* Badges and pills */
  .badge,
  .pill {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
  }

  /* Ensure green/red badges stay visible */
  .bg-green-50,
  .bg-green-100 {
    background-color: rgba(34, 197, 94, 0.2) !important;
  }

  .bg-red-50,
  .bg-red-100 {
    background-color: rgba(239, 68, 68, 0.2) !important;
  }

  .text-green-600,
  .text-green-700,
  .text-green-800 {
    color: #4ade80 !important;
  }

  .text-red-600,
  .text-red-700,
  .text-red-800 {
    color: #f87171 !important;
  }
}

/* FAQ accordion — remove browser focus outline on details/summary */
details:focus,
details:focus-visible,
details > summary:focus,
details > summary:focus-visible {
  outline: none !important;
}

/* Contact form input focus — gold ring */
.contact-input:focus {
  outline: none;
  border-color: rgba(191, 158, 91, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(191, 158, 91, 0.1);
}

/* Password visibility toggle — no background, no border, no outline */
.password-toggle-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: rgba(26, 26, 26, 0.5) !important;
}
.password-toggle-btn:focus,
.password-toggle-btn:hover {
  background: transparent !important;
  outline: none !important;
  color: rgba(26, 26, 26, 0.8) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE — Internal App Pages (Design System Overrides)
   Targets the dashboard, AI pages, and all authenticated views.
   Uses !important to override Tailwind utilities and inline styles.
   ═══════════════════════════════════════════════════════════════════════════ */

html.dark {
  /* ── Main layout backgrounds ──────────────────────────────────────────── */
  body {
    background-color: #0d0d0d !important;
    color: var(--text-primary);
  }

  /* Main content area */
  main {
    background-color: #0d0d0d;
  }

  /* ── Cards — override white/cream inline styles ───────────────────────── */
  /* Any element with rounded corners that is white/cream colored */
  .rounded-2xl,
  .rounded-xl {
    --card-bg: #161616;
  }

  /* White cards (bg-white class or inline style="background:#ffffff") */
  .bg-white {
    background-color: #1c1c1c !important;
    color: var(--text-primary);
  }

  /* Cream/parchment cards (#F8F5EF, #F8F7F4) */
  [style*="background:#F8F5EF"],
  [style*="background: #F8F5EF"],
  [style*="background:#F8F7F4"],
  [style*="background:#fafaf8"],
  [style*="background: #fafaf8"] {
    background: #242424 !important;
  }

  /* background:#ffffff inline style — covers both background: shorthand
     and background-color: longhand (e.g. TrustBadgesRowComponent) */
  [style*="background:#ffffff"],
  [style*="background: #ffffff"],
  [style*="background-color:#ffffff"],
  [style*="background-color: #ffffff"],
  [style*="background: rgb(255, 255, 255)"],
  [style*="background:white"],
  [style*="background: white"] {
    background-color: #1c1c1c !important;
  }

  /* ── Taupe borders ────────────────────────────────────────────────────── */
  [style*="border:1px solid rgba(232,228,221"],
  [style*="border: 1px solid rgba(232,228,221"] {
    border-color: rgba(255,255,255,0.08) !important;
  }

  [style*="border-bottom:1px solid rgba(232,228,221"],
  [style*="border-top:1px solid rgba(232,228,221"] {
    border-color: rgba(255,255,255,0.08) !important;
  }

  /* ── Text color overrides for inline styles ───────────────────────────── */
  /* "ink" text (#1a1a1a, rgba(26,26,26,...)) */
  [style*="color:#1a1a1a"],
  [style*="color: #1a1a1a"] {
    color: rgba(220, 220, 220, 0.92) !important;
  }

  [style*="color:rgba(26,26,26,0.45)"],
  [style*="color: rgba(26,26,26,0.45)"] {
    color: rgba(148,163,184,0.8) !important;
  }

  [style*="color:rgba(26,26,26,0.4)"],
  [style*="color: rgba(26,26,26,0.4)"] {
    color: rgba(148,163,184,0.7) !important;
  }

  [style*="color:rgba(26,26,26,0.35)"],
  [style*="color: rgba(26,26,26,0.35)"] {
    color: rgba(148,163,184,0.55) !important;
  }

  [style*="color:rgba(26,26,26,0.3)"],
  [style*="color: rgba(26,26,26,0.3)"] {
    color: rgba(148,163,184,0.45) !important;
  }

  [style*="color:rgba(26,26,26,0.55)"],
  [style*="color: rgba(26,26,26,0.55)"] {
    color: rgba(148,163,184,0.85) !important;
  }

  [style*="color:rgba(26,26,26,0.5)"],
  [style*="color: rgba(26,26,26,0.5)"] {
    color: rgba(148,163,184,0.75) !important;
  }

  [style*="color:rgba(26,26,26,0.6)"],
  [style*="color: rgba(26,26,26,0.6)"] {
    color: rgba(148,163,184,0.9) !important;
  }

  /* Main ink text */
  .text-ink {
    color: #e2e8f0 !important;
  }

  /* ── Tables ───────────────────────────────────────────────────────────── */
  table {
    color: var(--text-primary);
  }

  thead {
    border-color: rgba(255,255,255,0.08) !important;
  }

  tbody tr {
    border-color: rgba(255,255,255,0.06) !important;
  }

  /* ── Section dividers ─────────────────────────────────────────────────── */
  [style*="background-color:rgba(232,228,221,0.6)"],
  [style*="background: rgba(232,228,221"] {
    background-color: rgba(255,255,255,0.08) !important;
  }

  /* ── Dashboard stat number colors (keep accents, darken neutrals) ─────── */
  .font-serif.text-ink {
    color: #e2e8f0 !important;
  }

  /* ── Form inputs ──────────────────────────────────────────────────────── */
  .contact-input,
  input.contact-input,
  textarea.contact-input,
  select.contact-input {
    background-color: #1c1c1c !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #e2e8f0 !important;
  }

  .contact-input::placeholder,
  textarea.contact-input::placeholder {
    color: rgba(148,163,184,0.4) !important;
  }

  /* ── Top bar hover ────────────────────────────────────────────────────── */
  .hover\:bg-gray-100:hover {
    background-color: rgba(255,255,255,0.07) !important;
  }

  /* ── Tailwind gray text classes used in layout ────────────────────────── */
  .text-gray-900 { color: #e2e8f0 !important; }
  .text-gray-700 { color: #cbd5e1 !important; }
  .text-gray-600 { color: #94a3b8 !important; }
  .text-gray-500 { color: #64748b !important; }
  .text-gray-400 { color: #475569 !important; }

  /* Stone colors used in top bar border */
  .border-stone-200\/50 {
    border-color: rgba(255,255,255,0.08) !important;
  }

  /* ── Marketing landing pages ──────────────────────────────────────────── */
  .bg-cream {
    background-color: #0d0d0d !important;
  }

  /* Tailwind arbitrary-value class: bg-[#F5F2ED] (cream parchment sections) */
  .bg-\[\#F5F2ED\] {
    background-color: #161616 !important;
  }

  /* Also target via inline style for any element with this exact bg.
     IMPORTANT: match only when F5F2ED appears as a background property,
     NOT as a text color — otherwise blockquotes/paragraphs with color:#F5F2ED
     get a dark navy background rectangle painted over their text. */
  [style*="background:#F5F2ED"],
  [style*="background: #F5F2ED"],
  [style*="background-color:#F5F2ED"],
  [style*="background-color: #F5F2ED"] {
    background-color: #161616 !important;
  }

  /* Taupe backgrounds used in pricing, landing */
  .bg-taupe\/10,
  .bg-taupe\/30 {
    background-color: rgba(255,255,255,0.05) !important;
  }

  /* ── Pricing page cards ───────────────────────────────────────────────── */
  .bg-gray-50 {
    background-color: #1c1c1c !important;
  }

  /* ── Navigation text on marketing pages ──────────────────────────────── */
  .text-ink-light {
    color: #94a3b8 !important;
  }

  nav a.text-ink-light {
    color: #94a3b8 !important;
  }

  nav a.text-ink-light:hover {
    color: #e2e8f0 !important;
  }

  /* ── Headings on marketing pages ─────────────────────────────────────── */
  .text-ink {
    color: #e2e8f0 !important;
  }

  /* Logo and serif headings */
  .font-serif {
    color: #e2e8f0;
  }

  /* ── Progress / quota bar track ──────────────────────────────────────── */
  [style*="background:rgba(232,228,221"] {
    background: rgba(255,255,255,0.1) !important;
  }

  /* ── Sidebar border dividers on welcome section ───────────────────────── */
  [style*="border-bottom:1px solid rgba(232,228,221,0.6)"],
  [style*="border-top:1px solid rgba(232,228,221,0.6)"] {
    border-color: rgba(255,255,255,0.07) !important;
  }

  /* ── Pricing page: dark brown/amber inline text colors → warm light ────── */
  /* Pro plan price number (#8a6e3a) and stat numbers (#6b4f28) */
  [style*="color:#8a6e3a"],
  [style*="color: #8a6e3a"] {
    color: #d4a96a !important;
  }

  [style*="color:#6b4f28"],
  [style*="color: #6b4f28"] {
    color: #c9a25c !important;
  }

  /* Enterprise/Pro brown rgba text (rgba(100,76,35,...)) → readable amber */
  [style*="color:rgba(100,76,35,0.85)"],
  [style*="color: rgba(100,76,35,0.85)"] {
    color: rgba(212,169,106,0.92) !important;
  }

  [style*="color:rgba(100,76,35,0.75)"],
  [style*="color: rgba(100,76,35,0.75)"] {
    color: rgba(212,169,106,0.82) !important;
  }

  [style*="color:rgba(100,76,35,0.7)"],
  [style*="color: rgba(100,76,35,0.7)"] {
    color: rgba(212,169,106,0.77) !important;
  }

  [style*="color:rgba(100,76,35,0.55)"],
  [style*="color: rgba(100,76,35,0.55)"] {
    color: rgba(212,169,106,0.65) !important;
  }

  /* rgba(26,26,26,0.7) and 0.75 — used for plan names, feature col, team desc */
  [style*="color:rgba(26,26,26,0.7)"],
  [style*="color: rgba(26,26,26,0.7)"] {
    color: rgba(200,200,200,0.82) !important;
  }

  [style*="color:rgba(26,26,26,0.75)"],
  [style*="color: rgba(26,26,26,0.75)"] {
    color: rgba(200,200,200,0.87) !important;
  }

  /* ── Pricing: taupe vertical divider & FAQ chevron bg ──────────────────── */
  [style*="background-color:rgba(232,228,221,0.8)"],
  [style*="background-color: rgba(232,228,221,0.8)"] {
    background-color: rgba(255,255,255,0.12) !important;
  }

  /* ── Comparison table: section header rows (#FAFAF8) ─────────────────── */
  [style*="background-color:#FAFAF8"],
  [style*="background-color: #FAFAF8"] {
    background-color: rgba(255,255,255,0.04) !important;
  }

  /* ── Hero AES badge and plan name badges (#F9F8F5) ────────────────────── */
  [style*="background-color:#F9F8F5"],
  [style*="background-color: #F9F8F5"] {
    background-color: rgba(255,255,255,0.07) !important;
    border-color: rgba(255,255,255,0.1) !important;
  }

  /* ── Comparison row hover (Tailwind hover:bg-[#FDFCFA] won't compile) ─── */
  .hover\:bg-\[\#FDFCFA\]:hover {
    background-color: rgba(255,255,255,0.04) !important;
  }

  /* ── Plan card: "current plan" state (rgba(26,26,26,0.06) bg) ─────────── */
  [style*="background-color:rgba(26,26,26,0.06)"],
  [style*="background-color: rgba(26,26,26,0.06)"] {
    background-color: rgba(255,255,255,0.08) !important;
  }

  /* ── Plan name pill badge (rgba(26,26,26,0.05) bg, nearly invisible dark) */
  [style*="background-color:rgba(26,26,26,0.05)"],
  [style*="background-color: rgba(26,26,26,0.05)"] {
    background-color: rgba(255,255,255,0.07) !important;
  }

  /* ── Roadmap: journey nodes inner dot (dark dot on white circle → dark bg) */
  [style*="background-color:rgba(26,26,26,0.25)"],
  [style*="background-color: rgba(26,26,26,0.25)"] {
    background-color: rgba(255,255,255,0.3) !important;
  }

  [style*="background-color:rgba(26,26,26,0.15)"],
  [style*="background-color: rgba(26,26,26,0.15)"] {
    background-color: rgba(255,255,255,0.2) !important;
  }

  /* ── Roadmap: journey label color rgba(26,26,26,0.65) ─────────────────── */
  [style*="color:rgba(26,26,26,0.65)"],
  [style*="color: rgba(26,26,26,0.65)"] {
    color: rgba(200,200,200,0.78) !important;
  }

  /* ── Roadmap: future accent rgba(26,26,26,0.18) — label text & dots ───── */
  [style*="color:rgba(26,26,26,0.18)"],
  [style*="color: rgba(26,26,26,0.18)"] {
    color: rgba(200,200,200,0.5) !important;
  }

  /* ── Roadmap: kanban column body backgrounds (near-white lowercase hex) ── */
  [style*="background:#fffefb"],
  [style*="background: #fffefb"],
  [style*="background:#fafaf8"],
  [style*="background: #fafaf8"],
  [style*="background:#f9f8f5"],
  [style*="background: #f9f8f5"] {
    background: #1c1c1c !important;
  }

  /* ── Roadmap: kanban planned/future col header accent border-bottom ────── */
  [style*="border-bottom:2px solid rgba(26,26,26,0.3)"],
  [style*="border-bottom: 2px solid rgba(26,26,26,0.3)"] {
    border-bottom-color: rgba(255,255,255,0.18) !important;
  }

  [style*="border-bottom:2px solid rgba(26,26,26,0.18)"],
  [style*="border-bottom: 2px solid rgba(26,26,26,0.18)"] {
    border-bottom-color: rgba(255,255,255,0.1) !important;
  }

  /* ── Roadmap: kanban planned/future count badge background ────────────── */
  [style*="background-color:rgba(26,26,26,0.3)"],
  [style*="background-color: rgba(26,26,26,0.3)"] {
    background-color: rgba(255,255,255,0.2) !important;
  }

  [style*="background-color:rgba(26,26,26,0.18)"],
  [style*="background-color: rgba(26,26,26,0.18)"] {
    background-color: rgba(255,255,255,0.12) !important;
  }

  /* ── Roadmap: kanban card left border for planned/future (taupe → white) */
  [style*="border-left:3px solid rgba(232,228,221"],
  [style*="border-left: 3px solid rgba(232,228,221"] {
    border-left-color: rgba(255,255,255,0.15) !important;
  }

  /* ── About: milestone "03 Futuro" accent rgba(26,26,26,0.25) ─────────── */
  /* Used for: step number text color, top border, and horizontal divider line */
  [style*="color:rgba(26,26,26,0.25)"],
  [style*="color: rgba(26,26,26,0.25)"] {
    color: rgba(200,200,200,0.45) !important;
  }

  [style*="border-top:2px solid rgba(26,26,26,0.25)"],
  [style*="border-top: 2px solid rgba(26,26,26,0.25)"] {
    border-top-color: rgba(255,255,255,0.15) !important;
  }

  /* Also cover border-top:2px solid rgba(26,26,26,0.3) for consistency */
  [style*="border-top:2px solid rgba(26,26,26,0.3)"],
  [style*="border-top: 2px solid rgba(26,26,26,0.3)"] {
    border-top-color: rgba(255,255,255,0.18) !important;
  }
}

/* ── Dark mode for marketing nav (backdrop filter support) ──────────────── */
/* Also applies to auth page headers (sessions/new, registrations/new) which
   share the same nav-transition class for consistent dark mode styling. */
html.dark .nav-transition {
  background-color: rgba(10,10,10,0.95);
  border-bottom-color: rgba(255,255,255,0.08) !important;
}

/* ── Dark mode button adjustments ──────────────────────────────────────── */
html.dark .btn-gold-outline {
  border-color: rgba(191,158,91,0.6);
  color: #d4b57e;  /* Lighter gold readable on dark bg — 5.4:1 on #0d0d0d */
}

html.dark .btn-gold-outline:hover {
  background-color: rgba(191,158,91,0.12);
  color: #e5c98f;
}

html.dark .btn-cta-green {
  background-color: #bf9e5b;
  color: #2d1a00;
}

/* ── Demo tab buttons on dark bg ────────────────────────────────────────── */
html.dark button[data-demo-target="tab"]:not(.bg-\[\#1e3d2a\]) {
  background-color: #1c1c1c !important;
  color: #cbd5e1 !important;
}

/* ── Features section ("Todo lo que necesitas") — dark mode hover ────────
   In light mode: white → cream (#F5F2ED) on hover, via Tailwind hover:bg-[#F5F2ED].
   In dark mode: html.dark .bg-white sets #1c1c1c with !important, which beats
   the Tailwind hover variant. We fix this by adding a higher-specificity
   !important hover rule (adds .group selector → specificity 0,4,1 > 0,2,1).
   ─────────────────────────────────────────────────────────────────────────── */
html.dark .group.bg-white:hover {
  background-color: rgba(255, 255, 255, 0.07) !important;
  /* Subtle gold left-border glow reinforces the hover, matches brand accent */
  box-shadow: inset 3px 0 0 0 rgba(191, 158, 91, 0.5);
}

/* Grid separator line: bg-ink/5 = rgba(26,26,26,0.05) ≈ invisible on dark bg.
   Swap to a subtle white rule so the cell grid lines are perceptible. */
html.dark .bg-ink\/5 {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ── Testimonial & green-bg sections — border fix in dark mode ───────────
   The dark green sections (testimonial, stats) use border-taupe/20.
   In dark mode, adjacent sections become dark blue (#1c1c1c), making
   rgba(232,228,221,0.2) blend into a visible blueish line ("subrayado azul").
   Restore the gold-tinted border that matches the section's design accent.
   ────────────────────────────────────────────────────────────────────────── */
html.dark section[style*="#1e3d2a"] {
  border-color: rgba(191, 158, 91, 0.2) !important;
}

/* Also cover border-taupe/20 globally (the /30 variant was already handled) */
html.dark .border-taupe\/20 {
  border-color: rgba(255, 255, 255, 0.06) !important;
}

/* ── TrustBadgesRowComponent — transparent in dark mode ──────────────────
   The component uses inline style="background-color:#ffffff; border-top:1px solid #e8e4dd;"
   The general rule converts #ffffff → #1c1c1c, but the surrounding page body
   is #0d0d0d (darker), creating a two-tone bar. Override to transparent so the
   badges row blends with whatever page background sits behind it.
   The border-top is also softened to match the dark mode border system.
   ────────────────────────────────────────────────────────────────────────── */
html.dark [style*="background-color:#ffffff"][style*="border-top:1px solid #e8e4dd"],
html.dark [style*="background-color:#ffffff"][style*="border-top: 1px solid #e8e4dd"],
html.dark [style*="background-color:#ffffff"][style*="border-top:1px solid rgba(232,228,221,0.4)"],
html.dark [style*="background-color:#ffffff"][style*="border-top: 1px solid rgba(232,228,221,0.4)"] {
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

/* ── Demo AI chat — dark mode bubble fix ────────────────────────────────
   The user message bubble uses bg-ink (#1a1a1a). With the new neutral dark
   palette, the messages container is #1c1c1c — nearly identical, making the
   bubble invisible. Scope the override to the demo controller so global
   bg-ink buttons (CTAs) are not affected.
   The thinking dots use bg-ink/50 which is also dark-on-dark; swap to a
   white-tinted dot so they're visible against the dark chat background.
   ────────────────────────────────────────────────────────────────────────── */
html.dark [data-controller="demo-conversation"] .bg-ink {
  background-color: #383838 !important;
}

html.dark [data-controller="demo-conversation"] .bg-ink\/50 {
  background-color: rgba(255, 255, 255, 0.35) !important;
}

/* ── Dark mode links — remove hover underline ────────────────────────────
   Light mode uses text-decoration-color: #B8860B (gold) for hover underlines.
   In dark mode, link color is #cbd5e1 (blue-slate), so if text-decoration-color
   is not supported the underline renders in blue. Remove the underline in dark
   mode to keep links clean on dark backgrounds.
   ────────────────────────────────────────────────────────────────────────── */
html.dark a {
  text-decoration: none !important;
}
