/* =========================================================================
   Araant — servicios: acceso (/login y /registro), landing de campaña
   (/campana), justificar una subvención y asesorías. Sistema «Mercury».
   Se carga después de sitio.css, marco.css y catalogo.css. Prefijo sv-.
   Solo usa las variables de sitio.css: ningún color nuevo.
   ========================================================================= */

/* --- Piezas comunes ---------------------------------------------------------- */
.sv-solojs { display: none; }
.js .sv-solojs { display: inline-flex; }
.sv-opcional { font-size: 13px; font-weight: 400; color: var(--ash); }
@keyframes sv-sube { from { opacity: 0; transform: translateY(14px); } }
@keyframes sv-barra { from { transform: scaleX(0); } }
@keyframes sv-deriva { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.12) translate3d(-1.2%, -0.8%, 0); } }

/* --- Aviso de errores (el servidor lo rellena y el JS lo actualiza) ------------- */
.sv-aviso {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start;
  margin-top: 26px; padding: 16px 18px;
  border: 1px dashed var(--ivory); border-radius: var(--r-tarjeta);
  background: rgba(237, 237, 243, 0.05); color: var(--ivory); font-size: 15px; line-height: 1.5;
}
.sv-aviso[hidden] { display: none; }
.sv-aviso .ct-marca { margin-top: 1px; border-style: dashed; border-color: var(--ivory); color: var(--ivory); }
.sv-aviso p { margin: 0 0 6px; }
.sv-aviso p:last-child { margin-bottom: 0; }
.sv-aviso:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }

/* --- Formularios ------------------------------------------------------------------- */
.sv-form { display: grid; gap: 20px; margin-top: 28px; }
.sv-form .campo { gap: 8px; min-width: 0; }
.sv-form .campo label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; font-weight: 420; color: var(--ash); }
.sv-form .campo input:not([type="checkbox"]), .sv-form .campo select, .sv-form .campo textarea { width: 100%; min-width: 0; font-size: 16px; }
.sv-form .campo select { text-overflow: ellipsis; }
.sv-form .campo textarea {
  display: block; min-height: 120px; padding: 14px 20px; border-radius: 20px; resize: vertical;
  background: transparent; border: 1px solid var(--linea-fuerte); color: var(--ivory); line-height: 1.5;
  transition: border-color 0.2s var(--curva);
}
.sv-form .campo textarea:hover { border-color: var(--ash); }
/* El borde solo no basta como foco: anillo propio en todos los controles. */
.sv-form .campo input:focus-visible, .sv-form .campo select:focus-visible, .sv-form .campo textarea:focus-visible {
  outline: 2px solid var(--ivory); outline-offset: 2px; border-color: var(--ivory); border-radius: var(--r-control);
}
.sv-form .campo textarea:focus-visible { border-radius: 20px; }
.sv-form [aria-invalid="true"] { border-color: var(--ivory); border-style: dashed; }
/* El autorrelleno de Chrome pinta fondo claro: se devuelve al tema oscuro. */
.sv-form input:-webkit-autofill, .sv-form input:-webkit-autofill:hover, .sv-form input:-webkit-autofill:focus,
.sv-form select:-webkit-autofill, .sv-form textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ivory); caret-color: var(--ivory);
  -webkit-box-shadow: 0 0 0 1000px var(--grafito) inset; box-shadow: 0 0 0 1000px var(--grafito) inset;
  transition: background-color 9999s ease-out 0s;
}

.sv-clave { position: relative; }
.sv-clave input { padding-right: 112px; }
.sv-ojo {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  align-items: center; justify-content: center; min-width: 76px; height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--r-pildora); background: transparent; color: var(--ash);
  font-size: 14px; font-weight: 420; cursor: pointer;
  transition: color 0.2s var(--curva), background-color 0.2s var(--curva);
}
.sv-ojo:hover { color: var(--ivory); background: rgba(237, 237, 243, 0.08); }
.sv-largo { position: absolute; left: 24px; right: 24px; bottom: 7px; height: 2px; border-radius: 2px; background: var(--linea); overflow: hidden; pointer-events: none; }
.sv-largo i { display: block; height: 100%; background: var(--ivory); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform 0.3s var(--curva); }
.sv-ayuda { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ash); }
.sv-ayuda.is-ok { color: var(--ivory); }

.sv-boton { width: 100%; min-height: 52px; }
.sv-boton[aria-busy="true"] { opacity: 0.75; cursor: progress; pointer-events: none; }

.sv-perfil { display: grid; gap: 6px; padding: 16px 18px; border: 1px solid var(--linea-fuerte); border-radius: var(--r-tarjeta); }
.sv-perfil__tit { margin: 0; font-size: 12px; font-weight: 480; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash); }
.sv-perfil__val { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ivory); }
.sv-mas__cuerpo { display: grid; gap: 20px; padding-top: 8px; }

