/* ============================================================
   createAccount.css — Registro (createAccount.jsp)
   Mismo tratamiento visual que la landing Home (referencia:
   ejemplo/Registro.html + ejemplo/css/registro.css de este repo).
   Mobile-first. Breakpoints: >=768px (tablet), >=1024px (desktop)
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --midnight: #050d4d;
  --grey-500: #696e94;
  --grey-100: #f4f4f9;
  --yellow: #ffdb3d;
  --white: #ffffff;

  --shadow-cta: 0 6px 10px rgba(0, 0, 0, 0.1);
  --shadow-cta-hover: 0 12px 22px rgba(5, 13, 77, 0.22);

  /* Borde de marca del botón (gradient-stroke de Figma) */
  --gradient-stroke: linear-gradient(
    100deg,
    #ffdb3d 0%, #ff8a3d 12%, #ff69a1 30%,
    #a15bff 50%, #3f5bff 72%, #3fa0ff 100%
  );
  /* Mismo gradiente en diagonal para el marco glass del panel izquierdo */
  --gradient-stroke-card: linear-gradient(
    145deg,
    #ffdb3d 0%, #ff8a3d 14%, #ff69a1 34%,
    #a15bff 56%, #3f5bff 78%, #3fa0ff 100%
  );

  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24' viewBox='0 0 24 24' fill='none' stroke='%23696e94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* El <body> no tenía margin:0 (el navegador le pone 8px por default) y
   #footer es HERMANO de #loginPopup, no descendiente — así que ni el reset de
   box-sizing de abajo ni ningún otro estilo scopeado a #loginPopup lo cubre.
   Esto causaba overflow horizontal real en mobile: width:100% + padding se
   suman bajo content-box, el footer termina más ancho que el viewport y
   arranca corrido esos 8px del margin del body. */
body { margin: 0; }

/* Sin esto, "height" y "padding" se suman (modelo content-box, el default del
   navegador): .field__input queda en 54px + 32px de padding vertical = 86px
   real, mientras que .prefix (sin padding vertical) se queda en los 54px
   declarados -> las cajas de la fila de teléfono no miden lo mismo.
   Cubre #loginPopup Y #footer (hermanos, ambos top-level de este jsp). */
#loginPopup,
#loginPopup *,
#loginPopup *::before,
#loginPopup *::after,
#footer,
#footer *,
#footer *::before,
#footer *::after {
  box-sizing: border-box;
}

/* ---------- layout ---------- */
.registro-shell {
  background: var(--white);
}

.registro {
  display: flex;
  flex-direction: column;
  font-family: 'Satoshi', system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--midnight);
  background: var(--white);
}
/* Mobile: formulario arriba, hero abajo */
.registro__form { order: 1; }
.registro__hero { order: 2; }

/* faf.css/estilos.css traen reglas viejas que targetean directo elementos de
   texto (h1, h2, p, etc.), no solo el body: "estilos.css { h2 {font-family:
   'Open Sans'} }". Una declaración puesta directo sobre el elemento SIEMPRE le
   gana a lo heredado del ancestro (acá, .registro), tenga o no !important el
   ancestro — !important solo pesa cuando compite con otra regla que también
   matchea el mismo elemento. Por eso no alcanza con heredar: hay que
   re-declarar la fuente en todo lo de adentro, con !important para ganarle a
   esas reglas legacy (que no son !important). */
#loginPopup,
#loginPopup * {
  font-family: 'Satoshi', system-ui, -apple-system, "Segoe UI", sans-serif !important;
}

/* ============================================================
   HERO
   ============================================================ */
.registro__hero {
  position: relative;
  padding: 24px 16px;
  background: url(img/hero-section.png) center / cover no-repeat;
  overflow: hidden;
}

