/* Cachito de Software — sitio público (ver BRAND_STYLE_GUIDE.md) */

:root {
  --color-primary: #0EAD69;
  --color-secondary: #1C6FD9;
  --color-secondary-dark: #154F9E;
  --color-accent: #3ED6C6;
  --color-ink: #0B1F33;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F4F7FB;
  --color-text: #152238;
  --color-text-muted: #5B6B82;
  --color-border: #DCE4EE;
  --color-success: #0EAD69;
  --color-error: #D64545;

  --header-bg: rgba(255, 255, 255, 0.96);

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-card: 12px;
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(11, 31, 51, 0.08);
  --shadow-hover: 0 14px 32px rgba(11, 31, 51, 0.14);
  --shadow-header: 0 2px 10px rgba(11, 31, 51, 0.06);
  --shadow-header-scrolled: 0 8px 24px rgba(11, 31, 51, 0.1);
  --shadow-nav: 0 8px 16px rgba(11, 31, 51, 0.08);
  --transition: all 0.25s ease;
  --theme-transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* Tema oscuro: pensado para poca luz, no negro puro, buen contraste (WCAG AA) */
[data-theme="dark"] {
  --color-primary: #22C97F;
  --color-secondary: #5B9DFF;
  --color-secondary-dark: #8AB9FF;
  --color-accent: #52E6D5;
  --color-ink: #060B14;
  --color-surface: #121B29;
  --color-surface-alt: #0B1420;
  --color-text: #E8ECF3;
  --color-text-muted: #9CACC4;
  --color-border: #263349;
  --color-success: #22C97F;
  --color-error: #FF7A7A;

  --header-bg: rgba(11, 20, 32, 0.9);

  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.5);
  --shadow-header: 0 2px 14px rgba(0, 0, 0, 0.35);
  --shadow-header-scrolled: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-nav: 0 8px 20px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-text);
  overflow-x: hidden;
  background: var(--color-surface);
  transition: var(--theme-transition);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; transition: var(--theme-transition); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin-bottom: 20px;
}

p { margin-bottom: 15px; }

a { text-decoration: none; color: var(--color-secondary); transition: var(--transition); }
a:hover { color: var(--color-secondary-dark); }

ul { list-style: none; }
img { max-width: 100%; height: auto; }

.highlight { color: var(--color-secondary); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: 2px solid transparent;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.btn-primary {
  background-color: var(--color-secondary);
  color: white;
  border-color: var(--color-secondary);
}
.btn-primary:hover { background-color: var(--color-secondary-dark); border-color: var(--color-secondary-dark); color: white; }

.btn-secondary {
  background-color: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}
.btn-secondary:hover { background-color: var(--color-secondary); color: white; }

@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(28, 111, 217, 0.22); }
}

/* Animaciones de entrada (scroll-reveal). Progresivas: sin JS o con
   "reducir movimiento" activado, el contenido es siempre visible. */
.reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
  }
  .reveal.is-visible { opacity: 1; transform: none; }

  .hero-content > .reveal:nth-child(1) { transition-delay: 0s; }
  .hero-content > .reveal:nth-child(2) { transition-delay: 0.08s; }
  .hero-content > .reveal:nth-child(3) { transition-delay: 0.16s; }
  .hero-content > .reveal:nth-child(4) { transition-delay: 0.24s; }
  .hero-visual.reveal { transition-delay: 0.2s; }

  .servicios-grid .reveal:nth-child(1) { transition-delay: 0.05s; }
  .servicios-grid .reveal:nth-child(2) { transition-delay: 0.15s; }
  .servicios-grid .reveal:nth-child(3) { transition-delay: 0.25s; }

  .proceso-timeline .reveal:nth-child(1) { transition-delay: 0.05s; }
  .proceso-timeline .reveal:nth-child(2) { transition-delay: 0.13s; }
  .proceso-timeline .reveal:nth-child(3) { transition-delay: 0.21s; }
  .proceso-timeline .reveal:nth-child(4) { transition-delay: 0.29s; }
  .proceso-timeline .reveal:nth-child(5) { transition-delay: 0.37s; }

  .portfolio-grid .reveal:nth-child(1) { transition-delay: 0.05s; }
  .portfolio-grid .reveal:nth-child(2) { transition-delay: 0.15s; }
  .portfolio-grid .reveal:nth-child(3) { transition-delay: 0.25s; }
  .portfolio-grid .reveal:nth-child(4) { transition-delay: 0.35s; }
}

