/* ==========================================================================
   RUTIFICADOR CHILE - DESIGN SYSTEM & GLOBAL STYLES
   Optimizado para Core Web Vitals, Mobile-First, Dark/Light Mode y Cero CLS
   ========================================================================== */

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-subtle: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --brand-primary: #1e40af;
  --brand-primary-hover: #1d4ed8;
  --brand-light: #eff6ff;
  --brand-border: #bfdbfe;
  
  --accent-red: #dc2626;
  --accent-red-light: #fef2f2;
  --accent-red-border: #fecaca;
  
  --accent-green: #059669;
  --accent-green-light: #ecfdf5;
  --accent-green-border: #a7f3d0;

  --accent-amber: #d97706;
  --accent-amber-light: #fffbeb;
  --accent-amber-border: #fde68a;

  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --container-max: 1200px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #070b14;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-muted: #0b1120;
  --bg-subtle: #1e293b;
  
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #070b14;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-light: rgba(59, 130, 246, 0.18);
  --brand-border: rgba(59, 130, 246, 0.45);

  --accent-red: #f87171;
  --accent-red-light: rgba(239, 68, 68, 0.2);
  --accent-red-border: rgba(239, 68, 68, 0.5);

  --accent-green: #34d399;
  --accent-green-light: rgba(16, 185, 129, 0.2);
  --accent-green-border: rgba(16, 185, 129, 0.5);

  --accent-amber: #fbbf24;
  --accent-amber-light: rgba(245, 158, 11, 0.2);
  --accent-amber-border: rgba(245, 158, 11, 0.5);

  --border-color: rgba(255, 255, 255, 0.14);
  --border-focus: #38bdf8;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.875rem, 4vw, 2.75rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-top: 1.5rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.125rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
}

img, svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.main-content {
  flex: 1 0 auto;
  padding-bottom: 4rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.9);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="dark"] .site-header {
  background-color: rgba(17, 24, 39, 0.9);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none !important;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #dc2626 100%);
  color: white;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.25);
}

.brand-text span {
  color: var(--brand-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-item a, .nav-item-btn {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-item a:hover,
.nav-item.active > a,
.nav-item.has-dropdown:hover > a {
  color: var(--brand-primary);
  background-color: var(--brand-light);
}

/* ==========================================================================
   Navigation Dropdown Menu
   ========================================================================== */

.has-dropdown {
  position: relative;
}

.dropdown-chevron {
  transition: transform var(--transition-fast);
}

.has-dropdown:hover .dropdown-chevron,
.has-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 290px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.625rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 200;
  margin-top: 2px;
  animation: fadeIn 150ms ease-out;
}

/* Puente invisible para evitar que se cierre el hover al mover el ratón */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 10px;
  background: transparent;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu,
.has-dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  padding: 0.625rem 0.75rem !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  transition: all var(--transition-fast) !important;
  text-decoration: none !important;
}

.dropdown-item:hover {
  background-color: var(--brand-light) !important;
  color: var(--brand-primary) !important;
  transform: translateX(2px);
}

.dropdown-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-muted);
  color: var(--brand-primary);
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition-fast);
}

.dropdown-item:hover .dropdown-item-icon {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.dropdown-item-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.dropdown-item:hover .dropdown-item-title {
  color: var(--brand-primary);
}

.dropdown-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
  margin-top: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--brand-primary);
  border-color: var(--brand-border);
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   Hero & Top Banners
   ========================================================================== */

.hero {
  padding: 3.5rem 0 2.5rem;
  background: radial-gradient(circle at 50% 0%, var(--brand-light) 0%, transparent 70%);
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 1.25rem;
}

.hero-title {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: 1.125rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Card Component & Widgets
   ========================================================================== */

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-border);
}

.card-elevated {
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-border);
  background-color: var(--bg-surface-elevated);
}

.widget-validator {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  text-align: left;
  border-top: 4px solid var(--brand-primary);
}

/* Modo Oscuro: Tarjetas y Widgets con contraste y elevación premium */
[data-theme="dark"] .card {
  background: linear-gradient(180deg, #111a2d 0%, #0c1220 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .card:hover {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.18);
}

[data-theme="dark"] .widget-validator {
  background: linear-gradient(180deg, #141f34 0%, #0d1526 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-top: 4px solid #3b82f6;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.7), 0 0 30px -4px rgba(59, 130, 246, 0.25);
}

.widget-header {
  margin-bottom: 1.25rem;
}

.widget-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: 3.25rem;
  padding: 0.75rem 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background-color: var(--bg-muted);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  opacity: 0.85;
}

.form-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--brand-light);
}

