:root {
  /* DARK THEME (DEFAULT) — Blue Palette */
  --blue: #4a90d9;
  /* acento principal azul (WCAG AA sobre dark) */
  --blue-light: #6daee8;
  /* hover / highlight más claro */
  --blue-vibrant: #89c4f4;
  /* iconos, detalles brillantes */
  --blue-pale: #dbeafe;
  /* fondos de acento muy suave (modo light) */
  --blue-glow: rgba(74, 144, 217, 0.35);
  /* Alias gold→blue para compatibilidad con cualquier JS que los use */
  --gold: var(--blue);
  --gold-light: var(--blue-light);
  --gold-vibrant: var(--blue-vibrant);
  --gold-pale: var(--blue-pale);
  --gold-glow: var(--blue-glow);
  /* Fondos oscuros */
  --dark: #07080f;
  --dark-2: #0d1117;
  --dark-3: #141922;
  --charcoal: #1e2533;
  --text: #e8edf5;
  --text-muted: #8896b0;
  --white: #ffffff;
  --cream: #f0f4fa;
  --border: rgba(74, 144, 217, 0.15);
  --border-bright: rgba(74, 144, 217, 0.30);
  --noise-opacity: 0.03;
  --bg-gradient: linear-gradient(to bottom, var(--dark), #0a0d16);
}

[data-theme="light"] {
  /* LIGHT THEME — Opción B: Azul Oxford & Plata */
  --blue: #0f172a;
  /* Azul Oxford — Máxima autoridad */
  --blue-light: #1e293b;
  /* Hover oscuro */
  --blue-vibrant: #3b82f6;
  /* Acento brillante */
  --blue-pale: #f1f5f9;
  /* Fondo plata suave */
  --blue-glow: rgba(15, 23, 42, 0.12);
  --gold: var(--blue);
  --gold-light: var(--blue-light);
  --gold-vibrant: var(--blue-vibrant);
  --gold-pale: var(--blue-pale);
  --gold-glow: var(--blue-glow);
  /* Fondos — Estilo corporativo limpio */
  --dark: #ffffff;
  /* Nivel 1 — Blanco puro */
  --dark-2: #f8fafc;
  /* Nivel 2 — Gris plata suave */
  --dark-3: #f1f5f9;
  /* Nivel 3 — Gris-azul sutil */
  --charcoal: #e2e8f0;
  /* Bordes y elevaciones */
  --text: #0f172a;
  /* Texto Oxford — Contraste total */
  --text-muted: #475569;
  /* Pizarra medio */
  --white: #0a0a0a;
  --cream: #141412;
  /* Separadores nítidos */
  --border: rgba(15, 23, 42, 0.1);
  --border-bright: rgba(15, 23, 42, 0.18);
  --noise-opacity: 0.005;
  /* Gradiente hero frío y elegante */
  --bg-gradient: linear-gradient(155deg, #f1f5f9 0%, #f8fafc 40%, #ffffff 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  cursor: none;
  transition: background 0.5s ease, color 0.5s ease;
}

/* Custom Cursor */
.cursor {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid var(--blue);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transition: all 0.15s ease;
  opacity: 0.5;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: var(--noise-opacity);
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 4rem;
  border-bottom: 1px solid transparent;
  transition: all 0.4s;
}

nav.scrolled {
  background: rgba(var(--dark-rgb), 0.9);
  border-bottom-color: var(--border);
  backdrop-filter: blur(20px);
}

[data-theme="dark"] nav.scrolled {
  background: rgba(7, 8, 15, 0.9);
}

[data-theme="light"] nav.scrolled {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(15, 40, 100, 0.14);
  box-shadow: 0 1px 20px rgba(15, 40, 100, 0.09);
  backdrop-filter: blur(20px);
}

.nav-logo {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-logo:hover {
  transform: scale(1.05);
}

.nav-logo img {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 0 8px var(--blue-glow));
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--blue);
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--blue);
  cursor: none;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.theme-toggle:hover {
  transform: rotate(15deg) scale(1.1);
}

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 30%, var(--blue-glow) 0%, transparent 50%),
    radial-gradient(circle at 20% 70%, rgba(74, 144, 217, 0.05) 0%, transparent 40%),
    var(--bg-gradient);
}