.hero__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 16vw, 128px);
  padding: 32px 24px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px 56px 24px 56px; /* tl tr br bl */
}
/* Borde con gradiente de marca sobre fondo glass */
.hero__card::before {
  /* Sin el !important, un reset legacy tipo "*::before, *::after { content: none }"
     (típico para anular iconos/clearfixes viejos) deja el pseudo-elemento sin
     caja: sin content no se genera nada, ni el background ni la máscara, y el
     borde desaparece por completo (no queda "del color equivocado", queda
     directamente ausente — que es lo que se veía en el monolito). */
  content: "" !important;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: var(--gradient-stroke-card);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* Oculto en mobile/tablet: en esos anchos el logo va arriba de "¡Empezá
   gratis hoy!" (.form__logo, en la columna del form). Solo vuelve en desktop
   (ver media query 1024px), donde la card del hero tiene más aire vertical. */
.hero__logo {
  display: none;
  width: 118px;
  height: auto;
  margin-left: 0; /* pegado al borde izquierdo de la card */
}

.hero__title {
  margin: 0;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -0.32px;
  text-align: left !important; /* mismo bug que .value-prop__title: es un <h2>, legacy lo centra directo */
}

.value-props {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.value-prop { padding-left: 16px; }
/* .value-prop__title es un <h3> y .value-prop__text un <p>: mismo problema que
   el font-family de antes. faf.css/estilos.css centran h3/p directo sobre el
   elemento (probable "h3, p { text-align: center }" legacy), y eso le gana a
   cualquier alineación heredada del ancestro. Se fuerza acá con !important. */
.value-prop__title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 18px;
  line-height: 22px;
  text-align: left !important;
}
.value-prop__text {
  margin: 0;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  text-align: left !important;
}

@media (max-width: 767.98px) {
  .hero__title { font-size: 34px; letter-spacing: -0.34px; }
  .value-prop__title { font-size: 20px; line-height: 24px; }
  .value-prop__text { font-size: 16px; }
}

/* ============================================================
   FORM
   ============================================================ */
.registro__form {
  display: flex;
  flex-direction: column;
  padding: 80px 24px;
  background: var(--white);
}

.form__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 342px;
  margin: 0 auto;
}

/* Logo mobile/tablet, arriba de "¡Empezá gratis hoy!". Reemplaza al logo
   blanco del hero (oculto en esos anchos, ver .hero__logo). Se oculta en
   desktop, donde el logo vuelve a la card del hero. */
.form__logo {
  display: block;
  width: 100px;
  height: auto;
}

.form__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  width: 100%;
}
/* .form__title es <h1> y .form__subtitle <p>: mismo bug de legacy centrando
   directo el elemento. Se fuerza acá para que siga el mismo alineado que
   .form__heading (center en mobile, left desde 1024px). */
.form__title {
  margin: 0;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -0.32px;
  text-align: center !important;
}
.form__subtitle {
  margin: 0;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  color: var(--midnight);
  text-align: center !important;
}

.form__error-wrap { width: 100%; }
.form__error-wrap .error {
  display: block;
  color: #d0304a;
  font-size: 14px;
  text-align: center;
}
.form__error-wrap .error:empty { display: none; }

.form__fields {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}
.form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* ---------- campos ---------- */
.field { position: relative; width: 100%; }

.field__input,
.field__select {
  width: 100%;
  height: 54px;
  padding: 16px 24px;
  background: var(--grey-100);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--midnight);
}
.field__input::placeholder { color: var(--grey-500); }
.field__input:focus-visible,
.field__select:focus-visible {
  outline: 2px solid var(--midnight);
  outline-offset: 2px;
}

.field__select {
  appearance: none;
  -webkit-appearance: none;
  color: var(--grey-500);
  cursor: pointer;
  padding-right: 56px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 24px center;
}

.field-row { display: flex; gap: 8px; width: 100%; }

/* Contenedor prefijo (solo código, autocompletado por JS de país) */
.phone-container .prefix {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 16px;
  background: var(--grey-100);
  border-radius: 12px;
}
/* updatePhonePrefix() (createAccount.js) hace flagIcon.src = ... y
   flagIcon.alt = ... en cada cambio de país, sin chequear null: si se borra el
   <img>, esa función tira excepción. Se mantiene en el DOM (igual que
   #HeaderImagen) y se oculta acá — solo queda el número. */
.phone-container .flag-icon {
  display: none;
}
.phone-container #phonePrefix {
  /* updatePhonePrefix() (createAccount.js) setea "+549" (AR), " +57" (CO) o
     " +52" (MX): hasta 4 caracteres. 34px quedaba corto y cortaba el "9". */
  width: 48px;
  text-align: center;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--midnight);
  white-space: nowrap;
}
.field--phone { flex: 1 1 auto; min-width: 0; }

/* ---------- términos (checkbox real, texto compacto tipo disclaimer) ---------- */
/* El wrapper NO controla visibilidad: createAccount.js (setOptionsTipoDeCuenta /
   setVisibilityMuchasCosas / el script de país en el <head>) togglea el display
   del <label> (#terminosLabel / #terminosLabelPrivacidad) directamente vía
   estilo inline a 'block' o 'inline', nunca del wrapper. Si el wrapper quedara
   con display:none por default, un padre oculto tapa al hijo pase lo que pase
   con el inline style del label (bug: así estaba antes en esta hoja). */
.leerTerminos { width: 100%; }

.leiTerminos.crearCuentaCheckBox {
  display: none; /* estado de reposo; el JS de país lo pisa con 'block'/'inline' */
  font-size: 13px;
  line-height: 1.6;
  color: var(--midnight);
  cursor: pointer;
}
.leiTerminos.crearCuentaCheckBox input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: middle;
  accent-color: var(--midnight);
}
.leiTerminos.crearCuentaCheckBox a {
  text-decoration: underline;
  color: inherit;
}

