/* =========================================================
   PALETA CONSTURAMA ALLENDE
   Azul principal: #062b70
   Azul secundario: #0b3f96
   Naranja: #ff7a00
   ========================================================= */

:root {
  --blue-950: #03183f;
  --blue-900: #062b70;
  --blue-800: #0b3f96;
  --blue-700: #1455b7;
  --orange: #ff7a00;
  --orange-soft: #ff9a3c;
  --white: #ffffff;
  --text: #18223a;
  --muted: #6d778d;
  --line: #dce4f1;
  --surface: #f6f8fc;
  --danger: #c93232;
  --success: #16784e;
  --shadow: 0 28px 70px rgba(2, 28, 75, 0.20);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 13px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--blue-950);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* CONTENEDOR PRINCIPAL */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(430px, 0.85fr);
  overflow: hidden;
}

/* LADO IZQUIERDO */
.hero{
    position:relative;
    overflow:hidden;

    background:
    linear-gradient(
        to right,
        rgba(6,43,112,.88) 0%,
        rgba(6,43,112,.65) 35%,
        rgba(6,43,112,.15) 70%,
        rgba(6,43,112,0) 100%
    ),
    url("../assets/fondo-allende.png");

    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 72% 61%, rgba(255, 122, 0, 0.22), transparent 26%),
    linear-gradient(to top, rgba(1, 13, 38, 0.65), transparent 40%);
}

.hero__content {
  width: min(760px, 100%);
  min-height: 100vh;
  padding: clamp(34px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  color: var(--white);
}

.hero__logo {
  display: block;
  width: clamp(220px, 28vw, 360px);
  height: auto;
  background: rgba(255,255,255,.96);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 18px 38px rgba(0,0,0,.24);
}

.hero__message {
  margin-block: auto;
  max-width: 610px;
}

.hero__eyebrow {
  margin: 0 0 4px;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.hero h1 span {
  color: var(--orange);
}

.hero__line {
  width: 96px;
  height: 4px;
  margin: 28px 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--orange), var(--orange-soft));
}

.hero__description {
  max-width: 540px;
  margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  line-height: 1.7;
  color: rgba(255,255,255,.92);
}

.hero__description strong {
  color: var(--orange);
}

.benefits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.18);
}

.benefit {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 8px 22px;
  border-right: 1px solid rgba(255,255,255,.2);
}

.benefit:first-child {
  padding-left: 0;
}

.benefit:last-child {
  border-right: 0;
}

.benefit__icon {
  flex: 0 0 auto;
  color: var(--orange);
}

.benefit__icon svg {
  width: 32px;
  height: 32px;
}

.benefit div:last-child {
  display: grid;
  gap: 2px;
}

.benefit strong,
.benefit span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.benefit strong {
  font-size: 0.95rem;
}

.benefit span {
  font-size: 0.86rem;
  color: rgba(255,255,255,.78);
}

.benefit--link {
    text-decoration: none;
    color: inherit;
}

.benefit--link:visited {
    color: inherit;
}

.benefit--link:hover {
    color: inherit;
    text-decoration: none;
}

.benefit--link:active {
    color: inherit;
}

.benefit--link:focus {
    color: inherit;
    text-decoration: none;
}
/* LADO DERECHO */
.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 64px);
  background:
    radial-gradient(circle at 85% 5%, rgba(25, 89, 190, .16), transparent 25%),
    linear-gradient(145deg, #f7f9fd 0%, #edf2fa 100%);
}