.hero-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--blue), transparent);
  margin-left: 3.8rem;
  opacity: 0.3;
}

.hero-ornament {
  position: absolute;
  right: 6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 400px;
  border: 1px solid var(--border);
  border-radius: 50%;
  opacity: 0.5;
}

.hero-ornament::before,
.hero-ornament::after {
  content: '';
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.hero-ornament::before {
  inset: 30px;
}

.hero-ornament::after {
  inset: 60px;
}

.hero-main-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
}

.hero-text-content {
  flex: 1;
}

.hero-desktop-logo {
  display: none;
  flex: 1;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: fadeUp 1s 0.8s forwards;
}

.hero-desktop-logo img {
  max-width: 550px;
  height: auto;
  filter: drop-shadow(0 0 30px var(--blue-glow));
}

.hero-label {
  font-size: 1.0rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.3s forwards;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  font-weight: 300;
  line-height: 1.05;
  max-width: 680px;
  opacity: 0;
  animation: fadeUp 0.9s 0.5s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--blue-light);
  text-shadow: 0 0 18px var(--blue-glow);
}

.hero-subtitle {
  margin-top: 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
  opacity: 0;
  animation: fadeUp 0.9s 0.7s forwards;
}

.hero-actions {
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  opacity: 0;
  animation: fadeUp 0.9s 0.9s forwards;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #ffffff;
  padding: 1.1rem 2.8rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow:
    1px 0 0 rgba(0, 0, 0, 0.4),
   -1px 0 0 rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(0, 0, 0, 0.4),
    0 -1px 0 rgba(0, 0, 0, 0.4);
  border: none;
  cursor: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 20px rgba(74, 144, 217, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--blue-glow);
  filter: brightness(1.1);
}

.btn-ghost {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
}

.btn-ghost:hover {
  color: var(--blue);
}

.btn-ghost::after {
  content: '→';
}

.hero-stats {
  position: absolute;
  bottom: 4rem;
  right: 4rem;
  display: flex;
  gap: 3rem;
  opacity: 0;
  animation: fadeUp 0.9s 1.1s forwards;
}

.stat {
  text-align: right;
}

.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--blue);
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* DIVIDER */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 4rem;
  margin: 1rem 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-bright);
  opacity: 0.6;
}

.divider-ornament {
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--blue);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* AREAS DE PRACTICA */
.areas {
  padding: 8rem 4rem;
  background: var(--dark);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 5rem;
}

.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.15;
}

.section-title em {
  font-style: italic;
  color: var(--blue-light);
}

.section-desc {
  max-width: 340px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: right;
}

.areas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  background: transparent;
}

.areas-calculator-link {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.areas-calculator-link a {
  color: var(--blue-vibrant);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.areas-calculator-link a:hover {
  border-bottom-color: var(--blue-vibrant);
  color: var(--blue-light);
}

.area-card {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  cursor: none;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--dark-3);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
  transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

[data-theme="light"] .area-card {
  box-shadow: 0 15px 45px rgba(26, 98, 183, 0.08);
}

.area-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .area-card:hover {
  box-shadow: 0 25px 60px rgba(26, 98, 183, 0.15);
}

.area-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
  filter: brightness(0.9) contrast(1.02);
}

.area-card:hover .area-card-bg {
  transform: scale(1.1);
  filter: brightness(0.85) contrast(1.1);
}

.area-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 8, 8, 0.9) 0%, rgba(8, 8, 8, 0.3) 50%, transparent 100%);
  transition: opacity 0.4s ease;
}

[data-theme="light"] .area-overlay {
  /* Overlay azul profundo — Elegancia Oxford */
  background: linear-gradient(to top, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.45) 55%, transparent 100%);
}

.area-card:hover .area-overlay {
  opacity: 0.9;
}

.area-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem;
  transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

.area-card:hover .area-content {
  transform: translateY(-5px);
}

.area-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 1.5rem;
  color: var(--blue-vibrant);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

[data-theme="light"] .area-icon {
  /* Icono brillante sobre el overlay oscuro */
  color: #89c4f4;
}

