/* =========================================================
   Registro de interés | Educación Continua ESPM/INSP
   Todo vive bajo .ec-registro para no chocar con los estilos
   del sitio (WordPress/Elementor, Bootstrap, etc.).
   ========================================================= */

.ec-registro {
  /* Paleta tomada del sitio de Educación Continua */
  --ec-navy: #0b2341;
  --ec-navy-2: #12325c;
  --ec-blue: #1e6fe8;
  --ec-indigo: #3b2fd9;
  --ec-cyan: #12b8e6;
  --ec-violet: #6d2fd6;
  --ec-bg: #f4f7fb;
  --ec-surface: #ffffff;
  --ec-field: #f7f9fc;
  --ec-ink: #10223a;
  --ec-muted: #52637a;
  --ec-line: #dce4ee;
  --ec-line-hover: #c3d0e1;
  --ec-danger: #d33545;
  --ec-radius: 12px;
  --ec-font: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ec-serif: "Fraunces", Georgia, "Times New Roman", serif;

  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 140px 24px;
  overflow: hidden;
  background: var(--ec-bg);
  color: var(--ec-ink);
 
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ec-registro *,
.ec-registro *::before,
.ec-registro *::after {
  box-sizing: border-box;
}

.ec-registro [hidden] {
  display: none !important;
}

/* Neutraliza estilos globales de Bootstrap/sitio dentro del registro */
.ec-registro fieldset legend {
  float: none;
  width: auto;
  line-height: 1.4;
}

.ec-registro h1,
.ec-registro h2 {
  font-family: inherit;
}

/* ---------- Fondo ---------- */
.ec-bg {
  position: absolute;
  inset: -60px;
  pointer-events: none;
  transition: transform 0.25s linear;
}

.ec-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
  will-change: transform;
}

.ec-blob--1 {
  width: 480px;
  height: 480px;
  left: -140px;
  top: -160px;
  background: radial-gradient(circle, rgba(18, 184, 230, 0.22), transparent 70%);
  animation: ecFloat1 18s ease-in-out infinite;
}

.ec-blob--2 {
  width: 560px;
  height: 560px;
  right: -180px;
  bottom: -200px;
  background: radial-gradient(circle, rgba(59, 47, 217, 0.18), transparent 70%);
  animation: ecFloat2 20s ease-in-out infinite;
}

.ec-blob--3 {
  width: 320px;
  height: 320px;
  right: 22%;
  top: -100px;
  background: radial-gradient(circle, rgba(109, 47, 214, 0.12), transparent 70%);
  animation: ecFloat1 16s ease-in-out infinite reverse;
}

.ec-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(11, 35, 65, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 35, 65, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
}

/* ---------- Contenedor ---------- */
.ec-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  background: var(--ec-surface);
  border: 1px solid #e3eaf3;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 30px 80px -24px rgba(11, 35, 65, 0.24),
    0 2px 6px rgba(11, 35, 65, 0.05);
  animation: ecEnter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---------- Panel informativo ---------- */
.ec-intro {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 48px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 6%, rgba(18, 184, 230, 0.5), transparent 42%),
    radial-gradient(circle at 4% 96%, rgba(109, 47, 214, 0.5), transparent 48%),
    linear-gradient(165deg, #0b2341 0%, #172a86 58%, #3b2fd9 100%);
}

.ec-loop {
  position: absolute;
  z-index: -1;
  width: 125%;
  right: -48%;
  bottom: -6%;
  opacity: 0.5;
}

