/* ============================================================
   Hey! Higher Education Years — Formato de inscripción
   Paleta tomada del formato oficial (PDF):
     morado         #5C2483
     morado oscuro  #341853
     gris de marca  #575756
   ============================================================ */

:root {
  --purple: #5C2483;
  --purple-dark: #341853;
  --purple-deep: #24103a;
  --purple-tint: #f4eefa;
  --purple-tint-2: #ece0f6;
  --gray: #575756;
  --ink: #2b2b2b;
  --ink-soft: #5a5a5a;
  --ink-mute: #808080;
  --line: #e3e0e8;
  --bg: #ffffff;
  --bg-alt: #faf8fc;
  --accent: #C2D940;
  --accent-ink: #2c3406;
  --danger: #c0392b;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(52, 24, 83, .06);
  --shadow: 0 18px 50px -22px rgba(52, 24, 83, .35);

  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-alt);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; display: block; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--purple); }
button { font: inherit; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.wrap-form { width: min(940px, 100% - 40px); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--purple); color: #fff; padding: 12px 20px; border-radius: 0 0 10px 0;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; border-radius: 6px; }

/* ---------- franja diagonal de marca ---------- */
.stripe-band {
  height: 24px;
  background-color: #fff;
  background-image: repeating-linear-gradient(
    -60deg,
    var(--purple-dark) 0 14px,
    transparent 14px 34px
  );
}
.stripe-band-flip {
  background-color: var(--purple-deep);
  background-image: repeating-linear-gradient(-60deg, var(--purple) 0 14px, transparent 14px 34px);
}

/* ---------- botones ---------- */
.btn {
  --btn-bg: var(--purple);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 2px solid transparent; border-radius: 999px;
  padding: 14px 30px;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  box-shadow: 0 10px 24px -12px rgba(52, 24, 83, .6);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(52, 24, 83, .7); }
.btn:active { transform: translateY(0); }
.btn-primary:hover { --btn-bg: var(--purple-dark); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); box-shadow: 0 10px 26px -12px rgba(140, 160, 20, .8); }
.btn-accent:hover { --btn-bg: #d0e650; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--purple); border-color: rgba(92, 36, 131, .35); box-shadow: none; }
.btn-ghost:hover { --btn-bg: var(--purple-tint); border-color: var(--purple); }
.btn-sm { padding: 10px 22px; font-size: .875rem; }

/* ============================================================
   ENCABEZADO — réplica del bloque superior del formato impreso
   ============================================================ */
.form-header { background: #fff; }
.form-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  padding: 34px 0 30px;
}
.form-header-logo { height: 84px; width: auto; flex-shrink: 0; }
.form-title {
  background: var(--purple-dark);
  padding: 18px 34px;
  border-radius: 6px;
}
.form-title h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1.02;
  text-align: right;
}

/* ============================================================
   CUERPO
   ============================================================ */
.form-main { flex: 1; padding: 44px 0 60px; }
.form-intro {
  max-width: 66ch; margin: 0 auto 28px; text-align: center;
  color: var(--ink-soft); font-size: 1rem;
}
.form-foot-note {
  text-align: center; margin: 26px 0 0; font-size: .92rem; color: var(--ink-mute);
}
.form-foot-note a { font-weight: 600; }

.form-shell {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}