.sv-acepto { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px; align-items: start; }
.sv-acepto input {
  -webkit-appearance: none; appearance: none; display: grid; place-content: center;
  width: 26px; height: 26px; margin: 0; border: 1px solid var(--linea-fuerte); border-radius: 8px; background: transparent; cursor: pointer;
  transition: background-color 0.15s var(--curva), border-color 0.15s var(--curva);
}
.sv-acepto input::before {
  content: ""; width: 12px; height: 7px; border-left: 2px solid var(--onyx); border-bottom: 2px solid var(--onyx);
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 0.15s var(--curva);
}
.sv-acepto input:checked { background: var(--ivory); border-color: var(--ivory); }
.sv-acepto input:checked::before { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.sv-acepto input:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }
.sv-acepto input[aria-invalid="true"] { border-style: dashed; border-color: var(--ivory); }
.sv-acepto label { padding-top: 2px; font-size: 15px; line-height: 1.5; color: var(--ash); cursor: pointer; }
.sv-acepto a, .sv-legal a { display: inline-block; padding-block: 3px; color: var(--ivory); }
.sv-legal { margin: 18px 0 0; font-size: 13px; line-height: 1.55; color: var(--ash); }
.sv-legal a { color: var(--ash); }

.sv-salidas { margin-top: 28px; border-top: 1px solid var(--linea); }
.sv-salidas li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--linea); font-size: 15px; line-height: 1.4; color: var(--ash); }

/* --- Acceso: formulario a un lado, foto del horizonte al otro --------------------- */
.sv-acceso { display: grid; grid-template-columns: minmax(0, 1fr); }
.sv-acceso__form {
  display: flex; justify-content: center; min-width: 0;
  padding: calc(var(--alto-encabezado) + clamp(28px, 6vw, 56px)) var(--margen) clamp(40px, 7vw, 72px);
}
.sv-acceso__caja { width: 100%; max-width: 448px; min-width: 0; }
.sv-acceso__caja > .etiqueta { margin-bottom: 18px; }
.sv-acceso__caja h1 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: 0.005em; }
.sv-acceso__sub { margin: 16px 0 0; max-width: 40ch; font-size: 17px; line-height: 1.5; color: var(--ash); }

.sv-acceso__lado { position: relative; min-width: 0; border-top: 1px solid var(--linea); }
.sv-acceso__escena {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start;
  min-height: 460px; padding: clamp(48px, 8vw, 80px) var(--margen) clamp(56px, 9vw, 96px);
}
.sv-acceso__escena .ct-horizonte img { transform-origin: 50% 80%; }
/* El velo protege el texto en lo alto (cielo oscuro) y deja ver el brillo del horizonte abajo. */
.sv-acceso__velo {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(23, 23, 33, 0.8) 0%, rgba(23, 23, 33, 0.58) 40%, rgba(23, 23, 33, 0.14) 70%, rgba(23, 23, 33, 0) 100%),
    linear-gradient(90deg, rgba(23, 23, 33, 0.4) 0%, rgba(23, 23, 33, 0) 70%);
}
.sv-acceso__mensaje { position: relative; width: 100%; max-width: 540px; }
.sv-acceso__mensaje .etiqueta { margin-bottom: 20px; color: var(--mist); }

.sv-hechos { margin: 0; border-top: 1px solid var(--linea-fuerte); }
.sv-hecho { display: flex; flex-direction: column-reverse; gap: 8px; padding: 18px 0 20px; border-bottom: 1px solid var(--linea); }
.sv-hecho dt { font-size: 15px; line-height: 1.45; color: var(--mist); max-width: 44ch; }
.sv-hecho dd {
  margin: 0; font-family: var(--f-titular); font-stretch: 112%; font-weight: 480;
  font-size: clamp(30px, 3.2vw, 44px); line-height: 1; letter-spacing: -0.005em; color: var(--ivory);
}
.sv-hecho--serie dd { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: 0.02em; }
.sv-acceso__fuente { margin: 18px 0 0; max-width: 48ch; font-size: 13px; line-height: 1.5; color: var(--mist); }

