/* ══════════════════════════════════════════════════════════════════════
   Login — I.E.P. Cusi Cusi
   Tarjeta partida: panel institucional azul a la izquierda, formulario a
   la derecha. Paleta de marca (azul institucional + rojo Cusi Cusi).
   Este archivo solo lo consume auth/login.blade.php; el resto de vistas
   de auth siguen con las utilidades de Breeze.

   Escala: pensada para que la tarjeta entre completa en una pantalla de
   ~700px de alto util, incluso con el navegador al 125% de zoom.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* Azules institucionales Cusi Cusi */
  --navy-950: #071a3f;
  --navy-900: #0d2350;
  --navy-800: #12346f;
  --navy-700: #1b4488;
  --navy-600: #2a5aa8;

  /* Rojo de marca Cusi Cusi */
  --red-500: #e3192b;
  --red-600: #c31324;
  --red-200: #ff8f99;   /* legible sobre el panel azul */
  --red-tint: #fdeef0;  /* fondos suaves de iconos */

  --ink-900: #1b2440;
  --ink-700: #3c4763;
  --ink-500: #5a6680;
  --ink-400: #8b99b5;

  --line: #e3e8f0;
  --field-bg: #fbfcfe;
  --tint: #eaf0fb;
  --link: #12346f;

  --radius-card: 20px;
  --radius-field: 9px;
}

* {
  box-sizing: border-box;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  color: var(--ink-900);
  background: var(--navy-950);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100vh;
  /* dvh evita el salto por la barra de direcciones en moviles */
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 12% 8%, rgba(27, 68, 136, 0.70), transparent 58%),
    radial-gradient(circle at 88% 92%, rgba(18, 52, 111, 0.75), transparent 58%),
    radial-gradient(circle at 78% 18%, rgba(227, 25, 43, 0.13), transparent 42%),
    var(--navy-950);
}

/* ── Tarjeta ─────────────────────────────────────────────────────────── */
.auth-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px rgba(4, 12, 30, 0.5);
  overflow: hidden;
}

/* ══ PANEL IZQUIERDO ═════════════════════════════════════════════════ */
.auth-card__left {
  position: relative;
  isolation: isolate;
  /* el padding inferior reserva el sitio del pie, que va anclado al fondo */
  padding: 32px 34px 76px;
  color: #fff;
  background: linear-gradient(158deg, var(--navy-700) 0%, var(--navy-800) 46%, var(--navy-900) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* Trama de puntos de la esquina superior derecha */
.auth-card__left::before {
  content: "";
  position: absolute;
  top: 20px;
  right: 20px;
  width: 150px;
  height: 96px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 11px 11px;
  -webkit-mask-image: linear-gradient(215deg, #000 10%, transparent 72%);
  mask-image: linear-gradient(215deg, #000 10%, transparent 72%);
  z-index: -1;
}

/* Halo suave detras del contenido */
.auth-card__left::after {
  content: "";
  position: absolute;
  left: -100px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 25, 43, 0.20), transparent 68%);
  z-index: -1;
}

/* Silueta arquitectonica al pie del panel (sustituye la foto del diseno) */
.auth-skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  opacity: 0.09;
  z-index: -1;
  pointer-events: none;
}

/* ── Marca ───────────────────────────────────────────────────────────── */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 30px;
}

/* El escudo trae el nombre incorporado, asi que se muestra a un tamano en
   el que la cinta "Institucion Educativa" sigue siendo legible. Va sobre una
   pastilla blanca: el escudo es azul marino y sobre el panel se perderia. */
.auth-brand__logo {
  width: 108px;
  flex: 0 0 108px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(4, 12, 30, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.auth-brand__kicker {
  display: block;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--red-200);
  text-transform: uppercase;
}

.auth-brand__sub {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  margin-top: 5px;
}

/* ── Bienvenida ──────────────────────────────────────────────────────── */
.auth-hero__title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.15;
  color: #fff;
}

.auth-hero__rule {
  width: 52px;
  height: 3px;
  border-radius: 3px;
  background: var(--red-500);
  margin: 13px 0 18px;
}

.auth-hero__lead {
  font-size: 0.82rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.74);
  margin: 0;
  max-width: 40ch;
}

/* ── Pie del panel ───────────────────────────────────────────────────── */
.auth-panel-foot {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-panel-foot svg {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.45);
  flex: 0 0 18px;
}

.auth-panel-foot p {
  margin: 0;
  font-size: 0.61rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.45);
}