.area-icon svg {
  width: 100%;
  height: 100%;
}

.area-card:hover .area-icon {
  transform: scale(1.1);
}

.area-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  transition: color 0.3s;
}

.area-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

/* Texto de cards en light mode: blanco sobre overlay oscuro */
[data-theme="light"] .area-name {
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .area-desc {
  color: rgba(220, 232, 255, 0.88);
  font-weight: 400;
}

.area-card:hover .area-desc {
  max-height: 120px;
  opacity: 1;
  margin-top: 1rem;
}

/* Mobile: descripción siempre visible, sin interacción */
@media (max-width: 900px) {
  .area-desc {
    max-height: 200px !important;
    opacity: 1 !important;
    margin-top: 0.75rem !important;
  }
}

.area-arrow {
  display: none;
}

/* Specific Area Images */
.area-civil .area-card-bg {
  background-image: url('/img/areas_civil.webp');
}

.area-laboral .area-card-bg {
  background-image: url('/img/areas_laboral.webp');
}

.area-penal .area-card-bg {
  background-image: url('/img/areas_penal.webp');
}

.area-familia .area-card-bg {
  background-image: url('/img/areas_familia.webp');
}

/* MEDIA / BLOG */
.media-section {
  padding: 8rem 4rem;
  background: var(--dark);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 4rem;
  align-items: stretch;
}

.media-card {
  position: relative;
  overflow: hidden;
  cursor: none;
  background: var(--dark-3);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.media-card:hover .media-overlay {
  opacity: 1;
}

.media-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.media-thumb-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.media-card.vertical .media-thumb-placeholder,
.media-card.vertical .media-video-container {
  aspect-ratio: 9/16;
}

.media-card.article .media-thumb-placeholder {
  aspect-ratio: auto;
  height: 20%;
  flex-shrink: 0;
}

.media-card.article .media-info {
  overflow-y: auto;
}

.media-card.article .media-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 1rem;
}

.media-video-container {
  width: 100%;
  aspect-ratio: 16/10;
  background: #000;
  position: relative;
  overflow: hidden;
}

.media-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, var(--blue-glow) 0%, transparent 70%),
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(74, 144, 217, 0.05) 20px, rgba(74, 144, 217, 0.05) 21px);
}

.media-play {
  width: 50px;
  height: 50px;
  border: 1px solid var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 1.2rem;
  z-index: 1;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: var(--blue-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
}

.media-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.media-tag {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.6rem;
}

.media-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.media-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: auto;
}

.media-card.article .media-date {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* CONTACTO */
.contact-section {
  padding: 8rem 4rem;
  background: var(--dark);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.contact-info-block {
  padding-top: 1rem;
}

.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 3rem;
}

.contact-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.contact-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-text-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.contact-text-value {
  font-size: 0.9rem;
}

/* WhatsApp CTA highlighted style */
.whatsapp-cta {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(37, 211, 102, 0.2);
  background: rgba(37, 211, 102, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.05);
  animation: pulse-whatsapp 2.5s infinite;
}

/* Light Theme Overrides for WhatsApp CTA */
[data-theme="light"] .whatsapp-cta {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.3);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.08);
}

.whatsapp-cta:hover {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.5);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.2);
}

[data-theme="light"] .whatsapp-cta:hover {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.6);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.25);
}

/* WhatsApp Icon container specific animation */
.whatsapp-cta .contact-icon {
  border-color: rgba(37, 211, 102, 0.3);
  background: rgba(37, 211, 102, 0.1);
  transition: all 0.3s ease;
  border-radius: 8px; /* Slightly rounded for nicer integration */
}

.whatsapp-cta:hover .contact-icon {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.5);
}

/* Force the image inside the icon to behave nicely */
.whatsapp-cta .contact-icon img {
  display: block;
  transition: transform 0.3s ease;
}

/* Hover dynamic animations */
.whatsapp-cta:hover .contact-icon img {
  animation: wiggle-whatsapp 0.8s ease-in-out infinite;
}

