/* ============================================================================
   auth.css — Acceso, registro y recuperación de contraseña
   Requiere theme.css
   ========================================================================= */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  min-height: 100dvh;
  background: var(--surface);
}

/* ---------------------------------------------------------------------------
   Columna del formulario
------------------------------------------------------------------------- */
.auth__form {
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 1rem + 3vw, 4rem) clamp(1.25rem, 0.5rem + 4vw, 5rem);
}

.auth__inner {
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding-block: var(--sp-6);
}
.auth--wide .auth__inner { max-width: 620px; }

.logo-container { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.logo { width: 154px; height: auto; }

.auth__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  padding: 5px var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: var(--fs-3xs);
  font-weight: 800;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}

.welcome {
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink-900);
  margin-bottom: var(--sp-3);
}
.welcome em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand-500), var(--plum-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  letter-spacing: 0;
  margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  text-transform: none;
}

/* Formularios */
.login-form,
.register-form {
  display: grid;
  gap: var(--sp-5);
}
.login-form .field,
.register-form .field { gap: var(--sp-2); }

.register-form .form-row { display: grid; gap: var(--sp-5); }
.register-form .form-row.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) {
  .register-form .form-row.two-cols { grid-template-columns: 1fr; }
}

/* Botones principales de autenticación: ancho completo, jerarquía clara */
.btn-access,
.btn-register {
  width: 100%;
  max-width: none;
  min-height: 50px;
  font-size: var(--fs-md);
  border-radius: var(--r-sm);
}
.btn-access { --btn-bg: var(--plum-600); --btn-bg-hover: var(--plum-500); }
.btn-register { --btn-bg: var(--brand-500); --btn-bg-hover: var(--brand-600); }

.auth__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: calc(var(--sp-2) * -1);
}
.auth__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--plum-500);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.auth__link:hover { color: var(--plum-600); border-color: currentColor; }

/* Separador «o» */
.auth__divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-block: var(--sp-7);
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  white-space: nowrap;
}
.auth__divider::before,
.auth__divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Bloque de invitación al registro */
.auth__cta {
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}
.register-text {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  text-transform: none;
}

.auth__foot {
  margin-top: var(--sp-8);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

/* Indicador de fortaleza de contraseña */
.pw-meter { display: grid; gap: var(--sp-2); }
.pw-meter__track { display: flex; gap: 4px; }
.pw-meter__seg {
  height: 4px;
  flex: 1;
  border-radius: var(--r-pill);
  background: var(--ink-200);
  transition: background var(--dur-3) var(--ease);
}
.pw-meter__label { font-size: var(--fs-2xs); font-weight: 600; color: var(--text-subtle); }
.pw-meter[data-score="1"] .pw-meter__seg:nth-child(-n+1) { background: var(--danger-500); }
.pw-meter[data-score="2"] .pw-meter__seg:nth-child(-n+2) { background: var(--warning-500); }
.pw-meter[data-score="3"] .pw-meter__seg:nth-child(-n+3) { background: var(--brand-500); }
.pw-meter[data-score="4"] .pw-meter__seg { background: var(--success-500); }

/* ---------------------------------------------------------------------------
   Columna de marca
------------------------------------------------------------------------- */
.auth__brand {
  position: sticky;
  top: 0;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-8);
  padding: clamp(2rem, 1rem + 4vw, 4.5rem);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(90% 70% at 15% 10%, rgba(0, 167, 181, 0.55) 0%, transparent 60%),
    radial-gradient(80% 80% at 100% 100%, rgba(125, 79, 174, 0.55) 0%, transparent 55%),
    linear-gradient(150deg, var(--plum-700) 0%, var(--plum-600) 45%, var(--brand-800) 100%);
}
/* Textura de puntos muy sutil */
.auth__brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.45;
  pointer-events: none;
}
/* Halo luminoso */
.auth__brand::after {
  content: '';
  position: absolute;
  top: -18%;
  right: -22%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 65%);
  pointer-events: none;
}

.auth__brand > * { position: relative; z-index: 1; }

.auth__headline {
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #fff;
  max-width: 15ch;
}
.auth__sub {
  margin-top: var(--sp-4);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: rgba(255, 255, 255, 0.82);
  max-width: 42ch;
}

.auth__figure {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.phone-image,
.person-image {
  width: 100%;
  max-width: 460px;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 32px 48px rgba(20, 8, 34, 0.45));
  animation: cl-float 7s var(--ease) infinite alternate;
}
.person-image { max-width: 400px; align-self: flex-end; }
/* Imagen del login (dos teléfonos): más grande y protagonista. */
.auth__figure .phone-image { max-width: 620px; max-height: none; }
@keyframes cl-float { from { transform: translateY(-6px); } to { transform: translateY(10px); } }

/* Puntos de valor */
.auth__points { display: grid; gap: var(--sp-4); }
.auth__point {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
  color: rgba(255, 255, 255, 0.88);
}
.auth__point svg { flex: 0 0 auto; margin-top: 1px; color: var(--brand-200); }

/* ---------------------------------------------------------------------------
   Responsivo
------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); }
  .auth__brand { gap: var(--sp-6); }
  .auth__points { display: none; }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth__brand {
    order: -1;
    /* relative, no static: los pseudoelementos decorativos deben quedar
       contenidos en esta columna y no cubrir toda la página. */
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    padding: var(--sp-7) var(--gutter) var(--sp-6);
    gap: var(--sp-5);
    text-align: center;
    align-items: center;
  }
  .auth__headline { max-width: none; font-size: var(--fs-2xl); }
  .auth__sub { display: none; }
  .auth__figure { display: none; }
  .auth__points { display: none; }
  .auth__form { padding-block: var(--sp-8) var(--sp-9); }
}

@media (max-width: 560px) {
  .auth__brand { padding: var(--sp-6) var(--gutter); }
  .logo { width: 128px; }
}

/* En pantallas muy bajas el bloque de marca estorba: se reduce al mínimo */
@media (max-height: 620px) and (min-width: 861px) {
  .phone-image, .person-image { max-width: 320px; }
  .auth__points { display: none; }
}

/* Pie al fondo también en las pantallas de acceso */
body { display: flex; flex-direction: column; min-height: 100dvh; }
body > .auth { flex: 1 0 auto; }
body > footer { flex: 0 0 auto; margin-top: 0; }