/* ══ PANEL DERECHO ═══════════════════════════════════════════════════ */
.auth-card__right {
  padding: 34px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-badge {
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  border-radius: 50%;
  background: var(--red-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-badge svg {
  width: 21px;
  height: 21px;
  color: var(--red-500);
}

.auth-card__header h2 {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--navy-800);
  margin: 0;
}

.auth-card__header p {
  font-size: 0.73rem;
  color: var(--ink-500);
  margin: 5px 0 0;
}

/* ── Formulario ──────────────────────────────────────────────────────── */
.auth-form label.auth-label {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 6px;
}

.auth-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--field-bg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.auth-field:focus-within {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(18, 52, 111, 0.13);
  background: #fff;
}

.auth-field__icon {
  width: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  color: var(--ink-400);
}

.auth-field__icon svg {
  width: 16px;
  height: 16px;
}

.auth-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.81rem;
  color: var(--ink-900);
}

.auth-field input::placeholder {
  color: var(--ink-400);
}

.auth-field__toggle {
  width: 40px;
  flex: 0 0 40px;
  border: 0;
  background: transparent;
  color: var(--ink-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.auth-field__toggle:hover {
  color: var(--ink-700);
}

.auth-field__toggle svg {
  width: 16px;
  height: 16px;
}

.auth-form .auth-group + .auth-group {
  margin-top: 14px;
}

/* ── Boton ───────────────────────────────────────────────────────────── */
.auth-btn {
  width: 100%;
  margin-top: 20px;
  border: 0;
  border-radius: var(--radius-field);
  padding: 11px 18px;
  background: var(--red-500);
  color: #fff;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background 0.18s ease;
}

.auth-btn:hover {
  background: var(--red-600);
}

.auth-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Ayuda ───────────────────────────────────────────────────────────── */
.auth-help {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.auth-help__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-help__icon svg {
  width: 17px;
  height: 17px;
  color: var(--navy-700);
}

.auth-help__title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--navy-800);
  margin: 0;
}

.auth-help__text {
  font-size: 0.69rem;
  line-height: 1.5;
  color: var(--ink-500);
  margin: 2px 0 0;
}

.auth-help__text a {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.auth-help__text a:hover {
  color: var(--red-500);
  text-decoration: underline;
}

/* ── Mensajes ────────────────────────────────────────────────────────── */
.auth-alert {
  border-radius: var(--radius-field);
  background: #eaf7ef;
  border: 1px solid #cbe9d7;
  color: #1f7a4c;
  font-size: 0.73rem;
  padding: 9px 12px;
  margin-bottom: 14px;
}

.auth-error {
  color: #c53030;
  font-size: 0.69rem;
  margin-top: 5px;
}

.auth-field--invalid {
  border-color: #f0b4b4;
  background: #fffafa;
}

/* ══ RESPONSIVE ══════════════════════════════════════════════════════ */

/* Pantallas bajas: la tarjeta se apoya arriba y la pagina desplaza. */
@media (max-height: 660px) {
  .auth-shell {
    align-items: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

/* ── Tablet: la tarjeta se apila pero aprovecha mas ancho ────────────── */
@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
    width: min(560px, 100%);
  }

  .auth-card__left {
    padding: 28px 28px 24px;
  }

  .auth-brand {
    margin-bottom: 22px;
  }

  .auth-hero__title {
    font-size: 1.45rem;
  }

  .auth-panel-foot {
    display: none;
  }

  .auth-card__right {
    padding: 30px 28px;
  }

  .auth-shell {
    align-items: flex-start;
  }
}

/* ── Celular: solo se muestra el formulario ──────────────────────────── */
@media (max-width: 600px) {
  /* El panel azul (marca, lema y pie) se oculta: en pantallas de telefono
     empujaba el formulario fuera de la vista sin aportar nada. */
  .auth-card__left {
    display: none;
  }

  .auth-card {
    grid-template-columns: 1fr;
    width: min(420px, 100%);
  }

  .auth-shell {
    align-items: center;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 18px 12px;
  }

  .auth-card__right {
    padding: 26px 22px;
  }

  .auth-brand__logo {
    width: 76px;
    flex: 0 0 76px;
  }

  .auth-brand__sub {
    font-size: 0.86rem;
  }
}

/* ── Celular chico (iPhone SE y similares) ───────────────────────────── */
@media (max-width: 380px) {
  .auth-shell {
    padding: 12px 10px;
  }

  .auth-card {
    border-radius: 16px;
  }

  .auth-card__right {
    padding: 24px 18px;
  }

  .auth-brand {
    gap: 10px;
  }

  .auth-brand__logo {
    width: 64px;
    flex: 0 0 64px;
  }

  .auth-brand__sub {
    font-size: 0.8rem;
  }

  .auth-hero__title {
    font-size: 1.3rem;
  }

  .auth-hero__lead,
  .auth-field input {
    font-size: 0.76rem;
  }
}

/* ── Pantallas bajas: movil en horizontal o ventana recortada ─────────
   Se ocultan los adornos del panel para que el formulario quede a la
   vista sin tener que desplazarse tanto. ─────────────────────────────── */
@media (max-height: 560px) {
  .auth-shell {
    align-items: flex-start;
    padding: 14px 12px;
  }

  .auth-card__left {
    padding: 20px 24px;
  }

  .auth-hero__lead,
  .auth-panel-foot {
    display: none;
  }

  .auth-brand {
    margin-bottom: 16px;
  }

  .auth-brand__logo {
    width: 68px;
    flex: 0 0 68px;
  }

  .auth-hero__title {
    font-size: 1.3rem;
  }

  .auth-hero__rule {
    margin: 9px 0 0;
  }

  .auth-card__right {
    padding: 22px 26px;
  }

  .auth-card__header {
    margin-bottom: 16px;
  }

  .auth-badge {
    width: 40px;
    height: 40px;
    margin-bottom: 9px;
  }

  .auth-help {
    margin-top: 16px;
    padding-top: 14px;
  }
}

/* Si ademas hay ancho suficiente (movil apaisado, ventana baja), se
   recuperan las dos columnas: asi el formulario cabe casi sin scroll. */
@media (min-width: 660px) and (max-height: 560px) {
  .auth-card {
    grid-template-columns: 1.02fr 0.98fr;
    width: min(760px, 100%);
  }

  .auth-card__left {
    justify-content: center;
  }
}