@media (min-width: 1024px) {
  .sv-acceso { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100svh; }
  .sv-acceso__form { align-items: center; padding-inline: clamp(32px, 5vw, 80px); }
  .sv-acceso__lado { border-top: 0; border-left: 1px solid var(--linea); }
  /* La foto se queda fija a pantalla completa mientras se lee un formulario largo (el alta). */
  .sv-acceso__escena {
    position: sticky; top: 0; height: 100svh; min-height: 560px;
    padding: calc(var(--alto-encabezado) + 56px) clamp(32px, 4vw, 72px) clamp(32px, 4vw, 56px);
  }
}
@media (min-width: 1024px) and (max-height: 780px) {
  .sv-hecho { padding: 12px 0 14px; gap: 6px; }
  .sv-hecho dd { font-size: clamp(26px, 2.6vw, 34px); }
  .sv-acceso__fuente { margin-top: 12px; }
}
@media (min-width: 1280px) { .sv-acceso { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .sv-acceso__escena .ct-horizonte img { animation: sv-deriva 36s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: no-preference) {
  .sv-hecho { animation: sv-sube 0.9s var(--curva-suave) both; animation-delay: calc(0.2s + var(--i, 0) * 0.12s); }
}
@media (max-width: 640px) {
  .sv-acceso__sub { font-size: 16px; }
  .sv-clave input { padding-right: 104px; }
}

/* --- Cabeceras de página de servicio ------------------------------------------------ */
.sv-heroe .titular-xl { max-width: 24ch; }
.sv-heroe .entradilla { max-width: 56ch; }
.sv-cifras-regla dd { font-size: clamp(28px, 3.4vw, 52px); }

/* --- Bloque con introducción fija a la izquierda y lista a la derecha ----------------- */
.sv-bloque { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--hueco); row-gap: 36px; align-items: start; }
.sv-bloque__intro { grid-column: 1 / span 4; position: sticky; top: calc(var(--alto-encabezado) + 28px); }
.sv-bloque__intro .titular { margin-top: 14px; }
.sv-bloque__texto { margin: 18px 0 0; max-width: 36ch; font-size: 16px; line-height: 1.55; color: var(--ash); }
.sv-bloque > :not(.sv-bloque__intro) { grid-column: 6 / span 7; min-width: 0; }
@media (max-width: 1023px) {
  .sv-bloque__intro, .sv-bloque > :not(.sv-bloque__intro) { grid-column: 1 / -1; position: static; }
}

/* --- Lista numerada editorial (los diez pasos, las funciones del panel) ------------------ */
.sv-pasos { border-top: 1px solid var(--linea-fuerte); }
.sv-pasos li { display: grid; grid-template-columns: clamp(48px, 5vw, 72px) minmax(0, 1fr); gap: 0 clamp(14px, 2vw, 24px); padding: 26px 0 28px; border-bottom: 1px solid var(--linea); }
.sv-pasos .indice { padding-top: 2px; font-family: var(--f-titular); font-stretch: 112%; font-weight: 480; font-size: clamp(26px, 2.6vw, 36px); line-height: 1; letter-spacing: 0; color: var(--ash); }
.sv-pasos h3 { margin: 0 0 8px; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.22; }
.sv-pasos p { margin: 0 0 12px; max-width: 62ch; font-size: 16px; line-height: 1.55; color: var(--ash); }
.sv-pasos p:last-child { margin-bottom: 0; }
.sv-pasos a:not(.enlace-flecha) { display: inline-block; padding-block: 3px; color: var(--ivory); }

/* --- Notas y leyendas ------------------------------------------------------------------- */
.sv-nota { margin: clamp(28px, 3vw, 40px) 0 0; max-width: 72ch; padding: 18px 22px; border: 1px solid var(--linea-fuerte); border-radius: var(--r-tarjeta); font-size: 15px; line-height: 1.6; color: var(--ash); }
.sv-gravedad { margin-top: clamp(24px, 3vw, 36px); }
.sv-enlace { margin: clamp(24px, 3vw, 32px) 0 0; }
.sv-enlace a { min-height: 24px; }

/* --- Landing de campaña ---------------------------------------------------------------- */
.sv-heroe-camp .titular-xl { max-width: 22ch; }
.sv-heroe-camp .heroe__contenido { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--hueco); align-items: end; }
.sv-heroe-camp .heroe__texto { grid-column: 1 / span 7; max-width: none; }
.sv-heroe-camp .sv-camp-accion { grid-column: 1 / span 7; min-width: 0; }
.sv-heroe-camp .sv-panel { grid-column: 9 / span 4; grid-row: 1 / span 2; align-self: end; min-width: 0; }

.sv-comprobador {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 14px var(--hueco); align-items: end;
  margin-top: clamp(20px, 2.6vw, 32px); padding: clamp(16px, 2vw, 24px);
  background: rgba(23, 23, 33, 0.74); border: 1px solid var(--linea-fuerte); border-radius: var(--r-tarjeta);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.sv-comprobador .campo { min-width: 0; }
.sv-comprobador .campo select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.sv-comprobador .campo select:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }
.sv-comprobador .boton { height: 52px; }
.sv-camp-nota { margin: 14px 0 0; max-width: 60ch; font-size: 14px; line-height: 1.5; color: var(--ash); }
.sv-camp-nota--enlace { margin-top: 6px; }
.sv-camp-nota .enlace-flecha { margin-left: 6px; }

