/* ============================================================
   Formulario de Retos · Innovación Abierta
   estratek en alianza con connect — Manual de Marca ETK 2026
   Piel navy / cyan. Reemplaza la versión teal.
   ============================================================ */
:root {
  --navy:       #101D40;   /* fondo oscuro principal */
  --navy-mid:   #132052;   /* navy secundario */
  --navy-soft:  #1A2A5C;   /* tarjetas internas oscuras */
  --royal:      #1F3FAD;
  --blue-vivo:  #2650D8;
  --blue-acc:   #4A7FFF;   /* chevron izquierdo */
  --cyan:       #00E5C8;   /* chevron derecho / acento */
  --light-bg:   #F3F7FF;   /* fondo claro de la página */
  --white:      #FFFFFF;
  --ink:        #101D40;   /* texto principal sobre claro */
  --body-txt:   #374061;   /* texto de párrafo */
  --gray-txt:   #6B7280;
  --line:       rgba(16,29,64,0.10);
  --line-soft:  rgba(16,29,64,0.07);
  --field-bg:   #FFFFFF;
  --err:        #C0392B; --err-lt:#FDECEA;
  --ok:         #0F9D78; --ok-lt:#E6FBF5;
  --font:       'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --shadow-sm:  0 1px 2px rgba(16,29,64,0.04);
  --shadow-md:  0 8px 30px rgba(16,29,64,0.10);
  --radius:     16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--light-bg);
  color: var(--ink);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

@media print {
  @page { margin: 11mm; }
  body { background: #fff; }
  .no-print { display: none !important; }
  .status-banner, .output-section, .intro-card { display: none !important; }
  .topbar { position: static !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  /* Flujo continuo: no forzar un salto de página por cada sección (evita huecos) */
  .section { break-inside: auto; page-break-inside: auto; margin-bottom: 10px; box-shadow: none; border: 1px solid #e6e9f2; }
  .container { padding: 0; max-width: none; }
  /* Solo evitar que una pregunta concreta se corte entre páginas */
  .q-block { break-inside: avoid; page-break-inside: avoid; }
  textarea { min-height: 0; height: auto; }
}

/* ── HEADER / LOCKUP DE ALIANZA ──────────────────────────── */
.topbar {
  background:
    radial-gradient(900px 380px at 88% -40%, rgba(38,80,216,0.40) 0%, transparent 60%),
    radial-gradient(700px 300px at 10% 140%, rgba(0,229,200,0.12) 0%, transparent 60%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, #16245C 100%);
  padding: 28px 20px 30px;
  position: relative;
  overflow: hidden;
}
/* línea curva decorativa (motivo ETK) */
.topbar::after {
  content: ""; position: absolute; left: -120px; bottom: -160px;
  width: 360px; height: 360px; border-radius: 50%;
  border: 1.5px solid rgba(0,229,200,0.16); pointer-events: none;
}
.lockup {
  display: flex; align-items: center; justify-content: center; gap: 0;
  background: var(--light-bg);
  border-radius: 999px;
  padding: 16px 40px;
  max-width: 620px; margin: 0 auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.28);
  position: relative; z-index: 1;
}
.lockup a { display: inline-flex; align-items: center; }
.lockup img { display: block; }
.lockup .etk-logo  { height: 30px; }
.lockup .conn-logo { height: 40px; }
.lockup .divider {
  width: 1.5px; height: 44px; background: rgba(16,29,64,0.22);
  margin: 0 30px;
}
.alliance-line {
  text-align: center; margin: 16px auto 0; position: relative; z-index: 1;
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(255,255,255,0.62);
}
.alliance-line b { color: var(--cyan); font-weight: 700; }

/* ── TÍTULO / TAGLINE ────────────────────────────────────── */
.intro-head {
  max-width: 860px; margin: 0 auto; padding: 40px 20px 0; text-align: center;
}
.intro-head .eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(16,29,64,0.05); border: 1px solid var(--line);
  color: var(--navy); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.intro-head .eyebrow .chev { color: var(--cyan); font-weight: 900; letter-spacing: -2px; }
.intro-head h1 {
  font-size: clamp(24px, 4vw, 34px); font-weight: 800;
  letter-spacing: -0.6px; line-height: 1.15; color: var(--navy);
}
.intro-head .tagline {
  font-size: 15px; color: var(--body-txt); margin-top: 12px; line-height: 1.6;
}

/* ── CONTENEDOR ──────────────────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 28px 20px 0; }

.intro-card {
  background: var(--white); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 26px; border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.intro-card h3 {
  color: var(--navy); font-size: 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.intro-card h3::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--royal), var(--blue-vivo)); flex-shrink: 0;
}
.intro-card p { font-size: 13.5px; color: var(--body-txt); line-height: 1.7; margin-bottom: 8px; }
.time-badge {
  display: inline-block; background: rgba(0,229,200,0.12);
  color: #0A7E6E; font-size: 12px; font-weight: 700;
  padding: 5px 14px; border-radius: 999px; margin-top: 4px;
}

/* ── SECCIONES ───────────────────────────────────────────── */
.section {
  background: var(--white); border-radius: var(--radius); padding: 30px 32px;
  margin-bottom: 20px; border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.section-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-vivo) 130%);
  color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 6px 16px; border-radius: 999px; margin-bottom: 14px;
}
.section h2 {
  font-size: 21px; font-weight: 800; color: var(--navy);
  margin-bottom: 6px; letter-spacing: -0.4px;
}
.section .desc { font-size: 13.5px; color: var(--gray-txt); margin-bottom: 26px; line-height: 1.65; }

/* ── PREGUNTAS ───────────────────────────────────────────── */
.q-block { margin-bottom: 26px; }
.q-label {
  font-size: 15.5px; font-weight: 700; color: var(--navy);
  margin-bottom: 4px; display: flex; gap: 10px; align-items: flex-start;
}
.q-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--royal), var(--blue-vivo));
  color: #fff; font-size: 12px; font-weight: 800; flex-shrink: 0; margin-top: 1px;
  box-shadow: 0 2px 8px rgba(38,80,216,0.30);
}
.q-hint { font-size: 12.5px; color: var(--gray-txt); margin: 6px 0 10px 38px; line-height: 1.65; }
.req { color: var(--blue-vivo); font-weight: 800; }