.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { font-size: 2.25rem; margin-bottom: 12px; }
.section-header p { color: var(--color-text-muted); max-width: 600px; margin: 0 auto; }

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-header);
  z-index: 1000;
  transition: box-shadow 0.3s ease, padding 0.3s ease, background-color 0.3s ease;
}
.header.scrolled { box-shadow: var(--shadow-header-scrolled); }
.header.scrolled .navbar { padding: 12px 0; }
.header.scrolled .logo-img { height: 36px; }

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; transition: padding 0.3s ease; }

.logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); }
.logo-img { height: 44px; transition: height 0.3s ease; }
.logo-text { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }

.footer-logo-img { filter: brightness(0) invert(1); }
.footer-logo a { display: flex; align-items: center; gap: 10px; color: white; }

.nav-links { display: flex; align-items: center; }
.nav-links li { margin-left: 28px; }
.nav-links a { color: var(--color-text); font-weight: 500; position: relative; }
.nav-links a:after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary);
  transition: var(--transition);
}
.nav-links a:hover:after, .nav-links a.active:after { width: 100%; }

.btn-contacto {
  background-color: var(--color-secondary);
  color: white !important;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
}
.btn-contacto:hover { background-color: var(--color-secondary-dark); }
.btn-contacto::after { display: none; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.menu-toggle span { display: block; width: 25px; height: 3px; background-color: var(--color-text); border-radius: 3px; transition: var(--transition); }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* Selector de tema claro/oscuro */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--color-secondary); color: var(--color-secondary); }
.theme-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.theme-toggle-icon { width: 19px; height: 19px; }
.theme-toggle-icon--sun { display: none; }
[data-theme="dark"] .theme-toggle-icon--sun { display: block; }
[data-theme="dark"] .theme-toggle-icon--moon { display: none; }
.nav-theme-item { display: flex; align-items: center; margin-left: 20px; }

/* Hero */
.hero {
  padding-top: 160px;
  padding-bottom: 96px;
  background:
    radial-gradient(ellipse 70% 60% at 85% 0%, rgba(28, 111, 217, 0.08), transparent),
    var(--color-surface-alt);
}
.hero-container { display: flex; align-items: center; gap: 48px; }
.hero-content { flex: 1.2; }
.hero h1 { font-size: 3rem; margin-bottom: 22px; }
.hero-lead { font-size: 1.2rem; color: var(--color-text-muted); max-width: 560px; margin-bottom: 32px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

.hero { position: relative; overflow: hidden; }

.hero-visual {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-visual::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(28, 111, 217, 0.22), rgba(62, 214, 198, 0.12) 55%, transparent 75%);
  filter: blur(40px);
  z-index: 0;
}
/* Logo del hero, en dos piezas animables (ver @keyframes logo-piece-* más
   abajo). .logo-assembled reconstruye la posición original de las dos
   piezas mediante porcentajes fijos (derivados del recorte de
   logotipoGeneral.png, 566x566px), así que escala igual en móvil (260px)
   y escritorio (340px). */
.logo-assembled {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 24px 48px rgba(28, 111, 217, 0.18));
}
.logo-piece { position: absolute; width: auto; height: auto; }
.logo-piece--green { left: 4.77%; top: 29.68%; width: 44.70%; height: 65.90%; }
.logo-piece--blue { left: 34.45%; top: 4.24%; width: 60.78%; height: 91.34%; }

@media (prefers-reduced-motion: no-preference) {
  .hero-visual::before { animation: pulse-glow 5s ease-in-out 1.6s infinite; }

  /* La pieza verde ya está en su sitio: solo se asienta con una aparición
     suave, quieta, mientras la azul entra volando por la derecha. */
  .logo-piece--green {
    animation: logo-piece-settle 0.5s ease-out both;
  }

  /* La azul entra desde fuera del viewport girando, y la curva "back-out"
     hace que se pase de largo un pelín y encaje con un golpe de muñeca:
     el "giro" final que cierra la animación. */
  .logo-piece--blue {
    animation: logo-piece-fly-in 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) 0.28s both;
  }

  /* Con las dos piezas ya encajadas, un giro compartido muy breve remata
     la sensación de "clic" y luego arranca el flotado continuo. */
  .logo-assembled {
    animation-name: logo-click-turn, float;
    animation-duration: 0.45s, 6s;
    animation-timing-function: ease-out, ease-in-out;
    animation-delay: 1.18s, 1.65s;
    animation-iteration-count: 1, infinite;
    animation-fill-mode: both, none;
  }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes logo-piece-settle {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes logo-piece-fly-in {
  0% { opacity: 0; transform: translate(120%, -12%) rotate(36deg) scale(0.85); }
  40% { opacity: 1; }
  100% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
}

@keyframes logo-click-turn {
  0%, 100% { transform: rotate(0deg); }
  45% { transform: rotate(2.5deg); }
  75% { transform: rotate(-1.5deg); }
}

/* Servicios */
.servicios { background-color: var(--color-surface); }
.servicios-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }

