/* ─────────────────────────────────────────────────────────────────────────────
   Permix · Login del demo.
   Réplica de la pantalla de acceso de la plataforma Permix (mcal.sym3.cl/login):
   panel de marca con fotografía a la izquierda y formulario a la derecha.
   Hoja autónoma: index.html solo carga este archivo, no app.css.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --brand-primario: #1a1a1a;
  --brand-acento: #fa4c03;
  --brand-acento-soft: #fa4c031a;
  --brand-acento-texto: #d74103;
  --brand-acento-hover: #d84203;
  --brand-acento-sobre: #ffffff;
  --neutro-50: #f8fbfa;
  --neutro-100: #eef3f1;
  --neutro-200: #dbe1df;
  --neutro-300: #c9d2ce;
  --neutro-400: #929b97;
  --neutro-500: #69726f;
  --neutro-600: #404945;
  --fondo: var(--neutro-50);
  color-scheme: light;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 300;
  color: var(--brand-primario);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

svg {
  flex-shrink: 0;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ───────── Contenedor ───────── */

.auth {
  display: flex;
  min-height: 100dvh;
  background: var(--fondo);
}

/* ───────── Panel de marca (izquierda, solo desde 1024px) ───────── */

.auth__marca {
  position: sticky;
  top: 0;
  display: none;
  height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  width: 48%;
  max-width: 46rem;
  flex-shrink: 0;
  overflow: hidden;
  padding: 3rem 3.5rem;
  background: var(--brand-primario);
  color: #fff;
}
@media (min-width: 1024px) {
  .auth__marca {
    display: flex;
  }
}
@media (min-width: 1440px) {
  .auth__marca {
    padding: 3.5rem 4.5rem;
  }
}

.auth__foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.auth__velo {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand-primario) 22%, transparent),
    color-mix(in srgb, var(--brand-primario) 54%, transparent) 45%,
    color-mix(in srgb, var(--brand-primario) 86%, transparent) 78%,
    color-mix(in srgb, var(--brand-primario) 96%, transparent)
  );
}

.auth__marca-cab,
.auth__hero,
.auth__marca-pie {
  position: relative;
}

.auth__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff8c;
}
.auth__eyebrow i {
  width: 1.25rem;
  height: 1px;
  background: var(--brand-acento);
}

.auth__hero {
  max-width: 30rem;
  padding: 2rem 0;
}
.auth__hero-logo {
  display: block;
  margin-top: 1.25rem;
  height: clamp(2.5rem, 1.5rem + 1.6vw, 3.25rem);
  width: auto;
  max-width: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.auth__hero p {
  margin-top: 1.5rem;
  max-width: 26rem;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.65;
  color: #ffffff9e;
}

.auth__marca-pie {
  display: grid;
  gap: 0.875rem;
  font-size: 11.5px;
  font-weight: 400;
  color: #ffffff61;
}
.auth__nota {
  max-width: 24rem;
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.55;
  color: #ffffff80;
}

/* ───────── Panel del formulario (derecha) ───────── */

.auth__panel {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.5rem;
}
@media (max-width: 1023px) {
  /* Sin panel de marca, una línea de acento arriba mantiene la identidad. */
  .auth__panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-acento);
  }
}
@media (min-width: 640px) {
  .auth__panel {
    padding: 1.75rem 2.5rem 2rem;
  }
}

.auth__barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  color: var(--brand-primario);
}
@media (min-width: 1024px) {
  /* En escritorio la barra no muestra nada: no reserva alto para que el
     formulario y los accesos de demo quepan sin scroll. */
  .auth__barra {
    min-height: 0;
  }
  .auth__barra > * {
    visibility: hidden;
  }
}

.auth__centro {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}
.auth__caja {
  width: 100%;
  max-width: 26rem;
}

.auth__logo-permix {
  display: block;
  height: 2.25rem;
  width: auto;
  margin-bottom: 1.5rem;
}

.auth__cabecera {
  margin-bottom: 1.25rem;
  animation: auth-entra 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth__cabecera h1 {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--brand-primario);
}
.auth__cabecera p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--neutro-500);
}

.auth__form {
  animation: auth-entra 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}
.auth__ayuda {
  margin-top: 1rem;
  font-size: 12.5px;
  font-weight: 300;
  color: var(--neutro-400);
}

.auth__pie {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--neutro-400);
}
@media (min-width: 640px) {
  .auth__pie {
    justify-content: flex-end;
  }
}
.auth__pie > span[aria-hidden] {
  opacity: 0.5;
}

@keyframes auth-entra {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth__cabecera,
  .auth__form {
    animation: none;
  }
}

/* ───────── Campos ───────── */