/* Periodic automatic icon wiggle to draw attention */
@keyframes wiggle-whatsapp {
  0%, 100% { transform: rotate(0) scale(1); }
  15% { transform: rotate(-12deg) scale(1.15); }
  30% { transform: rotate(14deg) scale(1.15); }
  45% { transform: rotate(-10deg) scale(1.15); }
  60% { transform: rotate(10deg) scale(1.15); }
  75% { transform: rotate(-4deg) scale(1.1); }
  85% { transform: rotate(4deg) scale(1.1); }
}

/* Pulse animation for the CTA card background */
@keyframes pulse-whatsapp {
  0% {
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.05), 0 0 0 0 rgba(37, 211, 102, 0.2);
  }
  70% {
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.05), 0 0 0 8px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.05), 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* FORM */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cream);
}

.form-control {
  background: var(--dark-2);
  border: 1px solid var(--border);
  padding: 0.9rem 1.1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s;
  cursor: text;
}

.form-control:focus {
  border-color: var(--blue);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

select.form-control {
  cursor: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a90d9' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

select.form-control option {
  background: var(--dark-2);
}

.form-submit {
  background: var(--blue);
  color: #ffffff;
  padding: 1rem 2rem;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: none;
  transition: all 0.3s;
  align-self: flex-start;
}

.form-submit:hover {
  background: var(--blue-light);
}

.form-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FOOTER */
footer {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  padding: 4rem 4rem 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 1rem;
  max-width: 280px;
}

.footer-col-title {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.5rem;
}

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

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--blue);
}

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

/* TESTIMONIALS */
.testimonials {
  padding: 8rem 4rem;
  background: var(--dark-2);
  position: relative;
  overflow: hidden;
}

.testimonials-bg {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to right, var(--blue-glow), transparent);
}

/* Carousel Container */
.testimonials-carousel {
  position: relative;
  margin-top: 4rem;
}

.testimonials-viewport {
  overflow: hidden;
  width: 100%;
}

.testimonials-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonials-track .testimonial-card {
  flex: 0 0 calc(33.333% - 1.34rem);
  margin-right: 2rem;
  opacity: 1;
  transform: none;
}

/* Navigation Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dark-3);
  border: 1px solid var(--border-bright);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

.carousel-arrow:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 20px var(--blue-glow);
  transform: translateY(-50%) scale(1.1);
}

.carousel-arrow--prev {
  left: -24px;
}

.carousel-arrow--next {
  right: -24px;
}

/* Dot Indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-bright);
  border: none;
  cursor: pointer;
  transition: all 0.4s ease;
  padding: 0;
}

.carousel-dot.active {
  background: var(--blue);
  width: 28px;
  border-radius: 4px;
  box-shadow: 0 0 10px var(--blue-glow);
}

.carousel-dot:hover:not(.active) {
  background: var(--blue-light);
  transform: scale(1.3);
}

.testimonial-card {
  background: var(--dark-2);
  border: 1px solid var(--border);
  padding: 2.5rem;
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 4rem;
  color: var(--blue);
  opacity: 0.2;
  line-height: 1;
}

.testimonial-text {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-style: italic;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 38px;
  height: 38px;
  background: var(--charcoal);
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  color: var(--blue);
  font-size: 0.9rem;
}

.testimonial-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* MODAL CHAT */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--dark-2);
  width: 90%;
  max-width: 500px;
  border: 1px solid var(--border-bright);
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: var(--dark-3);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--blue);
  font-size: 1.5rem;
  cursor: none;
}