.ec-loop path {
  fill: none;
  stroke: url(#ecLoopGrad);
  stroke-width: 30;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ecDraw 2.4s 0.4s cubic-bezier(0.6, 0.1, 0.2, 1) forwards;
}

.ec-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 40px;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.ec-brand__inst {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.ec-intro h1 {
  margin: 0;
  color: #fff;
  max-width: 15ch;
  /* font-family: var(--ec-serif); */
  font-weight: 600;
  font-size: clamp(2.1rem, 3.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.ec-lead {
  max-width: 40ch;
  margin: 20px 0 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.76);
}

.ec-program {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.ec-program i {
  font-size: 1.1rem;
  color: #7fdcf7;
}

.ec-stats {
  display: flex;
  gap: 40px;
}

.ec-stat strong {
  display: block;
  /* font-family: var(--ec-serif); */
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.ec-stat strong span {
  color: #5fd4f5;
}

.ec-stat small {
  display: block;
  margin-top: 8px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- Panel del formulario ---------- */
.ec-form-panel {
  padding: 52px 52px 48px;
}

.ec-form-panel h2 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ec-navy);
}

.ec-subtitle {
  margin: 0 0 28px;
  color: var(--ec-muted);
}

.ec-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ---------- Campos con etiqueta flotante ---------- */
.ec-field {
  position: relative;
}

.ec-field input,
.ec-field select {
  display: block;
  width: 100%;
  height: 58px;
  margin: 0;
  padding: 24px 16px 8px;
  font: inherit;
  font-size: 1rem;
  color: var(--ec-ink);
  background-color: var(--ec-field);
  border: 1px solid var(--ec-line);
  border-radius: var(--ec-radius);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.ec-field input::placeholder {
  color: transparent;
}

.ec-field select {
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2352637a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

.ec-field input:hover,
.ec-field select:hover {
  border-color: var(--ec-line-hover);
}

.ec-field input:focus,
.ec-field select:focus {
  background-color: #fff;
  border-color: var(--ec-blue);
  box-shadow: 0 0 0 4px rgba(30, 111, 232, 0.14);
}

.ec-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--ec-field) inset;
  -webkit-text-fill-color: var(--ec-ink);
}

.ec-field label {
  position: absolute;
  left: 17px;
  top: 18px;
  max-width: calc(100% - 50px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1rem;
  color: var(--ec-muted);
  pointer-events: none;
  transition: top 0.18s, font-size 0.18s, color 0.18s;
}

.ec-field input:focus ~ label,
.ec-field input:not(:placeholder-shown) ~ label,
.ec-field--select label {
  top: 8px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ec-blue);
}

.ec-field--select label {
  color: var(--ec-muted);
}

.ec-field--select select:focus ~ label {
  color: var(--ec-blue);
}

.ec-hint,
.ec-error {
  display: block;
  margin: 6px 2px 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.ec-hint {
  color: var(--ec-muted);
}

.ec-error {
  color: var(--ec-danger);
  font-weight: 500;
}

.ec-error:empty {
  display: none;
}

.ec-field.is-invalid .ec-hint {
  display: none;
}

/* Estado de error (después de las reglas de foco para ganarles) */
.ec-field.is-invalid input,
.ec-field.is-invalid select {
  border-color: var(--ec-danger);
  background-color: #fff8f8;
}

.ec-field.is-invalid input:focus,
.ec-field.is-invalid select:focus {
  box-shadow: 0 0 0 4px rgba(211, 53, 69, 0.14);
}

.ec-field.is-invalid input ~ label,
.ec-field.is-invalid select ~ label {
  color: var(--ec-danger);
}

/* ---------- Grupos de opciones ---------- */
.ec-fieldset {
  min-width: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.ec-fieldset legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ec-navy);
}

.ec-option input,
.ec-seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ec-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.ec-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.ec-option__box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--ec-line);
  border-radius: 14px;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.ec-option__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ec-navy);
  color: #fff;
  font-size: 1.1rem;
  transition: background 0.2s;
}

.ec-option__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.ec-option__text strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ec-ink);
}

.ec-option__text small {
  font-size: 0.78rem;
  color: var(--ec-muted);
}

.ec-option:hover .ec-option__box {
  border-color: var(--ec-line-hover);
}

.ec-option input:checked + .ec-option__box {
  background: #f1f6ff;
  border-color: var(--ec-blue);
  box-shadow: inset 0 0 0 1px var(--ec-blue);
}

.ec-option input:checked + .ec-option__box .ec-option__icon {
  background: linear-gradient(135deg, var(--ec-indigo), var(--ec-cyan));
}

.ec-option input:focus-visible + .ec-option__box {
  outline: 3px solid rgba(30, 111, 232, 0.45);
  outline-offset: 2px;
}

.ec-fieldset.is-invalid .ec-option__box {
  border-color: var(--ec-danger);
}

/* Sí / No */
.ec-seg {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 240px;
  padding: 4px;
  background: #eef3f9;
  border-radius: 12px;
}

.ec-seg label {
  position: relative;
  cursor: pointer;
}

.ec-seg span {
  display: block;
  padding: 10px 24px;
  text-align: center;
  border-radius: 9px;
  font-weight: 600;
  color: var(--ec-muted);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.ec-seg label:hover span {
  color: var(--ec-navy);
}

.ec-seg input:checked + span {
  background: #fff;
  color: var(--ec-navy);
  box-shadow: 0 1px 3px rgba(11, 35, 65, 0.12), 0 0 0 1px rgba(30, 111, 232, 0.4);
}

.ec-seg input:focus-visible + span {
  outline: 3px solid rgba(30, 111, 232, 0.45);
  outline-offset: 1px;
}

.ec-fieldset.is-invalid .ec-seg {
  box-shadow: inset 0 0 0 1px var(--ec-danger);
}

/* Aviso de privacidad */
.ec-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--ec-muted);
  cursor: pointer;
}

.ec-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ec-navy);
  cursor: pointer;
}

.ec-check a {
  color: var(--ec-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ec-consent.is-invalid .ec-check {
  color: var(--ec-danger);
}

/* Honeypot */
.ec-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Botón ---------- */
.ec-submit {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  margin-top: 6px;
  border: 0;
  border-radius: var(--ec-radius);
  background: var(--ec-navy);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px -10px rgba(11, 35, 65, 0.55);
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.ec-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.18) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.ec-submit:hover {
  background: var(--ec-navy-2);
  transform: translateY(-1px);
}

.ec-submit:hover::after {
  transform: translateX(120%);
}

.ec-submit:focus-visible {
  outline: 3px solid rgba(30, 111, 232, 0.5);
  outline-offset: 3px;
}

.ec-submit:disabled {
  cursor: progress;
  transform: none;
  opacity: 0.9;
}

.ec-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ecSpin 0.8s linear infinite;
}

/* ---------- Alertas y confirmación ---------- */
.ec-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -8px 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1f2;
  border: 1px solid #f6c7cc;
  color: #8f1d2a;
  font-size: 0.9rem;
}

