/* ===================================================
   VARIABLES Y TOKENS
=================================================== */
:root {
  --navy:       #1e3a8a;
  --navy-dark:  #152b6b;
  --navy-light: #dbeafe;
  --red:        #c73a4a;
  --red-dark:   #a02d3a;
  --red-light:  #fde8ea;
  --white:      #ffffff;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-400:   #94a3b8;
  --gray-600:   #475569;
  --gray-800:   #1e293b;
  --gray-900:   #0f172a;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 24px rgba(0,0,0,.12);
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --transition: all .28s cubic-bezier(.4,0,.2,1);
}

/* ===================================================
   RESET Y BASE
=================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===================================================
   NAVBAR
=================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.6);
  transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.nav-logo img { height: 46px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--gray-600);
  transition: var(--transition); white-space: nowrap;
}
.nav-link:hover  { background: var(--navy-light); color: var(--navy); }
.nav-link.active { background: var(--navy); color: var(--white); }
.nav-cta {
  margin-left: 8px; padding: 10px 22px;
  background: var(--red); color: var(--white) !important;
  border-radius: var(--radius-sm); font-weight: 700; font-size: .875rem;
  transition: var(--transition);
}
.nav-cta:hover { background: var(--red-dark) !important; transform: translateY(-1px); }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px; border-radius: var(--radius-sm);
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gray-800); border-radius: 2px; transition: var(--transition); }
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ===================================================
   CABECERA DE PÁGINA
=================================================== */
.page-header {
  background: linear-gradient(140deg, #0b1f54 0%, #1e3a8a 60%, #1d4ed8 100%);
  padding: 120px 28px 60px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 70px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 70'%3E%3Cpath fill='%23f8fafc' d='M0,70 L0,35 C240,70 480,0 720,35 C960,70 1200,0 1440,35 L1440,70 Z'/%3E%3C/svg%3E") center bottom/cover no-repeat;
}
.breadcrumb {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  font-size: .85rem; opacity: .75; margin-bottom: 16px;
}
.breadcrumb a { color: var(--white); }
.breadcrumb .sep { opacity: .5; }
.page-header h1 { font-size: 2.6rem; font-weight: 800; margin-bottom: 12px; }
.page-header p { font-size: 1.05rem; opacity: .85; max-width: 560px; margin: 0 auto; }

/* ===================================================
   BANDAS Y CONTENIDO
=================================================== */
.main-wrap { max-width: 960px; margin: 0 auto; padding: 0 28px; }

/* Aviso / banner de estado */
.reg-banner {
  background: var(--red);
  color: var(--white);
  padding: 20px 28px;
}
.reg-banner-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
}
.reg-banner i { font-size: 1.4rem; flex-shrink: 0; }
.reg-banner strong { font-size: 1rem; font-weight: 700; }

/* Logos institucionales */
.reg-logos {
  background: var(--gray-50);
  padding: 40px 28px;
  border-bottom: 1px solid var(--gray-200);
}
.reg-logos-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap;
}
.reg-logos-inner img { height: 80px; width: auto; object-fit: contain; }

/* Mensaje estado cerrado */
.reg-closed {
  padding: 64px 0 100px;
  background: var(--white);
}
.reg-closed-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

/* Badge "Próximamente" */
.reg-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--navy), #1d4ed8);
  color: #fff;
  border-radius: 30px;
  padding: 8px 22px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.reg-soon-dot {
  width: 9px; height: 9px;
  background: #fbbf24;
  border-radius: 50%;
  flex-shrink: 0;
  animation: soonPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(251,191,36,.7);
}
@keyframes soonPulse {
  0%   { box-shadow: 0 0 0 0 rgba(251,191,36,.7); }
  60%  { box-shadow: 0 0 0 7px rgba(251,191,36,0); }
  100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); }
}

/* Countdown */
.reg-countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 32px;
}
.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--navy-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 70px;
}
.countdown-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 5px;
}
.countdown-sep {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  opacity: .3;
  align-self: center;
  padding-bottom: 14px;
  animation: sepBlink 1s step-end infinite;
}
@keyframes sepBlink { 50% { opacity: 0; } }

