/* ==========================================================
   TIPOGRAFÍA: Google Sans (Regular, Medium, SemiBold, Bold)
   ========================================================== */
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================
   SISTEMA DE DISEÑO: MODO OSCURO (DEFAULT) & MODO CLARO
   ========================================================== */
:root {
  /* Paleta Corporativa Moriah */
  --color-primary: #1e2f56;
  --color-primary-dark: #101a30;
  --color-secondary: #674193;
  --color-secondary-light: #9462d1;
  --color-accent-cyan: #38bdf8;

  /* Modo Oscuro (Predeterminado) */
  --color-bg: #0f172a;
  --color-bg-secondary: #090e1a;
  --color-surface: rgba(30, 47, 86, 0.45);
  --color-surface-card: rgba(23, 36, 67, 0.72);
  --color-surface-hover: rgba(35, 54, 99, 0.9);
  --color-border: rgba(103, 65, 147, 0.32);
  --color-border-glow: rgba(148, 98, 209, 0.6);
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  --header-bg: rgba(15, 23, 42, 0.88);
  --shadow-card: 0 12px 35px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(103, 65, 147, 0.4);
  --font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --container-max: 1240px;
}

[data-theme="light"] {
  --color-bg: #f8fafc;
  --color-bg-secondary: #ffffff;
  --color-surface: rgba(241, 245, 249, 0.85);
  --color-surface-card: rgba(255, 255, 255, 0.95);
  --color-surface-hover: #ffffff;
  --color-border: rgba(30, 47, 86, 0.14);
  --color-border-glow: rgba(103, 65, 147, 0.45);
  --color-text-main: #0f172a;
  --color-text-muted: #475569;
  --header-bg: rgba(255, 255, 255, 0.92);
  --shadow-card: 0 10px 25px -5px rgba(30, 47, 86, 0.08);
  --shadow-glow: 0 0 25px rgba(103, 65, 147, 0.15);
}

/* RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.65;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 10% 15%, rgba(103, 65, 147, 0.18) 0%, transparent 45%),
                    radial-gradient(circle at 90% 85%, rgba(30, 47, 86, 0.35) 0%, transparent 50%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; border-radius: 8px; }
.container { width: 92%; max-width: var(--container-max); margin: 0 auto; }

/* TIPOGRAFÍA */
h1, h2, h3, h4 { color: var(--color-text-main); line-height: 1.25; margin-bottom: 1rem; }
h1 { font-size: 2.85rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 2.15rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin-bottom: 1.25rem; font-weight: 400; color: var(--color-text-muted); }

/* BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  gap: 0.5rem;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(103, 65, 147, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(103, 65, 147, 0.6);
}
.btn-outline {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-main);
  backdrop-filter: blur(8px);
}
.btn-outline:hover {
  border-color: var(--color-secondary-light);
  background: rgba(103, 65, 147, 0.18);
  transform: translateY(-2px);
}
.btn-portfolio {
  background: rgba(103, 65, 147, 0.22);
  border: 1px solid var(--color-secondary-light);
  color: #ffffff;
  padding: 0.55rem 1.15rem;
  font-size: 0.82rem;
  border-radius: 6px;
}
.btn-portfolio:hover {
  background: var(--color-secondary);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(148, 98, 209, 0.4);
}
[data-theme="light"] .btn-portfolio {
  color: var(--color-secondary);
}
[data-theme="light"] .btn-portfolio:hover {
  color: #ffffff;
}

/* ==========================================================
   HEADER TRIPARTITO: IZQUIERDA (NAV), CENTRO (LOGO), DERECHA (CONTROLES)
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
}

/* 1. Izquierda: Navegación Principal */
.header-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}
.main-nav a {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  transition: color 0.25s ease;
  position: relative;
}
.main-nav a:hover, .main-nav a.active { color: #ffffff; font-weight: 700; }
[data-theme="light"] .main-nav a:hover, [data-theme="light"] .main-nav a.active { color: var(--color-secondary); font-weight: 700; }
.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-secondary-light);
  border-radius: 2px;
}

/* Ocultar enlace de portafolio del menú en PC */
.mobile-portfolio-link {
  display: none;
}

/* 2. Centro: Logotipo de Marca */
.header-center {
  flex: 0 0 auto;
  text-align: center;
}
.brand-logo {
  display: inline-block;
}
.brand-logo img {
  height: 48px;
  width: auto;
  border-radius: 0;
  transition: var(--transition);
}
/* Alternancia de Logos Dark / Light */
.logo-white { display: block; }
.logo-color { display: none; }
[data-theme="light"] .logo-white { display: none; }
[data-theme="light"] .logo-color { display: block; }

/* 3. Derecha: Controles (Portafolio, Idiomas, Modo) */
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
}
.lang-selector { display: flex; align-items: center; gap: 0.45rem; }
.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  opacity: 0.7;
  transition: var(--transition);
}
.lang-btn.active, .lang-btn:hover {
  opacity: 1;
  border-color: var(--color-secondary-light);
  box-shadow: 0 0 8px rgba(103, 65, 147, 0.4);
}
.lang-btn svg { width: 100%; height: 100%; object-fit: cover; }

.theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-main);
  transition: var(--transition);
}
.theme-toggle:hover {
  border-color: var(--color-secondary-light);
  color: var(--color-secondary-light);
  transform: rotate(15deg);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.7rem;
  color: var(--color-text-main);
  cursor: pointer;
}

/* ==========================================================
   HERO CON VIDEO DE FONDO Y OVERLAY
   ========================================================== */
.hero-video-section {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 6rem 0;
  overflow: hidden;
}
.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}
.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 47, 86, 0.8) 50%, rgba(103, 65, 147, 0.75) 100%);
  backdrop-filter: blur(2px);
}
[data-theme="light"] .hero-video-overlay {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.88) 0%, rgba(241, 245, 249, 0.82) 100%);
}
.hero-content-relative {
  position: relative;
  z-index: 2;
  max-width: 860px;
}
.hero-actions {
  display: flex;
  gap: 1.25rem;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}

/* ==========================================================
   COMPONENTES Y TARJETAS
   ========================================================== */
section { padding: 5.5rem 0; position: relative; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.2rem;
  margin-top: 3rem;
}
.card {
  background: var(--color-surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-secondary-light), transparent);
  opacity: 0;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--color-border-glow);
  box-shadow: var(--shadow-glow);
}
.card:hover::before { opacity: 1; }

.card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
  background-color: rgba(103, 65, 147, 0.22);
  color: var(--color-secondary-light);
  border: 1px solid rgba(148, 98, 209, 0.35);
}

.feature-list { list-style: none; margin: 1.5rem 0; }
.feature-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.95rem;
  color: var(--color-text-muted);
}
.feature-list li::before {
  content: '⚡';
  position: absolute;
  left: 0;
  font-size: 0.9rem;
}

/* ==========================================================
   ESTILOS PARA PÁGINA DE POLÍTICAS Y DOCUMENTACIÓN LEGAL
   ========================================================== */
.legal-document h2 {
  font-size: 1.45rem;
  color: var(--color-secondary-light);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.legal-document h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.legal-document h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}
.legal-document ul, .legal-document ol {
  margin: 1rem 0 1.5rem 1.75rem;
  color: var(--color-text-muted);
}
.legal-document li {
  margin-bottom: 0.6rem;
}
.legal-document b, .legal-document strong {
  color: var(--color-text-main);
}
.legal-document a {
  color: var(--color-secondary-light);
  text-decoration: underline;
  transition: var(--transition);
}
.legal-document a:hover {
  color: var(--color-text-main);
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.75rem;
  font-size: 0.95rem;
}
.legal-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  color: var(--color-text-muted);
}
.legal-table td:first-child {
  width: 34%;
  font-weight: 700;
  color: var(--color-text-main);
}
.legal-callout {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border-left: 4px solid var(--color-secondary-light);
  border-radius: 8px;
  color: var(--color-text-main);
  font-weight: 500;
}

/* FORMULARIO */
.contact-form {
  background: var(--color-surface-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  max-width: 720px;
  margin: 0 auto;
}
.form-group { margin-bottom: 1.6rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--color-text-main); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.9rem 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: rgba(15, 23, 42, 0.65);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}
[data-theme="light"] .form-group input, 
[data-theme="light"] .form-group select, 
[data-theme="light"] .form-group textarea {
  background-color: #ffffff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--color-secondary-light);
  box-shadow: 0 0 0 3px rgba(103, 65, 147, 0.25);
}

/* ANIMACIONES SCROLL REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* BOTÓN FLOTANTE WHATSAPP */
.whatsapp-floating {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  z-index: 999;
  transition: var(--transition);
}
.whatsapp-floating:hover { transform: scale(1.1) rotate(5deg); }
.whatsapp-floating svg { width: 30px; height: 30px; fill: currentColor; }

/* FOOTER */
.site-footer {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: 4.5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.footer-links {
  list-style: none;
  margin-top: 0.5rem;
}
.footer-links li {
  margin-bottom: 0.6rem;
}
.footer-links a {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--color-secondary-light);
  text-decoration: underline;
}
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.footer-credit {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.footer-credit a {
  color: var(--color-secondary-light);
  font-weight: 700;
  text-decoration: underline;
  transition: var(--transition);
}
.footer-credit a:hover {
  color: var(--color-text-main);
}

/* ==========================================================
   RESPONSIVE (MÓVIL ERGONÓMICO: CONTROLES A LA IZQUIERDA, LOGO CENTRO, BURGER A LA DERECHA)
   ========================================================== */
@media (max-width: 868px) {
  .header-left {
    order: 3;
    flex: 0 0 auto;
  }
  .header-center {
    order: 2;
    flex: 1;
  }
  .header-right {
    order: 1;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 0.75rem;
  }
  .header-right .btn-portfolio {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  /* Drawer de Navegación Móvil */
  .main-nav {
    display: none;
    position: fixed;
    top: 82px;
    right: 0;
    width: 280px;
    height: calc(100vh - 82px);
    background-color: var(--header-bg);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--color-border);
    padding: 2.5rem 2rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 999;
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }
  
  .main-nav .mobile-portfolio-link {
    margin-top: 1.5rem;
    width: 100%;
    display: block; 
  }

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

  h1 { font-size: 2.35rem; }
  .contact-form { padding: 2rem; }
  .hero-video-section { min-height: 75vh; }
  .legal-table td:first-child { width: 42%; }
}