/* ── CAMPOS ──────────────────────────────────────────────── */
textarea, input[type="text"], input[type="email"] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--field-bg); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 104px; padding: 13px 15px; resize: vertical; line-height: 1.65; }
input[type="text"], input[type="email"] { height: 44px; padding: 0 15px; }
textarea:focus, input[type="text"]:focus, input[type="email"]:focus {
  outline: none; border-color: var(--blue-acc);
  box-shadow: 0 0 0 4px rgba(74,127,255,0.14);
}
textarea::placeholder, input::placeholder { color: #A4ABBD; }

/* errores */
.field-error { color: var(--err); font-size: 12.5px; margin: 7px 0 0 38px; display: none; font-weight: 600; }
.field-error.show { display: block; }
.invalid textarea, textarea.invalid,
.invalid input[type="text"], input.invalid,
.invalid input[type="email"] { border-color: var(--err); background: var(--err-lt); }
.options-grid.invalid { outline: 2px solid var(--err); outline-offset: 5px; border-radius: 12px; }

/* ── CHIPS / OPCIONES ────────────────────────────────────── */
.options-grid { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 6px; }
.opt {
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  font-size: 13px; font-weight: 600; cursor: pointer; background: #fff;
  color: var(--navy); transition: all .15s; user-select: none; font-family: inherit;
}
.opt:hover { border-color: var(--blue-acc); color: var(--blue-vivo); }
.opt.sel {
  background: linear-gradient(135deg, var(--navy), var(--blue-vivo));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(38,80,216,0.30);
}

/* ── TABLAS (actores / kpi / empresa) ────────────────────── */
.actor-table, .kpi-table, .company-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.actor-table td, .kpi-table td, .company-table td {
  border-bottom: 1px solid var(--line-soft); padding: 12px 15px; font-size: 14px;
}
.actor-table tr:last-child td, .kpi-table tr:last-child td, .company-table tr:last-child td { border-bottom: none; }
.label-cell {
  background: rgba(16,29,64,0.04); color: var(--navy);
  font-weight: 700; font-size: 12.5px; width: 180px; vertical-align: middle;
}
.kpi-table .label-cell { width: 130px; font-size: 12px; }
.input-cell { background: #fff; }
.input-cell input { border: none; background: transparent; width: 100%; font-size: 14px; color: var(--ink); padding: 2px 0; height: auto; }
.input-cell input:focus { outline: none; box-shadow: none; }

.divider { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

/* ── DATOS DE CONTACTO (destacado) ───────────────────────── */
.contact-card {
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(0,229,200,0.10) 0%, transparent 65%),
    linear-gradient(135deg, rgba(38,80,216,0.07) 0%, rgba(16,29,64,0.05) 100%);
  border: 1.5px solid rgba(38,80,216,0.22);
  border-radius: 14px;
  padding: 22px 24px;
  margin-top: 6px;
}
.contact-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.contact-icon {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue-vivo));
  color: var(--cyan); font-weight: 900; font-size: 18px; letter-spacing: -3px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(38,80,216,0.30);
}
.contact-title {
  font-size: 18px; font-weight: 800; color: var(--navy);
  letter-spacing: -0.3px; line-height: 1.25;
}
.contact-sub {
  font-size: 13.5px; color: var(--navy-mid); line-height: 1.55; margin-top: 4px;
}
.contact-sub strong { color: var(--navy); font-weight: 800; }
.contact-card .company-table { background: #fff; }
.contact-card .field-error { margin-left: 0; }

/* ── CONSENTIMIENTO ──────────────────────────────────────── */
.consent-block { margin-top: 4px; }
.consent {
  display: flex; gap: 12px; align-items: flex-start; font-size: 13px;
  color: var(--body-txt); line-height: 1.6; cursor: pointer;
  background: rgba(16,29,64,0.03); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 14px 16px;
}
.consent input { margin-top: 2px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--blue-vivo); }
.consent a { color: var(--blue-vivo); font-weight: 600; }