.campo {
  display: block;
}
.campo + .campo {
  margin-top: 1.125rem;
}
.campo__wrap {
  position: relative;
  display: block;
}
.etiqueta {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neutro-500);
}
.input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--neutro-200);
  border-radius: 10px;
  background: #fff;
  padding: 0 1rem;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--brand-primario);
  transition: border-color 0.15s, box-shadow 0.15s;
}
@media (max-width: 639px) {
  /* 16px evita el zoom automático de iOS al enfocar. */
  .input {
    font-size: 16px;
  }
}
.input::placeholder {
  color: var(--neutro-300);
}
.input:hover:not(:focus) {
  border-color: var(--neutro-300);
}
.input:focus {
  outline: none;
  border-color: var(--brand-acento);
  box-shadow: 0 0 0 3px var(--brand-acento-soft);
}
.campo--pass .input {
  padding-right: 3rem;
}
.campo__ojo {
  position: absolute;
  right: 0.375rem;
  top: 50%;
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--neutro-400);
  transition: background-color 0.15s, color 0.15s;
}
.campo__ojo:hover {
  background: var(--neutro-100);
  color: var(--neutro-600);
}

/* ───────── Botón principal ───────── */

.btn-primario {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand-acento);
  padding: 0.5rem 1.25rem;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--brand-acento-sobre);
  transition: background-color 0.18s, transform 0.12s, box-shadow 0.18s;
}
.btn-primario svg {
  transition: transform 0.18s;
}
.btn-primario:hover:not(:disabled) {
  background: var(--brand-acento-hover);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand-acento) 70%, transparent);
}
.btn-primario:hover:not(:disabled) svg {
  transform: translateX(3px);
}
.btn-primario:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-primario:focus-visible {
  outline: 2px solid var(--brand-primario);
  outline-offset: 2px;
}
.btn-primario:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ───────── Acceso de demostración ───────── */

.auth__demo {
  margin-top: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--neutro-200);
  border-radius: 14px;
  background: #fff;
}
.auth__demo-cab {
  border-bottom: 1px solid var(--neutro-200);
  background: var(--neutro-50);
  padding: 0.75rem 1rem;
}
.auth__demo-cab p {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-primario);
}
.auth__demo-cab span {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 300;
  color: var(--neutro-500);
}
/* Tarjetas en grilla de dos columnas: cuatro roles en dos filas para que el
   login completo quepa en una pantalla de escritorio sin scroll. */
.auth__demo-lista {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.625rem;
}
@media (max-width: 479px) {
  .auth__demo-lista {
    grid-template-columns: minmax(0, 1fr);
  }
}
.auth__demo-item {
  /* Título y flecha en la primera fila; la descripción ocupa todo el ancho. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 0.25rem 0.5rem;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--neutro-200);
  border-radius: 10px;
  background: #fff;
  padding: 0.625rem 0.75rem;
  text-align: left;
  color: var(--brand-primario);
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.auth__demo-item:hover:not(:disabled) {
  background: var(--neutro-50);
  border-color: var(--neutro-300);
  box-shadow: 0 6px 16px -12px rgba(0, 0, 0, 0.35);
}
.auth__demo-item:focus-visible {
  outline: 2px solid var(--brand-acento);
  outline-offset: 2px;
}
.auth__demo-item:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.auth__demo-item[aria-busy='true'] {
  opacity: 1;
  border-color: var(--brand-acento);
}
.auth__demo-texto {
  /* El span envolvente desaparece para que b y small se ubiquen en la grilla. */
  display: contents;
}
.auth__demo-texto b {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.auth__demo-texto small {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.35;
  color: var(--neutro-500);
}
.auth__demo-flecha,
.auth__demo-spin {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  flex-shrink: 0;
}
.auth__demo-flecha {
  color: var(--neutro-300);
  transition: color 0.15s, transform 0.15s;
}
.auth__demo-item:hover:not(:disabled) .auth__demo-flecha {
  color: var(--brand-acento);
  transform: translateX(2px);
}
.auth__demo-spin {
  width: 14px;
  height: 14px;
  border: 2px solid var(--neutro-200);
  border-top-color: var(--brand-acento);
  border-radius: 999px;
  animation: auth-gira 0.7s linear infinite;
}
@keyframes auth-gira {
  to {
    transform: rotate(360deg);
  }
}

/* ───────── Escritorios de poca altura (notebooks 1366×768 con barra de tareas) ─────────
   Aprieta un poco más los espacios para que el login siga entrando en una sola pantalla. */

@media (min-width: 1024px) and (max-height: 780px) {
  .auth__panel {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .auth__centro {
    padding: 0.25rem 0;
  }
  .auth__logo-permix {
    height: 2rem;
    margin-bottom: 1rem;
  }
  .auth__cabecera {
    margin-bottom: 0.875rem;
  }
  .auth__cabecera h1 {
    font-size: 1.625rem;
  }
  .auth__cabecera p {
    margin-top: 0.25rem;
  }
  .campo + .campo {
    margin-top: 0.875rem;
  }
  .input,
  .btn-primario {
    min-height: 44px;
  }
  .btn-primario {
    margin-top: 1rem;
  }
  .auth__ayuda {
    margin-top: 0.75rem;
  }
  .auth__demo {
    margin-top: 1rem;
  }
  .auth__demo-cab {
    padding: 0.5rem 0.875rem;
  }
  .auth__demo-item {
    padding: 0.5rem 0.625rem;
  }
}
