/* =========================================
   components.css — Header, botones, formularios, footer, hero dinámico, utilidades UI
   Proyecto: CONSULTOR DIGITAL
   ========================================= */


/* =====================================================
   1. HEADER / NAVBAR
   ===================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--color-neutral-100);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: clamp(10px, 0.6vw + 8px, 14px);
}

/* ----- Logo ----- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  font-size: clamp(1rem, 1vw + 0.9rem, 1.25rem);
  letter-spacing: 0.2px;
  color: var(--color-brand-700);
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo:hover,
.logo:focus {
  color: var(--color-accent-600);
  outline: none;
}

.logo__dot {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--color-accent-600);
  box-shadow: 0 0 6px var(--color-green-glow);
  margin-right: 0.15rem;
  vertical-align: middle;
}

/* ----- Navegación ----- */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-family: var(--font-head);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.2px;
}

.nav-links a {
  color: var(--color-brand-700);
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
  position: relative;
  font-size: 0.95rem;
  transition: color var(--motion-base) var(--ease-standard);
}

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

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  height: 2px; width: 0;
  background: var(--color-accent-600);
  transition: width var(--motion-base) var(--ease-standard);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ----- Menú móvil ----- */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--color-brand-700);
}

.menu-toggle span {
  font-size: 22px;
  line-height: 1;
}



/* =====================================================
   2. BOTONES
   ===================================================== */
.btn {
  --btn-padding-y: 0.75rem;
  --btn-padding-x: 1.25rem;
  --btn-radius: var(--radius-lg);
  --btn-transition: var(--motion-base) var(--ease-standard);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  font-size: 1rem;
  line-height: 1.2;

  padding: var(--btn-padding-y) var(--btn-padding-x);
  min-height: 45px;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--btn-transition),
    color var(--btn-transition),
    box-shadow var(--btn-transition),
    transform var(--btn-transition);
}

.btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.btn:active {
  transform: scale(0.98);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.btn:focus-visible {
  outline-offset: 2px;
}

/* ----- Variantes ----- */
.btn-primary {
  background: var(--color-brand-700);
  color: var(--color-neutral-100);
  border-color: var(--color-brand-700);
}
.btn-primary:hover {
  background: var(--color-accent-600);
  border-color: var(--color-accent-600);
}

.btn-outline {
  background: var(--color-neutral-100);
  color: var(--color-brand-700);
  border: 1px solid var(--color-brand-700);
}
.btn-outline:hover {
  background: var(--color-accent-600);
  color: var(--color-neutral-100);
  border-color: var(--color-accent-600);
}

/* ----- Botón verde institucional ----- */
.btn-green {
  --btng-bg: var(--color-green-500);
  --btng-bg-hover: color-mix(in srgb, var(--color-green-500) 78%, var(--color-accent-600) 22%);
  --btng-text: var(--color-brand-700);
  --btng-shadow-rest: 0 4px 10px rgba(0,0,0,.10);
  --btng-shadow-hover: 0 6px 16px rgba(0,0,0,.12);
  --btng-glow-rest: 0 0 8px rgba(255,255,210,.45);
  --btng-glow-hover: 0 0 12px rgba(255,255,210,.65);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;

  font-family: var(--font-head);
  font-weight: var(--fw-bold);
  line-height: 1.2;

  padding: .9rem 1.6rem;
  min-height: 45px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: var(--btng-bg);
  color: var(--btng-text);
  transition:
    background var(--motion-base) var(--ease-standard),
    color var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    transform var(--motion-base) var(--ease-standard);
  box-shadow: var(--btng-shadow-rest), var(--btng-glow-rest);
}

.btn-green::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: var(--btng-bg);
  filter: blur(12px);
  opacity: .18;
  z-index: -1;
  transition: opacity .25s ease, filter .25s ease;
  will-change: opacity, filter;
}

.btn-green:hover {
  background: var(--btng-bg-hover);
  transform: translateY(-1px) scale(1.015);
  box-shadow: var(--btng-shadow-hover), var(--btng-glow-hover);
  color: var(--color-neutral-100);
}
.btn-green:hover::before {
  opacity: .38;
  filter: blur(13px);
}

.btn-green:active {
  transform: translateY(0) scale(.985);
  box-shadow: 0 3px 8px rgba(0,0,0,.10), 0 0 8px rgba(255,255,210,.45);
}
.btn-green:active::before {
  opacity: .30;
  filter: blur(12px);
}
.btn-green:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--color-accent-600) 30%, white);
  outline-offset: 2px;
}
.btn-green:disabled,
.btn-green[aria-disabled="true"] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .btn-green,
  .btn-green::before { transition: none; }
}

/* ----- Botones de ícono ----- */
.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-brand-700);
  color: var(--color-neutral-100);
  transition: background var(--btn-transition), transform var(--btn-transition);
}
.btn-icon:hover {
  background: var(--color-accent-600);
  transform: translateY(-1px);
}

.btn-icon--social { width: 40px; height: 40px; }