/* progreso */
.progress { padding: 28px 34px 0; border-bottom: 1px solid var(--line); background: #fff; }
.progress-steps { list-style: none; display: flex; margin: 0 0 20px; padding: 0; gap: 8px; }
.progress-steps li {
  flex: 1; display: flex; align-items: center; gap: 10px;
  font-size: .84rem; font-weight: 600; color: var(--ink-mute);
  transition: color .25s ease;
}
.progress-steps .dot {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #eeecf1; color: var(--ink-mute);
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.progress-steps li.is-current { color: var(--purple-dark); }
.progress-steps li.is-current .dot { background: var(--purple); color: #fff; transform: scale(1.08); }
.progress-steps li.is-done { color: var(--gray); }
.progress-steps li.is-done .dot { background: var(--accent); color: var(--accent-ink); font-size: 0; }
.progress-steps li.is-done .dot::after { content: "✓"; font-size: .9rem; font-weight: 700; }
.progress-bar { height: 4px; background: #eeecf1; border-radius: 4px; overflow: hidden; }
.progress-bar span {
  display: block; height: 100%; width: 25%;
  background: linear-gradient(90deg, var(--purple), var(--accent));
  border-radius: 4px; transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

/* pasos */
.step { display: none; padding: 38px 34px 8px; animation: fade .35s ease; }
.step.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.fs { border: 0; margin: 0 0 34px; padding: 0; }
.fs legend {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
  color: var(--purple-dark); padding: 0 0 4px; margin-bottom: 4px;
  border-bottom: 3px solid var(--accent); display: inline-block;
}
.fs-help { font-size: .88rem; color: var(--ink-mute); margin: 10px 0 16px; }
.fs-legal { background: var(--purple-tint); border-radius: var(--radius); padding: 26px; }

.field { margin-bottom: 22px; }
.field label, .label-like {
  display: block; font-weight: 600; font-size: .9rem; color: var(--ink);
  margin-bottom: 8px;
}
.req { color: var(--purple); font-weight: 700; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea, select {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; font-size: .96rem; color: var(--ink); background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:hover, textarea:hover { border-color: #cfc9d8; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(92, 36, 131, .12);
}
input.is-invalid { border-color: var(--danger); background: #fdf5f4; }
.hint { font-size: .82rem; color: var(--ink-mute); margin: 6px 0 0; }
.err { font-size: .82rem; color: var(--danger); margin: 6px 0 0; font-weight: 500; }
.err:empty { display: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 24px; }

/* opciones tipo casilla del formato original */
.opt-grid { display: grid; gap: 12px; }
.opt-grid-2 { grid-template-columns: repeat(2, 1fr); }
.opt-grid-3 { grid-template-columns: repeat(3, 1fr); }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-box {
  display: flex; align-items: center; gap: 11px;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 14px 16px; background: #fff;
  font-size: .93rem; font-weight: 500; color: var(--ink);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
  height: 100%;
}
.opt:hover .opt-box { border-color: rgba(92,36,131,.45); transform: translateY(-2px); }
.opt input:checked + .opt-box {
  border-color: var(--purple); background: var(--purple-tint);
  box-shadow: inset 0 0 0 1px var(--purple);
  font-weight: 600; color: var(--purple-dark);
}
.opt input:focus-visible + .opt-box { outline: 3px solid var(--purple); outline-offset: 2px; }
.opt-lg .opt-box { flex-direction: column; align-items: flex-start; gap: 4px; padding: 22px; }
.opt-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.3; }
.opt-desc { font-size: .88rem; color: var(--ink-mute); }
.opt input:checked + .opt-box .opt-desc { color: var(--purple); }
.opt-inline .opt-box { justify-content: center; }

/* insignia de país */
.cc {
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  min-width: 32px; height: 24px; padding: 0 6px;
  border-radius: 5px;
  background: var(--purple-tint-2); color: var(--purple);
  font-family: var(--font-display); font-weight: 700; font-size: .68rem;
  letter-spacing: .06em;
  transition: background .18s ease, color .18s ease;
}
.opt input:checked + .opt-box .cc { background: var(--purple); color: #fff; }

/* casillas legales */
.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; font-size: .93rem; }
.check input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; accent-color: var(--purple); cursor: pointer; }
.cost-note {
  background: #fff; border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 20px; font-size: .93rem; color: var(--ink-soft);
}
.cost-note strong { display: block; color: var(--purple-dark); font-family: var(--font-display); font-size: 1rem; margin-bottom: 4px; }

/* resumen */
.resumen { display: grid; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.resumen-row { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 12px 18px; font-size: .92rem; }
.resumen-row:nth-child(odd) { background: var(--bg-alt); }
.resumen-key { color: var(--ink-mute); font-weight: 500; }
.resumen-val { font-weight: 600; color: var(--purple-dark); word-break: break-word; }
.resumen-val.is-empty { color: var(--danger); font-weight: 500; font-style: italic; }
.resumen-group {
  background: var(--purple-dark); color: #fff; padding: 10px 18px;
  font-family: var(--font-display); font-weight: 700; font-size: .76rem;
  text-transform: uppercase; letter-spacing: .12em;
}

/* firma */
.sign-wrap {
  border: 1.5px dashed rgba(92,36,131,.4); border-radius: var(--radius);
  background: repeating-linear-gradient(-60deg, rgba(92,36,131,.03) 0 10px, transparent 10px 24px), #fff;
  padding: 10px 10px 0;
}
#firma { width: 100%; height: 200px; display: block; touch-action: none; cursor: crosshair; border-radius: 8px; }
.sign-base { border-top: 1.5px solid var(--gray); margin: 0 24px; padding: 8px 0 14px; text-align: center; }
.sign-base span { font-family: var(--font-serif); font-size: .88rem; color: var(--ink-mute); }
.sign-actions { display: flex; justify-content: flex-end; margin: 12px 0 20px; }

/* navegación del formulario */
.form-nav {
  display: flex; align-items: center; gap: 14px;
  padding: 24px 34px 30px; border-top: 1px solid var(--line); margin-top: 14px;
  background: var(--bg-alt);
}
.form-nav-space { flex: 1; }
.form-status { padding: 0 34px 24px; margin: 0; font-size: .9rem; color: var(--ink-soft); background: var(--bg-alt); }
.form-status:empty { display: none; }
.form-status.is-error { color: var(--danger); font-weight: 600; }

/* éxito */
.success { padding: 60px 34px; text-align: center; }
.success-mark {
  width: 78px; height: 78px; border-radius: 50%; margin: 0 auto 24px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 700;
  animation: pop .45s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success h3 { font-size: 1.7rem; color: var(--purple-dark); }
.success p { color: var(--ink-soft); max-width: 52ch; margin-inline: auto; }
.success-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ============================================================
   PIE
   ============================================================ */
.form-footer { background: var(--purple-deep); color: rgba(255,255,255,.6); margin-top: auto; }
.form-footer .stripe-band { height: 20px; }
.form-footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 26px 0; font-size: .84rem; flex-wrap: wrap;
}
.form-footer-mark { height: 26px; width: auto; opacity: .85; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .form-header-inner { flex-direction: column; align-items: flex-start; gap: 22px; padding: 26px 0 24px; }
  .form-header-logo { height: 66px; }
  .form-title { width: 100%; }
  .form-title h1 { text-align: left; }
  .opt-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .progress-steps .lbl { display: none; }
  .progress-steps li { flex: 0 0 auto; }
  .progress-steps { justify-content: space-between; }
}

@media (max-width: 640px) {
  .wrap, .wrap-form { width: calc(100% - 32px); }
  .form-main { padding: 30px 0 44px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 0; }
  .opt-grid-2, .opt-grid-3 { grid-template-columns: 1fr; }
  .opt-inline .opt-grid { grid-template-columns: 1fr 1fr; }
  .step { padding: 28px 20px 4px; }
  .progress { padding: 22px 20px 0; }
  .form-nav { padding: 20px 20px 24px; flex-wrap: wrap; }
  .form-nav .btn { flex: 1; }
  .form-status { padding: 0 20px 20px; }
  .resumen-row { grid-template-columns: 1fr; gap: 2px; }
  .form-footer-inner { flex-direction: column; align-items: flex-start; }
  .btn { padding: 13px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .progress, .form-nav, .form-footer .stripe-band, .form-foot-note, .skip-link { display: none !important; }
  body { background: #fff; }
  .step { display: block !important; page-break-inside: avoid; }
  .form-shell { box-shadow: none; border: 0; }
}