.modal-body {
  height: 400px;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-input-area {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}

.modal-input {
  flex: 1;
  background: var(--dark-3);
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  color: var(--text);
  outline: none;
}

.modal-send {
  background: var(--blue);
  border: none;
  color: #ffffff;
  padding: 0 1.5rem;
  cursor: none;
  font-weight: 600;
}

/* Responsive basics */
@media (min-width: 901px) {
  .hero-desktop-logo {
    display: flex;
  }

  .nav-logo.desktop-hide {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 900px) {
  nav {
    padding: 1.2rem 1.5rem;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 5rem 1.5rem;
    text-align: center;
  }

  .hero-main-flex {
    flex-direction: column;
  }

  .hero-title {
    font-size: 3rem;
    margin: 0 auto;
  }

  .hero-subtitle {
    margin: 2rem auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    position: static;
    margin-top: 3rem;
    justify-content: center;
    width: 100%;
  }

  .areas,
  .ai-section,
  .media-section,
  .contact-section,
  .testimonials {
    padding: 5rem 1.5rem;
  }

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

  .area-card {
    min-height: 340px;
  }

  .area-content {
    padding: 1.5rem;
  }

  .area-name {
    font-size: 1.5rem;
  }

  .ai-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .contact-section {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .section-desc {
    text-align: left;
  }

  body {
    cursor: auto;
  }

  .cursor,
  .cursor-ring {
    display: none;
  }
}

/* FORM FEEDBACK */
.form-feedback-msg {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
  line-height: 1.5;
}

.form-feedback-msg.success {
  display: block;
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.form-feedback-msg.error {
  display: block;
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ═══════════════════════════════════════════════════════
   LIGHT MODE — OPCIÓN B: AZUL OXFORD & PLATA
   Estilo corporativo · Profesionalismo · Contraste superior
═══════════════════════════════════════════════════════ */

/* Separadores nítidos */
[data-theme="light"] .divider-line {
  opacity: 0.8;
  background: var(--border-bright);
}

[data-theme="light"] .divider-ornament {
  border-color: var(--blue);
  opacity: 1;
}

/* Hero — accent line Oxford */
[data-theme="light"] .hero-line {
  opacity: 0.2;
  background: linear-gradient(to bottom, transparent, var(--blue), transparent);
}

/* Testimonios — Fondo plata sutil */
[data-theme="light"] .testimonials {
  background: #f8fafc;
}

[data-theme="light"] .testimonial-card {
  background: #ffffff;
  border-color: var(--charcoal);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .testimonial-avatar {
  background: #f1f5f9;
  border-color: var(--charcoal);
}

[data-theme="light"] .carousel-arrow {
  background: #ffffff;
  border-color: var(--charcoal);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .carousel-arrow:hover {
  background: var(--blue);
  color: #fff;
}

[data-theme="light"] .carousel-dot {
  background: var(--charcoal);
}

/* Media cards */
[data-theme="light"] .media-card {
  border-color: var(--charcoal);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .media-thumb-placeholder {
  background: var(--dark-3);
}

/* Contacto */
[data-theme="light"] .contact-icon {
  background: #ffffff;
  border-color: var(--charcoal);
  color: var(--blue);
}

/* Formulario */
[data-theme="light"] .form-control {
  background: #ffffff;
  border-color: var(--charcoal);
  color: var(--text);
}

[data-theme="light"] .form-control:focus {
  border-color: var(--blue-vibrant);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

[data-theme="light"] .form-control::placeholder {
  color: #94a3b8;
}

/* Modal light */
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.7);
}

/* Floating chat — sombra Oxford */
[data-theme="light"] .float-chat {
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.25);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, var(--blue-vibrant), #2563eb);
  color: #ffffff;
  text-shadow: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
}

[data-theme="light"] .float-chat-label {
  background: #ffffff;
  color: var(--text);
  border-color: var(--charcoal);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ── FOOTER: Oxford profundo ── */
[data-theme="light"] footer {
  background: #0a0f1d;
  border-top-color: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] footer .footer-col-title {
  color: #3b82f6;
}

[data-theme="light"] footer .footer-brand p,
[data-theme="light"] .footer-links a {
  color: #94a3b8;
}

[data-theme="light"] .footer-links a:hover {
  color: #ffffff;
}

[data-theme="light"] footer .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.05);
  color: #64748b;
}

#footerDevLink {
  color: #e2e8f0;
  text-decoration: none;
}

/* Testimonials Responsive Styles */
@media (max-width: 1024px) {
  .testimonials-track .testimonial-card {
    flex: 0 0 calc(50% - 1rem);
    margin-right: 2rem;
  }
  
  .testimonial-card {
    padding: 2rem;
  }
  
  .testimonial-text {
    font-size: 1rem;
  }
  
  .testimonial-name {
    font-size: 0.9rem;
  }
  
  .carousel-arrow {
    width: 36px;
    height: 36px;
  }
  
  .carousel-arrow--prev {
    left: 8px;
  }
  
  .carousel-arrow--next {
    right: 8px;
  }
}

@media (max-width: 600px) {
  .testimonials-track .testimonial-card {
    flex: 0 0 100%;
    margin-right: 0;
  }
  
  .testimonial-card {
    padding: 1.5rem;
  }
  
  .testimonial-text {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  
  .testimonial-name {
    font-size: 0.82rem;
  }
  
  .carousel-arrow--next {
    right: 4px;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   AI CHAT ASSISTANT WIDGET
   ────────────────────────────────────────────────────────────────────────── */

/* Floating Chat Bubble Container */
.float-chat-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

/* Invite Label */
.float-chat-label {
  pointer-events: auto;
  background: var(--dark-3);
  border: 1px solid var(--border-bright);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  max-width: 260px;
  line-height: 1.4;
  position: relative;
}

.float-chat-label.show {
  opacity: 1;
  transform: translateY(0);
}

.float-chat-label-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  margin-left: 0.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.float-chat-label-close:hover {
  color: var(--text);
}

/* Floating Chat Bubble Button */
.float-chat {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--dark-3);
  border: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 30px var(--blue-glow);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  padding: 0;
  overflow: hidden;
}

.float-chat:hover {
  transform: scale(1.08);
  border-color: var(--blue-light);
  box-shadow: 0 10px 35px var(--blue-glow);
}

.chat-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  transition: transform 0.3s ease;
}

.float-chat:hover .chat-logo-img {
  transform: rotate(-8deg) scale(1.05);
}

/* AI Chat Modal Layout & Custom Alignment */
#chatModalOverlay {
  background: transparent;
  backdrop-filter: none;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0 2rem 7.5rem 0; /* Aligned above the chat bubble */
}

#chatModalOverlay .modal {
  max-width: 380px;
  height: 520px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  opacity: 0;
}

#chatModalOverlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header Avatar and Status Dot */
.chat-assistant-avatar {
  width: 38px;
  height: 38px;
  background: var(--dark-2);
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.chat-assistant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #4ade80;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Chat Message Logs */
#chatModalBody {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  flex: 1;
}

.chat-message {
  display: flex;
  margin-bottom: 0.25rem;
  animation: messageFadeIn 0.3s ease forwards;
}

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

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.45;
  font-family: 'DM Sans', sans-serif;
  overflow-y: auto;

}

.chat-message.user .chat-bubble {
  background: var(--blue);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px var(--blue-glow);
}

.chat-message.assistant .chat-bubble {
  background: var(--dark-3);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

/* Typing Indicator (AI Thinking) */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.5rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Send SVG icon styling */
.send-icon-svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
}

/* Light Theme Styling Overrides */
[data-theme="light"] #chatModalOverlay {
  background: transparent;
  backdrop-filter: none;
}

[data-theme="light"] .float-chat-label {
  background: #ffffff;
  color: var(--text);
  border-color: var(--charcoal);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .float-chat {
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .chat-assistant-avatar {
  background: #ffffff;
  border-color: var(--charcoal);
}

/* Scrollbar styles for chat logs */
#chatModalBody::-webkit-scrollbar {
  width: 4px;
}

#chatModalBody::-webkit-scrollbar-track {
  background: transparent;
}

#chatModalBody::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}

#chatModalBody::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

/* Responsive Overrides (Full Screen Chat on Mobile) */
@media (max-width: 600px) {
  .float-chat-container {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  
  .float-chat-label {
    max-width: 200px;
    font-size: 0.72rem;
  }
  
  #chatModalOverlay {
    padding: 0;
    justify-content: center;
    align-items: flex-end;
  }
  
  #chatModalOverlay .modal {
    max-width: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  
  [data-theme="light"] #chatModalOverlay {
    background: var(--dark-2); /* Full screen background in light theme */
  }
}

/* Ocultar insignia de reCAPTCHA v3 para que no tape la burbuja de chat (se cumple con los términos de Google al poner el aviso en el formulario) */
.grecaptcha-badge {
  visibility: hidden !important;
}