/* Términos de Uso Particulares: la aceptación ahora es implícita al enviar el
   formulario (ver disclaimer del botón y createAccount.js ajaxCreate), para
   todos los países. El !important pisa el 'block'/'inline' que el JS de país
   sigue asignando inline a este label puntual. La Política de Privacidad
   (#terminosLabelPrivacidad, solo CO) sigue como checkbox real y visible. */
#terminosLabel.leiTerminos.crearCuentaCheckBox {
  display: none !important;
}

/* Elemento requerido por createAccount.js (setVisibilityMuchasCosas hace
   getElementById("HeaderImagen").style.display sin chequear null). No forma
   parte del diseño nuevo: se mantiene siempre oculto pase lo que pase el JS.
   #registroDiv es el wrapper que un script externo (tag de tracking, ver
   pixels.jsp) inyecta con el logo real fuera de .registro. Ojo: #registroDiv
   ya existe en login.jsp para otra cosa (el link "Regístrate"), por eso se
   apunta al #HeaderImagen de adentro y no al div entero. */
.registro #HeaderImagen,
#registroDiv #HeaderImagen { display: none !important; }

/* ---------- CTA ---------- */
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

#recaptcha { margin: 4px 0; }

/* estilos.css trae una regla genérica ".g-recaptcha * { margin: 10px auto auto
   auto !important; padding-right: 36px; }" para toda la app. Se neutraliza acá
   SOLO para esta pantalla (scopeada por #recaptcha, más específica que
   ".g-recaptcha *"), sin tocar el estilos.css global que usan otras pantallas. */
#recaptcha.g-recaptcha * {
  margin: 0 !important;
  padding-right: 0 !important;
}

.cta__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 22px 24px;
  color: var(--white);
  background:
    linear-gradient(var(--midnight), var(--midnight)) padding-box,
    var(--gradient-stroke) border-box;
  border: 3px solid transparent;
  border-radius: 100px;
  box-shadow: var(--shadow-cta);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta__button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta-hover);
}
.cta__button:active { transform: translateY(0); box-shadow: var(--shadow-cta); }
.cta__button:focus-visible { outline: 2px solid var(--midnight); outline-offset: 3px; }
.cta__button:hover .cta__arrow { transform: translateX(4px); }

/* Disclaimer genérico (distinto del checkbox .leerTerminos, que es el
   consentimiento legal país-condicional). Dos variantes del mismo texto,
   una visible a la vez según breakpoint:
   - .cta__disclaimer (párrafo, fuera del botón): mobile/tablet, arriba del
     botón, texto oscuro sobre blanco.
   - .cta__disclaimer--inline (span, adentro del botón): solo desktop
     (≥1024px), a la izquierda del label, texto blanco sobre el navy. */
.cta__disclaimer {
  display: block;
  margin: 0;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
  color: var(--midnight);
}
.cta__disclaimer a {
  color: inherit !important; /* mismo riesgo de "a" legacy pisando el color */
  text-decoration: underline;
}
.cta__disclaimer--inline {
  display: none; /* solo desktop, ver media query 1024px */
}

.cta__action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cta__label {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.4px;
  white-space: nowrap;
}
.cta__arrow {
  width: 26px;
  height: 16px;
  color: var(--white);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.cta__login {
  margin: 0;
  text-align: center;
  font-weight: 400;
  font-size: 15px;
  color: var(--midnight);
}
/* <a> no hereda color del <p> si faf.css/estilos.css lo declaran directo sobre
   el tag "a" (típico "a { color: <azul-legacy> }") — mismo patrón de siempre. */
.cta__login a {
  color: var(--midnight) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
  transition: opacity 0.2s ease;
}
.cta__login a:hover { opacity: 0.6; }

/* ---------- footer ---------- */
.registro-footer {
  width: 100%;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--grey-500);
}
.registro-footer a { color: inherit; }

/* ============================================================
   TABLET  (>= 768px) — dos columnas
   ============================================================ */
@media (min-width: 768px) {
  .registro { flex-direction: row; align-items: stretch; }
  .registro__hero { order: 1; flex: 0 0 45%; display: flex; }
  .registro__form { order: 2; flex: 1 1 55%; }

  .hero__card {
    flex: 1;
    justify-content: space-between;
    gap: 40px;
    padding: 80px 24px;
  }

  .registro__form { padding: 80px 56px; justify-content: center; }
}