.servicio-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.servicio-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.servicio-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.3s ease;
}
.servicio-card:hover .servicio-icon { transform: scale(1.08) rotate(-4deg); }
.servicio-icon svg { width: 28px; height: 28px; }
.servicio-card h3 { font-size: 1.2rem; margin-bottom: 12px; }
.servicio-card p { color: var(--color-text-muted); margin-bottom: 0; }

/* Proceso */
.proceso { background-color: var(--color-surface-alt); }
.proceso-timeline { display: flex; justify-content: space-between; position: relative; margin-top: 40px; gap: 16px; }
.proceso-timeline:before {
  content: '';
  position: absolute;
  top: 28px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-border);
  z-index: 1;
}
.proceso-item { flex: 1; text-align: center; position: relative; z-index: 2; padding: 0 12px; }
.proceso-numero {
  width: 56px;
  height: 56px;
  background-color: var(--color-secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 auto 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.proceso-item:hover .proceso-numero { transform: scale(1.1); box-shadow: 0 10px 22px rgba(28, 111, 217, 0.35); }
.proceso-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.proceso-item p { color: var(--color-text-muted); font-size: 0.92rem; }

/* Portfolio */
.portfolio { background-color: var(--color-surface); }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }

.portfolio-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.portfolio-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.portfolio-media { position: relative; aspect-ratio: 16 / 10; background: var(--color-ink); overflow: hidden; }
.portfolio-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.portfolio-item:hover .portfolio-media img { transform: scale(1.06); }
.portfolio-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
}
.portfolio-media-placeholder span {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: white;
  opacity: 0.9;
}
.portfolio-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(11, 31, 51, 0.72);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.portfolio-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.portfolio-body h3 { font-size: 1.2rem; margin-bottom: 8px; }
.portfolio-body p { color: var(--color-text-muted); font-size: 0.95rem; flex: 1; }

.tech-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tech-chips li {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-secondary-dark);
  background: rgba(28, 111, 217, 0.08);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

.portfolio-links { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-ver {
  color: white;
  background: var(--color-secondary);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
}
.btn-ver:hover { background: var(--color-secondary-dark); color: white; }
.btn-ver-outline {
  background: transparent;
  color: var(--color-secondary);
  border: 1.5px solid var(--color-secondary);
}
.btn-ver-outline:hover { background: var(--color-secondary); color: white; }

.portfolio-empty {
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-card);
  color: var(--color-text-muted);
}

/* Sobre nosotros */
.sobre-nosotros { background-color: var(--color-surface-alt); }
.sobre-nosotros-content { display: flex; }
.sobre-nosotros-texto { flex: 1; }

.card-styled {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 44px;
  background-color: var(--color-surface);
  box-shadow: var(--shadow);
  transition: var(--theme-transition);
}

.sobre-nosotros-texto h2 { position: relative; padding-bottom: 15px; margin-bottom: 20px; }
.sobre-nosotros-texto h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background-color: var(--color-primary);
}

/* Divulgación */
.divulgacion {
  background:
    radial-gradient(ellipse 60% 55% at 85% 0%, rgba(14, 173, 105, 0.12), transparent),
    var(--color-surface-alt);
}
.divulgacion .portfolio-grid,
.divulgacion .portfolio-empty { margin-bottom: 40px; }

.divulgacion-cta {
  text-align: center;
  padding: 36px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}
.divulgacion-cta p { color: white; font-size: 1.05rem; margin-bottom: 18px; }
.btn-cta {
  display: inline-block;
  background: white;
  color: var(--color-ink);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  transition: var(--transition);
}
.btn-cta:hover { background: rgba(255, 255, 255, 0.85); color: var(--color-ink); }

