/* ============================================
   FONEMIA - CSS COMPARTIDO
   Paleta: Dorado #d09100 + Gris pizarra #3a3e46
   Tema oscuro
   Fuentes: Sora (títulos) + DM Sans (cuerpo)
   ============================================ */

/* ---- Tipografías autoalojadas (sin conexión a servidores externos) ---- */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/sora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/sora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('fonts/dmsans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('fonts/dmsans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Variables ---- */
:root {
  --primary: #d09100;
  --primary-light: #e8a800;
  --primary-dark: #b07800;
  --primary-on-light: #966800; /* dorado accesible sobre blanco (4.9:1) */
  --bg: #11141a;
  --bg-card: #1a1e26;
  --bg-light: #ffffff;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --border: #2e3746;
  --slate-900: #0f172a;
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  background-image:
    linear-gradient(to bottom, rgba(17,20,26,0.8), rgba(17,20,26,0.92)),
    url('hero.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 640px) { .container { padding: 0 2rem; } }
@media (min-width: 1024px) { .container { padding: 0 3rem; } }

/* ---- Header ---- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17,20,26,0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(46,55,70,0.3);
  transition: all 0.3s;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo img {
  height: 3.25rem;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s;
}
.logo:hover img { transform: scale(1.05); }

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

nav a {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(243,244,246,0.85);
  transition: color 0.2s;
}
nav a:hover, nav a.active { color: var(--primary); }

.header-cta { display: flex; align-items: center; gap: 1rem; }

.phone-block { text-align: right; margin-right: 0.5rem; }
.phone-label { display: block; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.phone-link { font-size: 1rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.4rem; transition: color 0.2s; }
.phone-link:hover { color: var(--primary); }

/* Menú hamburguesa */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text); }
.menu-toggle svg { display: block; }

/* Mobile nav */
.mobile-nav {
  display: none;
  background: rgba(17,20,26,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(46,55,70,0.4);
  padding: 1.5rem;
}
.mobile-nav.open { display: block; }
.mobile-nav nav { flex-direction: column; align-items: flex-start; gap: 1rem; }
.mobile-nav nav a { font-size: 1.1rem; }
.mobile-nav .phone-link-mobile {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.1rem; font-weight: 700; padding: 0.75rem 0;
  border-top: 1px solid rgba(46,55,70,0.3);
  margin-top: 0.5rem;
}

@media (max-width: 767px) {
  nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-weight: 700; font-size: 1rem;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  border: none;
}
.btn-primary {
  background: var(--primary); color: #11141a;
  box-shadow: 0 4px 20px rgba(208,145,0,0.3);
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(208,145,0,0.4); }
.btn-outline {
  background: transparent; color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.5); }
.btn-outline-primary {
  background: #fff; color: #1e293b;
  border: 2px solid #cbd5e1;
}
.btn-outline-primary:hover { background: #f8fafc; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; }

/* ---- Cards ---- */
.card {
  background: rgba(26,30,38,0.5);
  border: 1px solid rgba(46,55,70,0.5);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s, transform 0.3s;
}
.card:hover { border-color: rgba(208,145,0,0.4); transform: translateY(-4px); }

/* ---- Sections ---- */
.section-dark {
  padding: 5rem 0;
  background: rgba(17,20,26,0.5);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(46,55,70,0.2);
}
.section-light {
  padding: 5rem 0;
  background: #ffffff;
  color: #0f172a;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  position: relative; z-index: 1;
}
.section-light h2, .section-light h3 { color: #0f172a; }
.section-light p { color: #475569; }

.eyebrow {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--primary);
  display: block; margin-bottom: 1rem;
}
.section-light .eyebrow { color: var(--primary-on-light); }

/* ---- Icon badge ---- */
.icon-badge {
  width: 3rem; height: 3rem;
  border-radius: 0.875rem;
  background: rgba(208,145,0,0.1);
  border: 1px solid rgba(208,145,0,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}
.section-light .icon-badge { background: rgba(208,145,0,0.08); }

/* ---- Contact info ---- */
.contact-item { display: flex; align-items: center; gap: 1rem; }
.contact-icon {
  width: 3rem; height: 3rem;
  border-radius: 0.875rem;
  background: var(--bg-card);
  border: 1px solid rgba(46,55,70,0.6);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); flex-shrink: 0;
}
.contact-label { font-size: 0.7rem; color: var(--text-muted); display: block; }
.contact-value { font-weight: 700; font-size: 1rem; color: var(--text); }
.contact-value a { color: inherit; transition: color 0.2s; }
.contact-value a:hover { color: var(--primary); }

/* ---- Form ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: rgba(243,244,246,0.8); margin-bottom: 0.4rem; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 0.75rem 1rem;
  background: rgba(17,20,26,0.5);
  border: 1px solid rgba(46,55,70,0.7);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--primary); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: none; }
.form-select option { background: #1a1e26; color: var(--text); }

/* ---- Footer ---- */
footer {
  background: #0b0d13;
  border-top: 1px solid rgba(46,55,70,0.2);
  padding: 4rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}
.footer-logo img { height: 3rem; width: auto; object-fit: contain; }
.footer-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; max-width: 20rem; margin-top: 1rem; }
.footer-heading { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); margin-bottom: 1rem; }
.footer-list { list-style: none; }
.footer-list li { margin-bottom: 0.5rem; }
.footer-list a { font-size: 0.875rem; color: var(--text-muted); transition: color 0.2s; }
.footer-list a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid rgba(46,55,70,0.15);
  padding: 1.5rem 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { font-size: 0.8rem; color: var(--text-muted); transition: color 0.2s; }
.footer-bottom-links a:hover { color: var(--primary); }

/* ---- Pillar cards (section-light) ---- */
.pillar-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.3s;
}
.pillar-card:hover { border-color: rgba(208,145,0,0.4); }
.pillar-num {
  width: 2rem; height: 2rem;
  background: rgba(208,145,0,0.1);
  border: 1px solid rgba(208,145,0,0.2);
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; color: var(--primary-on-light);
}
.pillar-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.1rem; color: #0f172a; }
.pillar-text { font-size: 0.95rem; color: #475569; line-height: 1.65; margin-top: 0.75rem; }

/* ---- Grid utilities ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }

@media (max-width: 1023px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) {
  .footer-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 768px) and (max-width: 1023px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

/* ---- Pulse animation ---- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }

/* ---- Badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(208,145,0,0.1);
  border: 1px solid rgba(208,145,0,0.2);
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

/* ---- Page hero ---- */
.page-hero { padding: 6rem 0 4rem; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; color: #fff; margin-bottom: 1.25rem; }
.page-hero p { font-size: 1.1rem; color: rgba(243,244,246,0.75); max-width: 42rem; line-height: 1.7; }


/* ---- Accesibilidad ---- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute; left: -9999px;
  background: var(--primary); color: #11141a;
  padding: 0.75rem 1.25rem; font-weight: 700; z-index: 999;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; top: 0; }

@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;
  }
}

/* ---- Consentimiento del formulario ---- */
.form-consent {
  display: flex; align-items: flex-start; gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.form-consent input[type="checkbox"] {
  margin-top: 0.2rem; width: 1.05rem; height: 1.05rem;
  accent-color: var(--primary); flex-shrink: 0; cursor: pointer;
}
.form-consent label {
  font-size: 0.85rem; color: rgba(243,244,246,0.7); line-height: 1.5;
}
.form-consent a { color: var(--primary); text-decoration: underline; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }

/* ---- Páginas de texto legal ---- */
.legal { padding: 3rem 0 5rem; }
.legal .container { max-width: 48rem; }
.legal h2 {
  font-size: 1.35rem; color: #fff;
  margin: 2.75rem 0 1rem; padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.legal h3 { font-size: 1.05rem; color: #fff; margin: 1.75rem 0 0.6rem; }
.legal p, .legal li {
  color: rgba(243,244,246,0.72); line-height: 1.75;
  margin-bottom: 1rem; font-size: 0.97rem;
}
.legal ul { padding-left: 1.35rem; margin-bottom: 1.25rem; }
.legal li { margin-bottom: 0.5rem; }
.legal a { color: var(--primary); text-decoration: underline; }
.legal strong { color: rgba(243,244,246,0.92); }
.legal table {
  width: 100%; border-collapse: collapse; margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.legal th, .legal td {
  border: 1px solid var(--border); padding: 0.7rem 0.85rem;
  text-align: left; color: rgba(243,244,246,0.72); vertical-align: top;
}
.legal th { color: #fff; font-weight: 600; background: rgba(255,255,255,0.03); }
.legal-note {
  border-left: 3px solid var(--primary);
  background: rgba(208,145,0,0.07);
  padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2rem;
}
.legal-note p { margin: 0; font-size: 0.9rem; }
.legal-updated { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 2.5rem; }

/* ---- Rejilla de servicios (5 tarjetas) ---- */
.grid-services {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}
.grid-services .card { padding: 1.5rem !important; }
@media (max-width: 1200px) { .grid-services { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { .grid-services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grid-services { grid-template-columns: 1fr; } }

/* ---- Filas del formulario, adaptables ---- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---- Distribución de la página de contacto ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 4rem;
  align-items: start;
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ---- Tablas legales en pantallas estrechas ---- */
@media (max-width: 600px) {
  .legal table, .legal tbody, .legal tr { display: block; width: 100%; }
  .legal thead { display: none; }
  .legal th, .legal td { display: block; width: 100%; border: 0; padding: 0.35rem 0; }
  .legal tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
  }
  .legal th { color: #fff; font-weight: 600; background: none; padding-bottom: 0.15rem; }
}
