/*
 * ORIZON — Capa global de mejora (enhance.css)
 * Se carga en TODAS las páginas, después del CSS específico, para unificar
 * el look, modernizar efectos y corregir inconsistencias. No reemplaza nada:
 * refina. Autor: mantenimiento 2026.
 */

/* ============================================================
   1. Base global
   ============================================================ */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; }
::selection { background: var(--color-primario-medio); color: #fff; }

/* Foco de teclado accesible y de marca */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.form-control:focus-visible, .form-select:focus-visible {
  outline: 3px solid rgba(0, 73, 200, 0.35);
  outline-offset: 2px;
}

/* ============================================================
   2. Encabezado interior unificado (.page-header)
   Antes solo estaba estilizado en nosotros.php. Ahora es consistente
   en Nosotros, Servicios, Únete, Blog y Contacto.
   ============================================================ */
.page-header {
  position: relative;
  overflow: hidden;
  padding: 6rem 0 5rem;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(52, 83, 189, 0.5), transparent 45%),
    radial-gradient(circle at 12% 90%, rgba(0, 73, 200, 0.42), transparent 42%),
    linear-gradient(135deg, var(--color-primario-oscuro) 0%, var(--color-primario-medio) 100%);
}
/* Neutraliza el overlay antiguo definido en nosotros.css */
.page-header::before { display: none !important; }
/* Patrón de puntos sutil */
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.6;
  pointer-events: none;
}
.page-header .container { position: relative; z-index: 2; }
.page-header-title {
  color: #fff !important;
  font-size: 3rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.page-header .lead { position: relative; z-index: 2; color: rgba(255, 255, 255, 0.85) !important; }

@media (max-width: 768px) {
  .page-header { padding: 4.5rem 0 3.5rem; }
  .page-header-title { font-size: 2.1rem; }
}

/* ============================================================
   3. Navbar con efecto al hacer scroll
   ============================================================ */
.navbar { transition: padding 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease; }
.navbar.scrolled {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  box-shadow: 0 6px 24px rgba(1, 32, 63, 0.18);
}
.navbar-brand img { transition: height 0.35s ease; }
.navbar.scrolled .navbar-brand img { height: 58px; }

/* ============================================================
   4. Botones: micro-interacciones consistentes
   ============================================================ */
.btn { transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease; }
.btn-primary {
  background-color: var(--color-primario-medio);
  border-color: var(--color-primario-medio);
}
.btn-primary:hover {
  background-color: var(--color-primario-oscuro);
  border-color: var(--color-primario-oscuro);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 73, 200, 0.28);
}
.btn-details:hover, .btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 73, 200, 0.22);
}

/* ============================================================
   5. Formularios: foco azul de marca (antes usaba el teal viejo)
   ============================================================ */
.form-control, .form-select { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.form-control:focus, .form-select:focus {
  border-color: var(--color-primario-medio) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 73, 200, 0.18) !important;
}

/* Base de formularios (compartida por Contacto y Únete) */
.contact-form .form-control,
.contact-form .form-select {
  border: 1px solid #ced4da;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.btn-submit {
  background-color: var(--color-primario-medio);
  color: #fff;
  font-weight: 600;
  padding: 0.85rem 2.6rem;
  border-radius: 50px;
  border: none;
}
.btn-submit:hover { background-color: var(--color-primario-oscuro); color: #fff; }

/* ============================================================
   6. Tarjetas: hover unificado y más moderno
   ============================================================ */
.value-card, .benefit-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 26px rgba(1, 32, 63, 0.06);
  border: 1px solid rgba(1, 32, 63, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.value-card:hover, .benefit-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 44px rgba(1, 32, 63, 0.12);
}
.value-icon, .benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 73, 200, 0.12), rgba(52, 83, 189, 0.12));
  color: var(--color-primario-medio) !important;
  margin-bottom: 1.1rem !important;
  font-size: 1.8rem !important;
}
.service-card-detailed { border-radius: 16px !important; }

/* Íconos de servicios del home con "chip" */
.service-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 73, 200, 0.1), rgba(52, 83, 189, 0.1));
  height: 56px;
}

/* Imágenes de contenido con realce suave */
.content-section img, .new-section-success img, .blog-card-img-top {
  border-radius: 14px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.content-section img:hover, .new-section-success img:hover { transform: scale(1.02); }

/* ============================================================
   7. Animación de aparición al hacer scroll (reveal)
   Failsafe: la clase .reveal-on solo la agrega el JS. Sin JS, el
   contenido se ve normal (nunca queda oculto).
   ============================================================ */
.reveal-on .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal-on .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal-on .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   8. Botón "volver arriba"
   ============================================================ */
#backToTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--color-primario-medio);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 73, 200, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.3s ease;
  z-index: 1030;
  cursor: pointer;
}
#backToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { background: var(--color-primario-oscuro); transform: translateY(-3px); }
#backToTop svg { width: 22px; height: 22px; stroke: #fff; }

/* ============================================================
   9. Detalles finos
   ============================================================ */
.section-title { position: relative; }
.footer-link-dev { color: var(--color-acento); }
.footer-link-dev:hover { color: #fff; }