/* Modo Oscuro: Alta visibilidad y contraste en casillas de entrada */
[data-theme="dark"] .form-input {
  background-color: #080d1a !important;
  border: 2px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .form-input::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

[data-theme="dark"] .form-input:focus {
  background-color: #0c1424 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.form-input.is-valid {
  border-color: var(--accent-green) !important;
  background-color: var(--accent-green-light) !important;
}

.form-input.is-invalid {
  border-color: var(--accent-red) !important;
  background-color: var(--accent-red-light) !important;
}

.form-input[readonly] {
  background-color: var(--bg-surface);
  cursor: default;
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .form-input[readonly] {
  background-color: #0b1122 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  color: #f1f5f9 !important;
}

.input-clear-btn {
  position: absolute;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: var(--bg-subtle);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.form-input:not(:placeholder-shown) + .input-clear-btn {
  opacity: 1;
}

/* ==========================================================================
   FAQ Accordions
   ========================================================================== */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0 2.5rem;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .faq-item {
  background: linear-gradient(180deg, #111a2d 0%, #0c1220 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .faq-item.open {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  text-align: left;
  background: none;
  cursor: pointer;
  border: none;
}

.faq-question:hover {
  color: var(--brand-primary);
}

.faq-icon {
  transition: transform var(--transition-fast);
  color: var(--text-muted);
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  border-top: 1px solid var(--border-color);
  padding-top: 0.875rem;
}

[data-theme="dark"] .faq-answer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.faq-item.open .faq-answer {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none !important;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
  background-color: var(--bg-muted);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-primary) !important;
  border: 1.5px solid var(--brand-primary);
}

.btn-outline:hover {
  background-color: var(--brand-light);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Validation Result Box
   ========================================================================== */

.result-box {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  display: none;
  animation: fadeIn 200ms ease-in-out;
}

.result-box.visible {
  display: block;
}

.result-valid {
  background-color: var(--accent-green-light);
  border: 1px solid var(--accent-green-border);
  color: var(--text-primary);
}

.result-invalid {
  background-color: var(--accent-red-light);
  border: 1px solid var(--accent-red-border);
  color: var(--text-primary);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.result-valid .result-header { color: var(--accent-green); }
.result-invalid .result-header { color: var(--accent-red); }

.result-details {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.result-meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  background-color: var(--bg-surface);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  border: 1px solid var(--border-color);
  font-size: 0.8125rem;
}

.result-meta-item strong {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-meta-item span {
  font-family: var(--font-mono);
  font-weight: 600;
}

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

[data-theme="dark"] .privacy-badge {
  background-color: rgba(8, 13, 26, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .result-meta-list {
  background-color: #080d1a !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

/* ==========================================================================
   Quick Access Grid & Feature Cards
   ========================================================================== */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--brand-light);
  color: var(--brand-primary);
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9375rem;
  flex-grow: 1;
}

.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* ==========================================================================
   Editorial Content & Typography
   ========================================================================== */

.prose {
  max-width: 800px;
  margin: 0 auto;
}

.prose-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.editorial-header {
  margin-bottom: 2rem;
}

.trust-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.trust-badge-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trust-badge-item strong {
  color: var(--text-primary);
}

.callout {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid var(--brand-primary);
  background-color: var(--brand-light);
}

.callout-warning {
  border-left-color: var(--accent-amber);
  background-color: var(--accent-amber-light);
}

.callout-danger {
  border-left-color: var(--accent-red);
  background-color: var(--accent-red-light);
}

.callout-success {
  border-left-color: var(--accent-green);
  background-color: var(--accent-green-light);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Tables & Data Presentation
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background-color: var(--bg-muted);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--bg-muted);
}

/* ==========================================================================
   Code Blocks & Tech Documentation
   ========================================================================== */

.code-block-wrapper {
  position: relative;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: #0f172a;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: #1e293b;
  color: #94a3b8;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.code-copy-btn {
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: #334155;
  transition: all var(--transition-fast);
}

.code-copy-btn:hover {
  color: #ffffff;
  background-color: #475569;
}

pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: #f8fafc;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.15rem 0.35rem;
  background-color: var(--bg-muted);
  border-radius: var(--radius-sm);
  color: var(--brand-primary);
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
}

/* ==========================================================================
   Ad Slots (Prepared with strict min-height for Zero CLS)
   ========================================================================== */

.ad-slot-container {
  margin: 2.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-slot-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.ad-slot {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background-color: var(--bg-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot-rectangle {
  max-width: 336px;
  min-height: 280px;
}

.ad-placeholder-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FAQ Accordions
   ========================================================================== */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--brand-border);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-icon {
  transition: transform var(--transition-normal);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out, padding var(--transition-normal);
  padding: 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding-bottom: 1.25rem;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.breadcrumb-item a {
  color: var(--text-muted);
}

.breadcrumb-item a:hover {
  color: var(--brand-primary);
}

.breadcrumb-separator {
  color: var(--border-color);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.footer-brand p {
  font-size: 0.875rem;
  margin-bottom: 1rem;
  max-width: 340px;
}

.footer-col h5 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--brand-primary);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  line-height: 1.4;
}

/* ==========================================================================
   Toasts & Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms ease-out forwards;
}

/* ==========================================================================
   Animations & Keyframes
   ========================================================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-links.mobile-active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    gap: 0.75rem;
    max-height: 80vh;
    overflow-y: auto;
  }

  .nav-item {
    width: 100%;
  }

  .nav-item a {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    background-color: var(--bg-muted);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
  }

  .has-dropdown.open .dropdown-menu {
    display: flex;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero {
    padding: 2.5rem 0 1.5rem;
  }
}