/* ----- Botón WhatsApp ----- */
.btn-whatsapp {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 30%;
  background: #7BCB5A;
  color: #fff;
  text-decoration: none;
  border: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.25s ease, transform 0.2s ease, border 0.25s ease;
  z-index: 1000;
}
.btn-whatsapp:hover,
.btn-whatsapp:focus-visible {
  transform: scale(1.15);
  background: #7BCB5A;
  color: var(--color-neutral-100);
  border: 2px solid var(--color-neutral-100);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.btn-whatsapp svg { width: 35px; height: 35px; }

.msg-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #C9E56F;
  color: #0B3B60;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.25rem 0.45rem;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  min-width: 20px;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.1);
}


/* =====================================================
   3. FORMULARIOS
   ===================================================== */
.field { margin-bottom: var(--space-5); }
label { display:block; font-weight:var(--fw-semibold); margin-bottom:var(--space-2); }

.form-control,
input[type], textarea, select {
  width:100%;
  appearance:none;
  border:1px solid var(--color-neutral-200);
  border-radius:var(--radius-md);
  padding:12px 14px;
  background:#fff;
  color:var(--color-text-main);
  transition:border-color var(--motion-base)var(--ease-standard),
             box-shadow var(--motion-base)var(--ease-standard);
}
textarea { min-height:140px; resize:vertical; }

input::placeholder, textarea::placeholder {
  color: color-mix(in oklab, var(--color-neutral-700), white 35%);
}
input:focus, textarea:focus, select:focus {
  outline:none;
  border-color:var(--color-accent-600);
  box-shadow:0 0 0 3px color-mix(in oklab,var(--color-accent-600)30%,white);
}

.form-help { font-size:0.9rem; color:var(--color-text-muted); }
.is-invalid{ border-color:var(--color-error)!important; }
.is-valid{ border-color:var(--color-success)!important; }
.input-inline{ display:flex; align-items:center; gap:0.5rem; }
input[type="checkbox"],
input[type="radio"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  accent-color: var(--color-accent-600);
  width: 18px;
  height: 18px;
  cursor: pointer;
}




/* =====================================================
   4. FOOTER
   ===================================================== */
.footer {
  background: var(--color-neutral-100);
  border-top: 1px solid var(--color-neutral-200);
  padding: var(--space-6) 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-align: center;
}
.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-3);
}
.footer a { color: var(--color-neutral-900); text-decoration: none; }
.footer a:hover { color: var(--color-accent-600); }



/* =====================================================
   5. HERO DINÁMICO — FUSIÓN FINAL (prueba_03 + estable + FIX 2025)
   ===================================================== */
.hero-dinamico {
  background: linear-gradient(135deg, var(--color-brand-700) 0%, #001C33 100%);
  color: #fff;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
  padding-top: calc(var(--header-height) + 3rem);
  position: relative;
  overflow: hidden;
}

/* --- Líneas animadas --- */
.hero-dinamico .bg-lines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 6px);
  animation: moveLines 30s linear infinite;
  z-index: 1;
}
@keyframes moveLines {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 100px 200px, 0 200px; }
}

/* --- Contenedor principal --- */
.hero-dinamico .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  position: relative;
  z-index: 2;
  width: min(1200px, 100% - 2 * var(--space-5));
  margin-inline: auto;
  text-align: left; /* mantiene texto alineado a la izquierda */
  color: #fff;
}

/* --- Bloque de texto principal --- */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero-dinamico h1,
.hero-dinamico h2,
.hero-dinamico h3 {
  color: #fff;
}

.hero-dinamico p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  max-width: 65ch;
}

.hero-dinamico .pillars-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: .4rem 1rem;
  font-size: .85rem;
  letter-spacing: .5px;
  margin-bottom: var(--space-4);
}

/* --- Botón verde y contenedor de acciones --- */
.hero-dinamico .actions {
  margin-top: var(--space-5);
  text-align: left; /* mantiene el botón a la izquierda */
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.hero-dinamico .actions .btn-green {
  align-self: flex-start;
}

/* --- Bloque rotativo --- */
.hero-dinamico .hero-rotating {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: inset 0 0 20px rgba(0, 169, 199, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  max-width: 500px;
  height: 400px;
}

.rotating-frame {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.rotating-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.rotating-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-light);
  margin: 0;
  line-height: 1.2;
}

.rotating-content {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.problem-block,
.solution-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
}

.label {
  font-size: 0.85rem;
  letter-spacing: 1px;
  font-weight: 600;
  opacity: 0.8;
  text-transform: uppercase;
}

.hero-dinamico #problem-line,
.hero-dinamico #solution-line {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.4;
}

.hero-dinamico #problem-line {
  color: var(--color-accent-600);
  text-shadow: 0 0 8px rgba(0, 169, 199, 0.35);
}
.hero-dinamico #solution-line {
  color: var(--color-green-500);
  text-shadow: 0 0 8px rgba(201, 229, 111, 0.35);
}

/* --- Responsive interno --- */
@media (max-width: 1024px) {
  .hero-dinamico .container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    align-items: center;
    text-align: center;
  }
  .hero-dinamico .actions {
    justify-content: center; 
  }
  .hero-dinamico .hero-rotating {
    margin-top: var(--space-6);
    width: 90%;
  }
}

@media (max-width: 600px) {
  .hero-dinamico #problem-line,
  .hero-dinamico #solution-line {
    font-size: 1.05rem;
    line-height: 1.3;
  }
}