.login-card {
  width: min(100%, 610px);
  background: var(--white);
  border: 1px solid rgba(13, 56, 130, .08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-card__brand {
  display: flex;
  justify-content: center;
  padding: 34px 34px 0;
}

.brand-mark {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  padding: 13px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e3e9f4;
  box-shadow: 0 13px 32px rgba(4, 42, 101, .13);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-card__header {
  padding: 25px 54px 8px;
  text-align: center;
}

.login-card__header h2 {
  margin: 0 0 10px;
  color: var(--blue-900);
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.login-card__header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.login-form {
  padding: 28px 54px 36px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
}

.form-group label svg {
  color: var(--blue-900);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  min-height: 58px;
  padding: 0 50px 0 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(4, 25, 68, .03);
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease,
    transform .2s ease;
}

.input-wrap input::placeholder {
  color: #9aa5b7;
}

.input-wrap input:hover {
  border-color: #bdc9db;
}

.input-wrap input:focus {
  border-color: var(--blue-700);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(20, 85, 183, .11);
}

.input-wrap input.is-invalid {
  border-color: var(--danger);
  background: #fffafa;
  box-shadow: 0 0 0 4px rgba(201, 50, 50, .08);
}

.input-icon,
.password-toggle {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  color: #6f7c92;
}

.input-icon {
  pointer-events: none;
}

.password-toggle {
  display: grid;
  place-items: center;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--blue-900);
  background: #eaf0fa;
  outline: none;
}

.eye-closed {
  display: none;
}

.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: var(--danger);
  font-size: .78rem;
  font-weight: 600;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 26px;
}

.remember {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #4f5c72;
  cursor: pointer;
  user-select: none;
}

.remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #b9c5d7;
  border-radius: 5px;
  background: white;
  transition: .2s ease;
}

.remember input:checked + .checkmark {
  border-color: var(--blue-900);
  background: var(--blue-900);
}

.remember input:checked + .checkmark::after {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
}

.remember input:focus-visible + .checkmark {
  box-shadow: 0 0 0 4px rgba(20, 85, 183, .12);
}

.forgot-link {
  color: var(--orange);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.btn {
  width: 100%;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-radius: var(--radius-md);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    background .2s ease,
    border-color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: white;
  border: 1px solid var(--blue-900);
  background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
  box-shadow: 0 13px 28px rgba(6, 43, 112, .23);
}

.btn-primary:hover {
  box-shadow: 0 17px 34px rgba(6, 43, 112, .30);
}

.btn-secondary {
  color: var(--blue-900);
  border: 2px solid var(--blue-900);
  background: white;
}

.btn-secondary:hover {
  background: #f1f5fc;
  box-shadow: 0 12px 25px rgba(6, 43, 112, .10);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 27px 0;
  color: #8994a8;
}

.divider span {
  height: 1px;
  background: #dde4ef;
}

.divider p {
  margin: 0;
  font-size: .88rem;
}

.form-message {
  min-height: 20px;
  margin-top: 18px;
  text-align: center;
  font-size: .88rem;
  font-weight: 700;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 25px 30px;
  color: white;
  background: linear-gradient(135deg, var(--blue-900), #0b408d);
}

.security-note svg {
  flex: 0 0 auto;
}

.security-note div {
  display: grid;
  gap: 3px;
}

.security-note strong {
  font-size: .92rem;
}

.security-note span {
  color: rgba(255,255,255,.72);
  font-size: .82rem;
}

/* TABLET */
@media (max-width: 1050px) {
  .login-page {
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  }

  .hero__content {
    padding: 42px;
  }

  .benefits {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .benefit {
    padding: 9px 0;
    border-right: 0;
  }
}

/* MÓVIL */
@media (max-width: 820px) {
  body {
    background: #eef3fb;
  }

  .login-page {
    display: block;
    min-height: 100vh;
    overflow: visible;
  }

  .hero {
    min-height: 330px;
    background-position: center 45%;
  }

  .hero__content {
    min-height: 330px;
    padding: 26px 22px 58px;
  }

  .hero__logo {
    width: 210px;
    padding: 9px 12px;
    border-radius: 12px;
  }

  .hero__message {
    margin-top: 52px;
  }

  .hero__eyebrow,
  .hero h1 {
    font-size: clamp(1.7rem, 8vw, 2.5rem);
  }

  .hero__description {
    max-width: 440px;
    font-size: .98rem;
  }

  .hero__line {
    margin: 18px 0;
  }

  .benefits {
    display: none;
  }

  .login-panel {
    min-height: auto;
    margin-top: -35px;
    padding: 0 14px 28px;
    background: transparent;
  }

  .login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    border-radius: 24px;
  }

  .login-card__brand {
    padding-top: 24px;
  }

  .brand-mark {
    width: 88px;
    height: 88px;
  }

  .login-card__header {
    padding: 20px 24px 4px;
  }

  .login-form {
    padding: 24px 24px 30px;
  }
}

@media (max-width: 520px) {
  .hero {
    min-height: 290px;
  }

  .hero__content {
    min-height: 290px;
  }

  .hero__message {
    margin-top: 38px;
  }

  .hero__description {
    display: none;
  }

  .form-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .input-wrap input,
  .btn {
    min-height: 54px;
  }

  .security-note {
    padding: 21px 20px;
  }
}

/* REDUCIR ANIMACIONES POR ACCESIBILIDAD */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
