/* Popup de registro (adn-core/inc/registro.php).
   Usa los tokens del theme (tokens.css) con respaldo propio, por si cambia el theme. */

.adn-registro {
  --r-morado: var(--color-primary, #732f86);
  --r-morado-hondo: var(--color-primary-strong, #5c2570);
  --r-amarillo: var(--color-accent, #eae74a);
  --r-texto: var(--color-text, #323232);
  --r-fondo: var(--color-bg, #fff);
  --r-borde: #bbbabe;          /* el de los campos del formulario de Contacto */
  --r-error: #b3261e;
  --r-ease: var(--ease, cubic-bezier(.22, 1, .36, 1));

  width: min(100% - 2rem, 40rem);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--r-fondo);
  color: var(--r-texto);
  font-family: var(--font-body, 'Albert Sans', system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: 0 1.5rem 4rem rgb(40 14 50 / .35);
}
.adn-registro::backdrop {
  background: rgb(40 14 50 / .62);
  backdrop-filter: blur(2px);
}
.adn-registro[open] { animation: adn-registro-entra .45s var(--r-ease); }
.adn-registro[open]::backdrop { animation: adn-registro-fondo .45s ease; }
@keyframes adn-registro-entra { from { opacity: 0; transform: translateY(1.5rem) scale(.98); } }
@keyframes adn-registro-fondo { from { opacity: 0; } }

/* Con el popup abierto la página de detrás no se desplaza. */
html:has(.adn-registro[open]) { overflow: hidden; }

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

.adn-registro__panel { position: relative; }

/* ---------- cabecera morada con el filo diagonal de la marca ---------- */

.adn-registro__cabecera {
  position: relative;
  padding: 2.5rem 4.5rem 3.25rem 2.5rem;
  background: var(--r-morado);
  color: #fff;
}
/* Filo en diagonal: morado arriba, línea amarilla y blanco debajo. */
.adn-registro__cabecera::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1.5rem;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 4.5px),
    var(--r-amarillo) calc(50% - 3.5px),
    var(--r-amarillo) calc(50% - .5px),
    var(--r-fondo) 50%
  );
}

.adn-registro__eyebrow {
  color: var(--r-amarillo);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow, .225em);
  text-transform: uppercase;
  line-height: 1.3;
}

.adn-registro__titulo {
  margin-top: .6rem;
  color: #fff;               /* el theme pinta los h2 de morado */
  font-family: var(--font-display, inherit);
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: var(--tracking-tight, -.02em);
  outline: none;             /* recibe el foco al abrirse (autofocus), sin anillo */
}

.adn-registro__texto {
  max-width: 32em;
  margin-top: .75rem;
  color: rgb(255 255 255 / .88);
  line-height: 1.5;
}

.adn-registro__cerrar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .12);
  color: #fff;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.adn-registro__cerrar:hover { background: var(--r-amarillo); color: var(--r-morado); }
.adn-registro__cerrar:focus-visible { outline: 2px solid var(--r-amarillo); outline-offset: 2px; }

/* ---------- formulario ---------- */

.adn-registro__form { padding: 1.5rem 2.5rem 2.25rem; }

.adn-registro__rejilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.adn-registro__campo--email { grid-column: 1 / -1; }

.adn-registro__campo label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
}

.adn-registro__req { color: #e0584b; }

.adn-registro__campo input {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .7rem .8rem;
  border: 1px solid var(--r-borde);
  border-radius: 0;
  background: #fff;
  color: var(--r-texto);
  font: inherit;
  font-size: 1rem;           /* 16px: iOS no hace zoom al enfocar */
  line-height: 1.3;
}
.adn-registro__campo input:focus-visible {
  outline: 2px solid var(--r-morado);
  outline-offset: 1px;
}
.adn-registro__campo input[aria-invalid="true"] { border-color: var(--r-error); }

.adn-registro__error {
  margin-top: .3rem;
  color: var(--r-error);
  font-size: .82rem;
  line-height: 1.35;
}
.adn-registro__error:empty { display: none; }

.adn-registro__acepto {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-top: 1.5rem;
  font-size: .875rem;
  line-height: 1.45;
}
.adn-registro__acepto input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .1em;
  accent-color: var(--r-morado);
}
.adn-registro__acepto a { color: var(--r-morado); text-decoration: underline; }

.adn-registro__aviso {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-left: 4px solid var(--r-error);
  background: #fbeceb;
  color: var(--r-error);
  font-size: .9rem;
  line-height: 1.4;
}
.adn-registro__aviso:empty { display: none; }

/* Botón: el theme le da .btn .btn--primary; esto es el respaldo y el ancho. */
.adn-registro .adn-registro__enviar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  margin-top: 1.5rem;
  padding: .5rem 1.5rem;
  border: 0;
  background: var(--r-morado);
  color: var(--r-amarillo);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .25s ease;
}
.adn-registro .adn-registro__enviar:hover { background: var(--r-morado-hondo); }
.adn-registro .adn-registro__enviar:focus-visible { outline: 2px solid var(--r-morado-hondo); outline-offset: 2px; }
.adn-registro .adn-registro__enviar[aria-busy="true"] { opacity: .7; cursor: progress; }

.adn-registro__nota {
  margin-top: .75rem;
  color: #6b6b6b;
  font-size: .8rem;
  text-align: center;
}

/* Trampa antirrobots: fuera de la vista pero sin display:none, que algunos bots detectan. */
.adn-registro__trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- gracias ---------- */

.adn-registro__gracias {
  padding: 1.5rem 2.5rem 2.5rem;
  text-align: center;
  outline: none;
}
.adn-registro__gracias-titulo {
  margin-bottom: .5rem;
  color: var(--r-morado);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

/* ---------- móvil ---------- */

@media (max-width: 36rem) {
  .adn-registro__cabecera { padding: 2rem 4rem 2.75rem 1.5rem; }
  .adn-registro__form { padding: 1.25rem 1.5rem 1.75rem; }
  .adn-registro__gracias { padding: 1.25rem 1.5rem 2rem; }
  .adn-registro__rejilla { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .adn-registro[open],
  .adn-registro[open]::backdrop { animation: none; }
}
