/* Aretia ID: marca navy #131A30 y oro #C9A84C (CA-106). Fuentes de la landing servidas desde este mismo origen
   (public/fuentes, licencia OFL); sin CDN ni recursos remotos (CA-100). */
/* Los woff2 de public/fuentes son copia sin modificar de los que publica la landing (los de Google Fonts).
   Si se vuelven a recortar o convertir pasan a ser una version modificada bajo la OFL, y Source Serif 4
   reserva el nombre «Source»: no regenerarlos, bajarlos de nuevo sin tocar. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fuentes/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fuentes/source-serif-4-latin.woff2") format("woff2");
}

:root {
  --navy: #131a30;
  --navy-hondo: #0d1223;
  --navy-claro: #1b2543;
  --linea: #34416a;
  --linea-fuerte: #4a5786;
  /* Borde de controles (campos, botones secundarios): WCAG 1.4.11 pide 3:1 contra la tarjeta y el relleno. */
  --linea-control: #6b77a0;
  --linea-oro: rgba(201, 168, 76, 0.5);
  --oro: #c9a84c;
  --oro-claro: #dcc275;
  --texto: #eef0f6;
  --suave: #b4bbd0;
  --error: #ffb3a7;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--navy);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(201, 168, 76, 0.35);
  color: var(--texto);
}

/* ---------- Marca: el simbolo de barras del logo y el nombre ---------- */

.marca {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0;
  line-height: 1;
}

.marca-simbolo {
  flex: none;
  width: 1.9rem;
  height: auto;
  fill: var(--oro);
}

/* «Aretia | ID» no se parte nunca (body usa overflow-wrap: anywhere): si no cabe junto al simbolo, baja entero a la
   linea siguiente. El espacio entre los dos span del HTML no se dibuja dentro del flex; sirve sin CSS y al copiar. */
.marca-texto {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  white-space: nowrap; /* «Aretia | ID» baja junto: la raya nunca queda al inicio de una linea */
}

.marca-nombre,
.marca-id {
  overflow-wrap: normal;
  word-break: keep-all;
  font-size: 1.0625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.marca-nombre {
  font-weight: 700;
  color: var(--oro);
}

.marca-id {
  font-weight: 500;
  color: var(--texto);
  padding-left: 0.7rem;
  border-left: 1px solid var(--linea-fuerte);
}

/* El simbolo grande de fondo: barras de navy algo mas claro con filo dorado fino, como grabado. */
.arte svg {
  display: block;
  width: 100%;
  height: auto;
}

.arte path {
  fill: rgba(27, 37, 67, 0.6);
  stroke: var(--oro);
  stroke-opacity: 0.5;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* ---------- Pantallas de acceso: panel de marca y formulario ---------- */

.acceso {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.panel-columna {
  background: var(--navy-hondo);
  border-bottom: 1px solid var(--linea);
}

.panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  padding: 1rem 1.25rem;
}

.panel .marca,
.panel-lema {
  position: relative;
  z-index: 1;
}

.panel-lema {
  display: none;
}

.panel .arte {
  position: absolute;
  top: -1.25rem;
  right: -1.5rem;
  width: 9rem;
}

.tarjeta {
  width: 100%;
  min-width: 0;
  max-width: 26rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

/* ---------- Texto ---------- */

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.875rem, 1.5rem + 1vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
}

strong {
  font-weight: 600;
  color: var(--texto);
}

.suave {
  color: var(--suave);
}

/* Texto de ayuda bajo un campo (antes un style inline, que style-src 'self' bloquea). */
.pista {
  font-size: 0.875rem;
}

a {
  color: var(--oro);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

a:hover {
  color: var(--oro-claro);
}

:focus-visible {
  outline: 3px solid var(--oro);
  outline-offset: 3px;
}

/* ---------- Formularios ---------- */

form {
  margin: 1.75rem 0 0;
}

.campo {
  margin: 0 0 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  display: block;
  width: 100%;
  min-width: 0;
  height: 3rem;
  font: inherit;
  color: var(--texto);
  background: var(--navy-hondo);
  border: 1px solid var(--linea-control);
  border-radius: 0.625rem;
  padding: 0 0.95rem;
  transition: border-color 0.15s ease;
}

input[type="text"]:not([aria-invalid="true"]):hover,
input[type="email"]:not([aria-invalid="true"]):hover,
input[type="password"]:not([aria-invalid="true"]):hover {
  border-color: var(--suave);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--oro);
  outline: 2px solid var(--oro);
  outline-offset: 1px;
}

input[aria-invalid="true"] {
  border-color: var(--error);
}

.casilla {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
}

.casilla input {
  flex: none;
  margin: 0;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--oro);
}

.casilla label {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--suave);
  margin: 0;
}