.sv-panel {
  padding: clamp(20px, 2.4vw, 32px); background: rgba(23, 23, 33, 0.74); border: 1px solid var(--linea-fuerte); border-radius: var(--r-tarjeta);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.sv-panel .etiqueta { color: var(--mist); }
.sv-panel__cifra { display: flex; flex-direction: column-reverse; gap: 6px; margin: 20px 0 0; }
.sv-panel__cifra b { font-family: var(--f-titular); font-stretch: 112%; font-weight: 480; font-size: clamp(56px, 6vw, 88px); line-height: 0.95; letter-spacing: -0.01em; color: var(--ivory); }
.sv-panel__cifra span { font-size: 15px; line-height: 1.4; color: var(--ash); }
.sv-panel__dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 22px 0 0; border-top: 1px solid var(--linea); }
.sv-panel__dos div { display: flex; flex-direction: column-reverse; gap: 4px; padding: 16px 12px 16px 0; }
.sv-panel__dos div + div { padding-left: 16px; border-left: 1px solid var(--linea); }
.sv-panel__dos dd { margin: 0; font-family: var(--f-titular); font-stretch: 112%; font-weight: 480; font-size: clamp(26px, 2.6vw, 36px); line-height: 1; }
.sv-panel__dos dt { font-size: 13px; line-height: 1.35; color: var(--ash); }
.sv-barras { border-top: 1px solid var(--linea); }
.sv-barras li { display: grid; grid-template-columns: minmax(0, 10.8rem) minmax(0, 1fr) 2.4rem; gap: 12px; align-items: center; min-height: 40px; border-bottom: 1px solid var(--linea); font-size: 14px; }
.sv-barras__nombre { color: var(--ash); }
.sv-barras b { text-align: right; font-weight: 480; color: var(--ivory); }
.sv-barra { display: block; height: 6px; border-radius: 3px; background: var(--linea); overflow: hidden; }
.sv-barra i { display: block; width: var(--p, 0%); height: 100%; border-radius: 3px; background: var(--ivory); transform-origin: left; }
.animado .sv-barra i { animation: sv-barra 1.1s var(--curva-suave) 0.3s both; }
.sv-panel__pie { margin: 16px 0 0; font-size: 13px; line-height: 1.5; color: var(--ash); }
.sv-camp-fecha { margin: 16px 0 0; }

.sv-contacto { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--hueco); row-gap: 40px; align-items: start; }
.sv-contacto__texto { grid-column: 1 / span 5; min-width: 0; }
.sv-contacto__texto .titular { margin: 14px 0 20px; }
.sv-contacto__lead { max-width: 44ch; margin: 0 0 20px; font-size: 17px; line-height: 1.55; color: var(--ash); }
.sv-contacto__caja { grid-column: 7 / span 6; min-width: 0; padding: clamp(22px, 3vw, 40px); border: 1px solid var(--linea-fuerte); border-radius: var(--r-tarjeta); background: rgba(30, 30, 42, 0.7); }
.sv-contacto__caja .sv-aviso { margin: 0 0 22px; }
.sv-contacto__caja .sv-form { margin-top: 0; }
.sv-form--dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sv-form--dos .sv-ancho { grid-column: 1 / -1; }
.sv-ok { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.sv-ok h3 { margin: 0 0 6px; font-size: clamp(22px, 2.2vw, 28px); }
.sv-ok p { margin: 0; line-height: 1.55; color: var(--ash); }

@media (max-width: 1100px) {
  .sv-heroe-camp .heroe__texto, .sv-heroe-camp .sv-camp-accion, .sv-heroe-camp .sv-panel { grid-column: 1 / -1; grid-row: auto; }
  .sv-heroe-camp .sv-panel { margin-top: 32px; }
}
@media (max-width: 960px) {
  .sv-contacto__texto, .sv-contacto__caja { grid-column: 1 / -1; }
  .sv-comprobador { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-comprobador .boton { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .sv-heroe-camp .titular-xl { font-size: clamp(30px, 8.6vw, 40px); margin-bottom: 16px; }
  .sv-heroe-camp .etiqueta { margin-bottom: 18px; }
  .sv-heroe-camp .entradilla { font-size: 17px; }
  .sv-comprobador { grid-template-columns: 1fr; padding: 16px; }
  .sv-form--dos { grid-template-columns: 1fr; }
  .sv-contacto__caja { padding: 20px 16px; }
  .sv-barras li { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) 2.2rem; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .animado .sv-barra i { animation: none; }
}