.ec-alert i {
  margin-top: 1px;
}

.ec-success {
  padding: 24px 0;
  outline: none;
  animation: ecEnter 0.5s ease both;
}

.ec-success__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ec-indigo), var(--ec-cyan));
  color: #fff;
  font-size: 1.6rem;
}

.ec-success p {
  max-width: 42ch;
  margin: 0;
  color: var(--ec-muted);
  line-height: 1.65;
}

.ec-success strong {
  color: var(--ec-ink);
  word-break: break-all;
}

.ec-btn-secondary {
  height: 48px;
  margin-top: 24px;
  padding: 0 20px;
  border: 1px solid var(--ec-line);
  border-radius: var(--ec-radius);
  background: #fff;
  color: var(--ec-navy);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ec-btn-secondary:hover {
  border-color: var(--ec-line-hover);
}

.ec-btn-secondary:focus-visible {
  outline: 3px solid rgba(30, 111, 232, 0.45);
  outline-offset: 2px;
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .ec-shell {
    grid-template-columns: 1fr;
    max-width: 760px;
  }

  .ec-intro {
    padding: 40px 36px;
    gap: 32px;
  }

  .ec-brand {
    margin-bottom: 28px;
  }

  .ec-loop {
    width: 80%;
    right: -22%;
    bottom: -18%;
  }

  .ec-form-panel {
    padding: 40px 36px;
  }
}

/* ---------- Celular ---------- */
@media (max-width: 640px) {
  .ec-registro {
    padding: 12px;
    place-items: start center;
  }

  .ec-shell {
    border-radius: 22px;
  }

  .ec-intro,
  .ec-form-panel {
    padding: 28px 20px;
  }

  .ec-brand {
    flex-wrap: wrap;
    margin-bottom: 22px;
  }

  .ec-intro h1 {
    font-size: 1.9rem;
  }

  .ec-lead {
    font-size: 0.95rem;
  }

  .ec-loop {
    width: 120%;
    right: -45%;
    bottom: -12%;
  }

  .ec-stats {
    gap: 28px;
  }

  .ec-stat strong {
    font-size: 2rem;
  }

  .ec-form-panel h2 {
    font-size: 1.6rem;
  }

  .ec-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .ec-options {
    grid-template-columns: 1fr;
  }

  .ec-option__box {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .ec-seg {
    display: grid;
    width: 100%;
  }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .ec-registro *,
  .ec-registro *::before,
  .ec-registro *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Animaciones ---------- */
@keyframes ecEnter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ecDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes ecFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, 24px) scale(1.06); }
}

@keyframes ecFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-32px, -26px) scale(1.05); }
}

@keyframes ecSpin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   Integración con el sitio (agregado al pasar la maqueta a Laravel)
   ========================================================= */

.ec-success h2 {
  margin: 0 0 12px;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ec-navy);
}

/* Aviso informativo (programa no disponible, liga ya usada, etc.) */
.ec-alert--info {
  margin: 0 0 20px;
  background: #eef5ff;
  border-color: #c9dcfb;
  color: var(--ec-navy);
}

/* reCAPTCHA */
.ec-captcha {
  min-height: 78px;
}

.ec-captcha.is-invalid .g-recaptcha > div {
  outline: 2px solid var(--ec-danger);
  outline-offset: 2px;
  border-radius: 4px;
}

/* El widget mide 304px fijos: se escala en celulares angostos */
@media (max-width: 400px) {
  .ec-captcha .g-recaptcha {
    transform: scale(0.86);
    transform-origin: 0 0;
  }
}

/* Página de aviso: una sola columna */
.ec-shell--solo {
  grid-template-columns: 1fr;
  max-width: 640px;
}

.ec-shell--solo .ec-form-panel {
  text-align: center;
}

.ec-shell--solo .ec-success__icon {
  margin: 0 auto 20px;
}

.ec-shell--solo .ec-success p {
  margin: 0 auto;
}

.ec-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin-top: 24px;
  padding: 0 24px;
  border-radius: var(--ec-radius);
  background: var(--ec-navy);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.ec-link-btn:hover {
  background: var(--ec-navy-2);
  color: #fff;
}

/* Salidas al inicio (la página no tiene header) */
a.ec-brand {
  width: fit-content;
  text-decoration: none;
}

a.ec-brand:hover {
  color: #fff;
}

a.ec-brand:hover .ec-brand__inst {
  background: rgba(255, 255, 255, 0.2);
}

a.ec-brand:focus-visible {
  outline: 3px solid rgba(127, 220, 247, 0.7);
  outline-offset: 4px;
  border-radius: 999px;
}

.ec-salida {
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ec-muted);
}

.ec-salida a {
  color: var(--ec-blue);
  font-weight: 600;
}

.ec-success__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.ec-success__acciones .ec-link-btn,
.ec-success__acciones .ec-btn-secondary {
  margin-top: 0;
}