.error-campo {
  color: var(--error);
  font-size: 0.875rem;
  margin: 0.45rem 0 0;
}

.aviso {
  border: 1px solid var(--linea);
  border-left: 3px solid var(--oro);
  background: var(--navy-hondo);
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
}

.aviso-error {
  border-left-color: var(--error);
  color: var(--error);
}

/* ---------- Botones ---------- */

.boton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--navy);
  background: var(--oro);
  border: 1px solid var(--oro);
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.boton:hover {
  background: var(--oro-claro);
  border-color: var(--oro-claro);
  color: var(--navy);
}

.boton[disabled] {
  cursor: progress;
  opacity: 0.75;
}

.boton-secundario {
  color: var(--oro);
  background: transparent;
  border-color: var(--linea-control);
}

.boton-secundario:hover {
  color: var(--oro-claro);
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--oro);
}

.acciones {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.enlaces {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 1.5rem 0 0;
  font-size: 0.9375rem;
}

/* ---------- «Mis productos» (S-11): pagina ancha y rejilla de tarjetas, sin JavaScript ---------- */

.portal {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.portal-cabecera {
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--linea);
}

.tarjeta.tarjeta-ancha {
  max-width: none;
  margin: 0;
  padding: 0;
}

.tarjeta-ancha h1 {
  font-size: clamp(2.25rem, 1.5rem + 2.5vw, 3.25rem);
  margin-bottom: 0.5rem;
}

.tarjeta-ancha h1 + p {
  font-size: 1.125rem;
}

.productos {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.producto {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--navy-claro);
  border: 1px solid var(--linea);
  border-radius: 1rem;
  padding: 1.5rem;
}

.producto h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
}

.producto p {
  margin: 0 0 1.5rem;
}

.producto .boton {
  align-self: flex-start;
  width: auto;
  min-width: 8.5rem;
  margin-top: auto;
}

/* El estado de la tarjeta lo pone la vista en el <li> (producto-entrar, producto-conocer, producto-ninguna,
   producto-proximo): no se deduce de la clase del boton ni del texto. */

/* Un producto que la cuenta ya usa (su accion es «Entrar») lleva el borde dorado. */
.producto-entrar {
  border-color: var(--linea-oro);
}

/* «Conectar» es una invitacion, no un producto que la cuenta ya usa: sin el borde dorado de «Entrar». */
.producto-conectar {
  border-color: var(--linea);
}

/* Lo que aun no existe queda como tarjeta abierta, sin fondo y con borde punteado. */
.producto-proximo {
  background: transparent;
  border-style: dashed;
}

.etiqueta {
  align-self: flex-start;
  color: var(--oro);
  border: 1px solid var(--linea-oro);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.producto p.etiqueta {
  margin: 0;
}

.salir {
  display: flex;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--linea);
}

.salir .boton {
  width: auto;
  min-height: 2.5rem;
  padding: 0.45rem 1.25rem;
  font-size: 0.9375rem;
}

/* Texto solo para lectores de pantalla: completa el nombre accesible de "Entrar" y "Conocer". */
.solo-lector {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 40rem) {
  .productos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .producto {
    min-height: 11.5rem;
  }
}

/* Escritorio: el panel de marca ocupa la izquierda a toda altura y el formulario queda a la derecha. */
@media (min-width: 60rem) {
  .acceso {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: none;
  }

  .panel-columna {
    border-bottom: 0;
    border-right: 1px solid var(--linea);
  }

  .panel {
    position: sticky;
    top: 0;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 2.75rem 3rem;
    gap: 2rem; /* con texto agrandado, el lema no se pega a la marca */
  }

  .panel-lema {
    display: block;
    max-width: 15ch;
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(2.25rem, 1rem + 2.2vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
    text-wrap: balance;
  }

  .panel .arte {
    top: auto;
    right: -14%;
    bottom: -10%;
    width: 88%;
  }

  .tarjeta {
    align-self: center;
    padding: 4rem 2rem;
  }
}

/* El unico movimiento: al cargar, las barras del simbolo suben a su sitio por su propia diagonal. */
@media (prefers-reduced-motion: no-preference) {
  .arte path {
    animation: barra 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .arte path:nth-child(2) {
    animation-delay: 0.08s;
  }

  .arte path:nth-child(3) {
    animation-delay: 0.16s;
  }

  .arte path:nth-child(4) {
    animation-delay: 0.24s;
  }
}

@keyframes barra {
  from {
    opacity: 0;
    transform: translate(-24px, 42px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