/* Contacto */
.contacto { background-color: var(--color-surface); }
.contacto-wrap { max-width: 640px; margin: 0 auto; }

.contacto-card {
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 44px;
  transition: var(--theme-transition);
}

.contact-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 0.85rem; font-weight: 600; color: var(--color-text); }
.field input, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.96rem;
  outline: none;
  transition: var(--transition);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { border-color: var(--color-secondary); }
.field-error { color: var(--color-error); font-size: 0.82rem; }

.field-checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-secondary);
  flex-shrink: 0;
}
.field-checkbox a { font-weight: 600; }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.flash-list { list-style: none; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 8px; }
.flash-error { background: rgba(214, 69, 69, 0.08); border: 1px solid rgba(214, 69, 69, 0.25); color: var(--color-error); }
.flash-success { background: rgba(14, 173, 105, 0.08); border: 1px solid rgba(14, 173, 105, 0.25); color: var(--color-success); }

.contacto-direct {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.contacto-direct .contacto-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 1.02rem;
  color: var(--color-secondary);
  font-weight: 600;
  word-break: break-word;
}
.contacto-direct .contacto-link:hover { color: var(--color-secondary-dark); }

/* Footer */
.footer { background-color: var(--color-ink); color: white; padding: 56px 0 20px; transition: var(--theme-transition); }
.footer-content { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: rgba(255, 255, 255, 0.85); }
.footer-links a:hover { color: white; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.6); font-size: 0.88rem; }
.footer-legal-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-legal-links a { color: rgba(255, 255, 255, 0.6); font-size: 0.82rem; }
.footer-legal-links a:hover { color: white; }

/* Aviso de cookies (informativo, sin cookies no esenciales que requieran consentimiento) */
.cookie-notice {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 998;
  max-width: 640px;
  margin: 0 auto;
  background-color: var(--color-ink);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow-hover);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; font-size: 0.88rem; flex: 1; min-width: 220px; }
.cookie-notice a { color: var(--color-accent); font-weight: 600; }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; flex-shrink: 0; }

/* Páginas legales */
.legal-page { padding-top: 160px; padding-bottom: 96px; }
.legal-page .container { max-width: 800px; }
.legal-page h1 { font-size: 2.1rem; margin-bottom: 8px; }
.legal-page .legal-updated { color: var(--color-text-muted); font-size: 0.88rem; margin-bottom: 40px; }
.legal-page h2 { font-size: 1.3rem; margin-top: 40px; }
.legal-page p, .legal-page li { color: var(--color-text-muted); }
.legal-page ul { list-style: disc; padding-left: 22px; margin-bottom: 15px; }
.legal-page li { margin-bottom: 8px; }
.legal-page a { font-weight: 600; }
.legal-placeholder {
  background: rgba(214, 69, 69, 0.08);
  border: 1px solid rgba(214, 69, 69, 0.25);
  color: var(--color-error);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 600;
}

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background-color: var(--color-secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
}
.back-to-top.visible { opacity: 1; visibility: visible; }

/* Responsive */
@media (max-width: 992px) {
  .hero-container { flex-direction: column; text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  /* Ancho explícito: .logo-assembled ya no es un <img> con tamaño
     intrínseco, así que en flex-direction:column (donde align-items:center
     no estira) necesita un ancho definido del que heredar su 100%. */
  .hero-visual { order: -1; width: 100%; max-width: 260px; }

  .proceso-timeline { flex-direction: column; gap: 28px; }
  .proceso-timeline:before { display: none; }
}

@media (max-width: 768px) {
  section { padding: 64px 0; }
  .hero { padding-top: 128px; }

  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 78px;
    left: 0;
    width: 100%;
    background-color: var(--color-surface);
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    box-shadow: var(--shadow-nav);
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: 999;
  }
  .nav-links.active { transform: translateY(0); }
  .nav-links li { margin: 10px 0; width: 100%; text-align: center; }
  .nav-links a { display: block; padding: 10px 0; }
  .nav-theme-item { margin: 10px 0; justify-content: center; }
  body.menu-open { overflow: hidden; }

  .hero h1 { font-size: 2.1rem; }
  .section-header h2 { font-size: 1.8rem; }

  .card-styled { padding: 28px; }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; }
  .contacto-card { padding: 24px; }
}