.reg-closed-icon {
  width: 80px; height: 80px;
  background: var(--navy-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  font-size: 2rem;
  color: var(--navy);
}
.reg-closed-card h2 {
  font-size: 1.6rem; font-weight: 800; color: var(--gray-800); margin-bottom: 28px;
}
.reg-closed-card p {
  font-size: 1rem; color: var(--gray-600); line-height: 1.8; margin-bottom: 16px; max-width: 680px; margin-left: auto; margin-right: auto;
}
.reg-closed-card p a { color: var(--navy); text-decoration: underline; }
.reg-closed-card p a:hover { color: var(--navy-dark); }
.reg-closed-card .highlight {
  font-size: 1rem; font-weight: 600; color: var(--navy);
  background: var(--navy-light); border-radius: var(--radius-sm);
  padding: 14px 20px; margin: 24px auto; max-width: 600px;
  border-left: 4px solid var(--navy);
  text-align: left;
}
.reg-closed-actions {
  display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 32px;
}
.btn-primary-reg {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  background: var(--navy); color: var(--white);
  border-radius: var(--radius-sm); font-weight: 700; font-size: .95rem;
  transition: var(--transition);
}
.btn-primary-reg:hover { background: var(--navy-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline-reg {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  background: transparent; color: var(--gray-600);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; transition: var(--transition);
}
.btn-outline-reg:hover { border-color: var(--navy); color: var(--navy); }

/* ===================================================
   FORMULARIO DE REGISTRO (estado ABIERTO)
=================================================== */
.reg-form-section {
  display: none; /* Se muestra vía JS cuando REGISTRO_ABIERTO = true */
  padding: 64px 0 100px;
  background: var(--gray-50);
}
.reg-form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  box-shadow: var(--shadow-md);
}
.reg-form-card h2 {
  font-size: 1.4rem; font-weight: 800; color: var(--gray-800);
  padding-bottom: 20px; border-bottom: 2px solid var(--gray-200); margin-bottom: 32px;
}

/* Estado éxito del registro */
.reg-success {
  display: none;
  text-align: center;
  padding: 48px 28px;
}
.reg-success-icon {
  width: 80px; height: 80px;
  background: #dcfce7; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; font-size: 2.2rem; color: #16a34a;
}
.reg-success h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 12px; }
.reg-success p  { color: var(--gray-600); font-size: 1rem; margin-bottom: 8px; }

/* Validación de correo */
.email-validate-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-bottom: 24px;
}
.validate-status { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; margin-top: 8px; }
.validate-status.ok    { color: #16a34a; }
.validate-status.error { color: var(--red); }

/* Campos del formulario */
.form-section-title {
  font-size: 1rem; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 32px 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--navy-light);
}
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: .83rem; font-weight: 600; color: var(--gray-800); letter-spacing: .02em;
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%; padding: 12px 14px;
  font-family: inherit; font-size: .95rem; color: var(--gray-800);
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); outline: none; transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  background: var(--white); border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,138,.1);
}
.form-textarea { resize: vertical; min-height: 100px; }

/* Radio / checkbox group */
.radio-group, .check-group {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px;
}
.radio-group label, .check-group label {
  display: flex; align-items: center; gap: 8px;
  font-size: .92rem; cursor: pointer;
}

/* Years checkboxes */
.years-wrap { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 8px; }
.years-wrap label { display: flex; align-items: center; gap: 6px; font-size: .92rem; cursor: pointer; }

/* Botones acción */
.reg-actions { display: flex; justify-content: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.btn-validate {
  padding: 12px 22px;
  background: #f59e0b; color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-validate:hover { background: #d97706; }
.btn-validate:disabled { opacity: .5; cursor: not-allowed; }

.btn-submit {
  width: 100%; padding: 14px 24px;
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-submit:hover { background: var(--navy-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* Toast / Alerts */
.reg-alert {
  display: none;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: .93rem; font-weight: 500; margin-bottom: 20px;
  align-items: center; gap: 12px;
}
.reg-alert.show   { display: flex; }
.reg-alert.info   { background: var(--navy-light); border: 1px solid rgba(30,58,138,.2); color: var(--navy-dark); }
.reg-alert.warn   { background: #fef9c3; border: 1px solid #fde047; color: #854d0e; }
.reg-alert.error  { background: var(--red-light); border: 1px solid rgba(199,58,74,.3); color: var(--red-dark); }
.reg-alert.success{ background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

.recaptcha-wrap { margin: 8px 0 24px; }
.required-note  { font-size: .8rem; color: var(--gray-400); margin-bottom: 20px; }

/* ===================================================
   PIE DE PÁGINA
=================================================== */
footer { background: var(--gray-900); color: rgba(255,255,255,.75); padding: 72px 0 32px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.footer-top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-col { display: flex; flex-direction: column; }
.footer-col .footer-btn { margin-top: auto; }
.footer-col h4 { color: var(--white); font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.footer-col p  { font-size: .88rem; line-height: 1.7; margin-bottom: 16px; }
.footer-logo {
  display: inline-block;
  background: rgba(255,255,255,0.95);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.footer-logo img { height: 44px; width: auto; display: block; }
.footer-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px;
  background: var(--navy); border-radius: var(--radius-sm); color: var(--white);
  font-size: .875rem; font-weight: 600; transition: var(--transition);
}
.footer-btn:hover { background: #1e40af; }
.footer-btn.red-btn { background: var(--red); border-color: var(--red); }
.footer-btn.red-btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.social-row { display: flex; gap: 10px; margin-top: 8px; margin-bottom: 20px; }
.social-btn {
  width: 38px; height: 38px; background: rgba(255,255,255,.1);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: var(--white); transition: var(--transition);
}
.social-btn:hover { background: var(--navy); }
.footer-bottom { padding-top: 28px; text-align: center; font-size: .82rem; opacity: .5; }

/* ===================================================
   RESPONSIVE
=================================================== */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - 72px); background: rgba(255,255,255,.98);
    flex-direction: column; align-items: stretch; padding: 24px 20px; gap: 8px; overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-link       { font-size: 1.25rem; width: 100%; padding: 18px 22px; border-radius: var(--radius-sm); }
  .nav-cta        { width: 100%; margin-left: 0; text-align: center; display: block; padding: 18px 22px; margin-top: 8px; font-size: 1.25rem; }

  .page-header h1      { font-size: 2rem; }
  .reg-logos-inner img { height: 56px; }
  .reg-closed-card     { padding: 36px 24px; }
  .reg-form-card       { padding: 32px 20px; }
  .form-row, .form-row3{ grid-template-columns: 1fr; }
  .email-validate-row  { grid-template-columns: 1fr; }
  .footer-top          { grid-template-columns: 1fr; gap: 36px; }
  .reg-closed-actions  { flex-direction: column; align-items: center; }
}