/* ============================================================
   DESKTOP  (>= 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  .registro__hero { flex: 0 0 50%; }
  .registro__form { flex: 0 0 50%; }

  /* Sin min-height en .registro (sacado para que no fuerce scroll cuando el
     form es corto), el hero queda atado a align-items:stretch: si el form
     se achica (loading, sin todos los campos, etc.) el hero se achica con
     él. Este min-height le da un piso propio para que no se comprima. */
  .registro__hero { padding: 32px; border-radius: 20px; min-height: 880px; }
  .hero__card {
    padding: 48px 32px;
    gap: 32px;
    border-radius: 50px 110px 50px 110px;
  }
  .hero__logo { display: block; width: 140px; margin-left: 0; }
  .hero__title {
    font-size: 56px;
    line-height: 1.02;
    letter-spacing: -1.12px;
  }
  .hero__props {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }
  .value-prop { padding-left: 20px; }
  .value-prop__title {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -0.4px;
  }
  .value-prop__text { font-size: 15px; line-height: 1.4; }

  .registro__form { padding: 40px 64px 0px; align-items: center; justify-content: center; }
  .form__inner { max-width: 600px; gap: 23px; }

  .form__logo { display: none; }
  .form__heading { align-items: flex-start; text-align: left; gap: 12px; }
  .form__title { font-size: 36px; line-height: 42px; letter-spacing: -0.72px; text-align: left !important; }
  .form__subtitle { font-size: 16px; line-height: 1.4; letter-spacing: -0.32px; text-align: left !important; }

  .form__group { gap: 10px; }
  .form__fields { gap: 0px; }

  .field__input,
  .field__select {
    height: 52px;
    padding: 14px 28px;
    font-size: 17px;
  }
  .field__select { padding-right: 52px; background-position: right 26px center; }

  .cta { gap: 16px; }
  .cta__button { justify-content: space-between; padding: 22px 40px; }

  /* La variante en bloque (arriba del botón) se oculta; la inline (adentro,
     texto blanco) toma su lugar. */
  .cta__disclaimer { display: none; }
  .cta__disclaimer--inline {
    display: block;
    flex: 0 1 320px;
    text-align: left;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.35;
    color: var(--white);
  }
}

/* ============================================================
   DESKTOP COMPACTO (pantallas bajas, ej. laptops 1366x768)
   Achica campos y gaps para que el form entre sin scroll cuando
   la altura del viewport es chica. No afecta monitores grandes
   (ej. 1920x1080), donde ya entra sin cambios.
   ============================================================ */
@media (min-width: 1024px) and (max-height: 800px) {
  /* El min-height fijo de .registro__hero (ver breakpoint desktop general)
     es para pantallas altas; acá el objetivo es lo opuesto (entrar sin
     scroll), así que se anula. */
  .registro__hero { min-height: 715px; }

  .field__input,
  .field__select {
    height: 45px;
    font-size: 14px;
  }
  .form__group { gap: 9px; }

  .form__fields { gap: 8px; }

  .cta { gap: 0px; }

  .phone-container .prefix { height: 45px; }
  .phone-container #phonePrefix { font-size: 14px; }

  /* .form__error-wrap envuelve al <span id="create_error">: cuando no hay
     error, el span queda vacío pero el div sigue siendo un hijo flex más de
     .form__inner, así que suma sus DOS gaps (antes y después) aunque no
     ocupe altura visible. El margin-bottom negativo cancela uno de los dos
     para que el hueco muerto entre el subtítulo y el primer campo quede en
     12px en vez de 24px. */
  .form__error-wrap { margin-bottom: -12px; }

  .form__inner{ gap: 10px; }

  .cta__button { padding: 13px 40px; }
  .cta__login { padding-top: 8px; }

  .cta__arrow { width: 24px; }
  .cta__label { font-size: 18px; }

  /* #loginPopup#create_error (vs #loginPopup .error de estilos.css) para no afectar
     el resto de las pantallas que comparten el id "loginPopup" (login, Tienda Nube, etc). */
  #loginPopup #create_error { margin: 13px 0px; }
}

/* ============================================================
   ENTRANCE
   Mismo lenguaje que la home: fade + rise. Corre al cargar, sin
   depender de JS.
   ============================================================ */
@keyframes regFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.hero__card,
.form__heading,
.form__group > *,
.cta {
  opacity: 0;
  animation: regFadeUp 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__card { animation-delay: 0.1s; }
.form__heading { animation-delay: 0.2s; }
.form__group > *:nth-child(1) { animation-delay: 0.30s; }
.form__group > *:nth-child(2) { animation-delay: 0.37s; }
.form__group > *:nth-child(3) { animation-delay: 0.44s; }
.form__group > *:nth-child(4) { animation-delay: 0.51s; }
.form__group > *:nth-child(5) { animation-delay: 0.58s; }
.form__group > *:nth-child(6) { animation-delay: 0.65s; }
.form__group > *:nth-child(7) { animation-delay: 0.72s; }
.cta { animation-delay: 0.82s; }

@media (prefers-reduced-motion: reduce) {
  .hero__card,
  .form__heading,
  .form__group > *,
  .cta {
    opacity: 1;
    animation: none;
  }
}