/* honeypot */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }

/* ── BARRA DE ACCIONES ───────────────────────────────────── */
.action-bar {
  background:
    radial-gradient(600px 200px at 90% 0%, rgba(0,229,200,0.10) 0%, transparent 60%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius); margin: 6px 0 40px;
  padding: 22px 28px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.btn {
  padding: 12px 26px; border-radius: 999px; font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; font-family: inherit; transition: all .18s; letter-spacing: .01em;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-vivo) 0%, var(--cyan) 160%);
  color: #fff; box-shadow: 0 6px 20px rgba(38,80,216,0.40);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(38,80,216,0.50); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.30); }
.btn-outline:hover:not(:disabled) { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.55); }
.action-note { font-size: 12.5px; color: rgba(255,255,255,0.65); margin-left: auto; }

/* ── OUTPUT / VISTA PREVIA ───────────────────────────────── */
.output-section {
  background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 26px 30px; margin: 0 0 24px; display: none;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.output-section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--royal), var(--blue-vivo), var(--cyan));
}
.output-section h3 {
  color: var(--navy); font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 12px;
}
.output-section .reto-q {
  font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.6;
  border-left: 4px solid var(--cyan); padding-left: 18px;
}

/* ── BANNER DE ESTADO ────────────────────────────────────── */
.status-banner { display: none; border-radius: 12px; padding: 16px 20px; margin-bottom: 22px; font-size: 14px; line-height: 1.6; }
.status-banner.show { display: block; }
.status-banner.error { background: var(--err-lt); border: 1.5px solid var(--err); color: #8E2A20; }
.status-banner.success { background: var(--ok-lt); border: 1.5px solid var(--ok); color: #0A6E54; }
.status-banner strong { display: block; margin-bottom: 3px; font-weight: 800; }

/* spinner */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--navy); color: rgba(255,255,255,0.55);
  text-align: center; padding: 28px 20px; font-size: 12px; margin-top: 10px;
}
footer .f-logos {
  display: inline-flex; align-items: center; justify-content: center; gap: 22px;
  margin-bottom: 16px; background: var(--light-bg); padding: 12px 26px;
  border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
footer .f-logos img.etk-w  { height: 22px; }
footer .f-logos img.conn-w { height: 30px; }
footer .f-logos .fdiv { width: 1px; height: 26px; background: rgba(16,29,64,0.20); }
footer .f-line b { color: var(--cyan); font-weight: 700; }

/* ── BARRA DE PROGRESO (sticky) ──────────────────────────── */
.progress-wrap {
  position: sticky; top: 0; z-index: 200;
  background: rgba(243,247,255,0.92);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 2px 14px rgba(16,29,64,0.06);
}
.progress-inner { max-width: 860px; margin: 0 auto; padding: 11px 20px 12px; }
.progress-meta { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.progress-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy);
}
.progress-count { font-size: 12px; font-weight: 700; color: var(--blue-vivo); transition: color .25s; }
.progress-track {
  height: 7px; border-radius: 999px; background: rgba(16,29,64,0.10); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--royal), var(--blue-vivo), var(--cyan));
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress-wrap.complete .progress-count { color: #0A7E6E; }
.progress-wrap.complete .progress-fill { background: linear-gradient(90deg, var(--blue-vivo), var(--cyan)); }

/* ── SECCIÓN COMPLETADA ──────────────────────────────────── */
.section.done .section-badge { padding-right: 34px; position: relative; }
.section.done .section-badge::after {
  content: "✓"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 900; color: var(--cyan);
}

/* ── OVERLAY DE GENERACIÓN ───────────────────────────────── */
.gen-overlay {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(800px 420px at 80% -10%, rgba(38,80,216,0.55) 0%, transparent 60%),
    radial-gradient(600px 360px at 10% 120%, rgba(0,229,200,0.18) 0%, transparent 60%),
    linear-gradient(135deg, rgba(16,29,64,0.97), rgba(19,32,82,0.97));
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.gen-overlay.show { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.gen-card { text-align: center; max-width: 420px; width: 100%; color: #fff; }
.gen-ring {
  width: 92px; height: 92px; margin: 0 auto 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; position: relative;
  background: linear-gradient(135deg, var(--navy), var(--blue-vivo));
  box-shadow: 0 12px 40px rgba(38,80,216,0.45);
}
.gen-ring::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--cyan); border-right-color: var(--blue-acc);
  animation: spin 1s linear infinite;
}
.gen-chev { font-size: 34px; font-weight: 900; letter-spacing: -6px; color: var(--cyan); }
.gen-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 10px; }
.gen-step { font-size: 14px; color: rgba(255,255,255,0.82); min-height: 20px; transition: opacity .3s; font-weight: 500; }
.gen-bar { width: 220px; height: 5px; margin: 22px auto 0; border-radius: 999px; background: rgba(255,255,255,0.15); overflow: hidden; }
.gen-bar span {
  display: block; height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-acc), var(--cyan));
  animation: indeterminate 1.5s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { margin-left: -40%; } 100% { margin-left: 100%; }
}
.gen-foot { margin-top: 28px; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.gen-foot b { color: var(--cyan); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .container, .intro-head { padding-left: 16px; padding-right: 16px; }
  .progress-inner { padding-left: 16px; padding-right: 16px; }
  .intro-head { padding-top: 30px; }
  .section { padding: 22px 18px; }
  .q-hint, .field-error { margin-left: 0; }

  /* Header / lockup */
  .topbar { padding: 22px 16px 24px; }
  .lockup { padding: 13px 18px; flex-wrap: wrap; gap: 4px; }
  .lockup .divider { margin: 0 14px; }
  .lockup .etk-logo { height: 22px; } .lockup .conn-logo { height: 30px; }
  .alliance-line { font-size: 9.5px; letter-spacing: 0.16em; }

  /* Tablas: apilar etiqueta sobre campo */
  .actor-table, .kpi-table, .company-table { display: block; border: none; }
  .actor-table tr, .kpi-table tr, .company-table tr {
    display: block; border: 1px solid var(--line); border-radius: 12px;
    margin-bottom: 10px; overflow: hidden;
  }
  .actor-table tr:last-child, .kpi-table tr:last-child, .company-table tr:last-child { margin-bottom: 0; }
  .actor-table td, .kpi-table td, .company-table td { display: block; width: 100%; border: none; }
  .label-cell { width: 100% !important; padding-bottom: 4px; }
  .input-cell { padding-top: 0; }
  .input-cell input { padding: 4px 0; }

  /* Barra de acciones: botones a ancho completo apilados */
  .action-bar { padding: 18px 16px; flex-direction: column; align-items: stretch; gap: 10px; }
  .action-bar .btn { width: 100%; text-align: center; padding: 14px 18px; }
  .action-note { margin-left: 0; width: 100%; text-align: center; order: 3; }

  /* Contacto */
  .contact-card { padding: 18px 16px; }
  .contact-head { gap: 11px; }
  .contact-title { font-size: 16.5px; }

  footer .f-logos { gap: 16px; flex-wrap: wrap; }

  /* Overlay */
  .gen-title { font-size: 19px; }
  .gen-ring { width: 80px; height: 80px; }
}

/* Respeto a reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
