/* ==========================================================
   VARIABLES
   ========================================================== */
:root {
  --blue: #2046e8;
  --blue-dark: #1a39c0;
  --navy: #0b1a5e;
  --text: #0b1a5e;
  --placeholder: #bdbdbd;
  --border: #b8b8b8;
  --border-hover: #2046e8;
  --disabled-bg: #bdbdbd;
  --disabled-text: #757575;
  --social-hover-bg: #f3f5ff;
  --footer-bg: #eef2fb;
  --white: #ffffff;

  --header-h: 56px;
  --form-w: 349px;
  --font: "Poppins", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================
   RESET
   ========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* ==========================================================
   ENCABEZADO
   ========================================================== */
.header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 28px 0 0;
  background: var(--blue);
}

.header__logo {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 55%;
  margin-left: 20px;
}

.header__logo img {
  height: 65%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.header__home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--white);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.header__home-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.header__home:hover {
  opacity: 0.85;
  text-decoration: none;
  text-underline-offset: 3px;
}

.header__home:focus-visible,
.header__logo:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* ==========================================================
   CONTENIDO PRINCIPAL
   ========================================================== */
.main {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 20px 48px;
  background-color: var(--white);
  background-image: url("images/background.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

.login {
  width: 100%;
  max-width: var(--form-w);
  text-align: center;
}

.login__title {
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
  color: var(--navy);
}

.login__subtitle {
  margin-top: 36px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text);
}

/* ==========================================================
   FORMULARIO
   ========================================================== */
.form {
  margin-top: 32px;
  text-align: left;
}

.form__label {
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text);
}

.form__input {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: 5px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 400;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.form__input:hover {
  border-color: #8f8f8f;
}

.form__input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32, 70, 232, 0.18);
}

/* Botón principal — estado deshabilitado por defecto */
.btn-submit {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 16px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--disabled-text);
  background: var(--disabled-bg);
  border: 0;
  border-radius: 24px;
  cursor: not-allowed;
  pointer-events: none;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

/* Estado activo: cuando el campo tiene contenido (solo CSS) */
.form:has(.form__input:not(:placeholder-shown)) .btn-submit {
  color: var(--white);
  background: var(--blue);
  cursor: pointer;
  pointer-events: auto;
}

.form:has(.form__input:not(:placeholder-shown)) .btn-submit:hover {
  background: var(--blue-dark);
}

.form:has(.form__input:not(:placeholder-shown)) .btn-submit:active {
  transform: translateY(1px);
}

.btn-submit:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ==========================================================
   REGISTRO
   ========================================================== */
.login__register {
  margin-top: 33px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text);
}

.link {
  font-weight: 600;
  color: var(--blue);
  transition: color 0.2s ease;
}

.link:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================
   SEPARADOR "O"
   ========================================================== */
.divider {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 34px;
}

.divider__line {
  flex: 1 1 0;
  height: 1px;
  background: var(--border);
}

.divider__text {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  color: var(--text);
}

/* ==========================================================
   BOTONES SOCIALES
   ========================================================== */
.social {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 37px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-social__icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.btn-social__text {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--navy);
  white-space: nowrap;
}

.btn-social:hover {
  background: var(--social-hover-bg);
  border-color: var(--border-hover);
  box-shadow: 0 2px 6px rgba(11, 26, 94, 0.12);
}

.btn-social:active {
  background: #e8ecff;
}

.btn-social:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ==========================================================
   PIE DE PÁGINA
   ========================================================== */
.footer {
  flex: 0 0 auto;
  background: var(--footer-bg);
  border-top: 1px solid #e0e6f5;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  min-height: 40px;
  margin: 0 auto;
  padding: 8px 16px;
}

.footer__copy {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  color: var(--navy);
}

.footer__logo {
  height: 16px;
  width: auto;
  object-fit: contain;
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer__links a {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  color: var(--blue);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.footer__links a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__links a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================
   RESPONSIVE — TABLET
   ========================================================== */
@media (max-width: 1024px) {
  .footer__inner {
    padding: 8px 24px;
  }
}

/* ==========================================================
   RESPONSIVE — MÓVIL GRANDE / TABLET VERTICAL
   ========================================================== */
@media (max-width: 767px) {
  .header {
    padding-right: 16px;
  }

  .main {
    padding: 24px 20px 40px;
  }

  .footer__inner {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    text-align: center;
  }

  .footer__copy {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer__links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 16px;
  }
}

/* ==========================================================
   RESPONSIVE — MÓVIL
   ========================================================== */
@media (max-width: 480px) {
  .header {
    padding-right: 12px;
  }

  .header__logo {
    max-width: 50%;
  }

  .header__home {
    gap: 6px;
    font-size: 14px;
  }

  .header__home-icon {
    width: 16px;
    height: 16px;
  }

  .main {
    padding: 24px 16px 32px;
  }

  .login__title {
    font-size: 24px;
    line-height: 30px;
  }

  .login__subtitle {
    margin-top: 28px;
  }

  .form {
    margin-top: 28px;
  }

  .btn-social {
    padding: 0 12px;
    gap: 12px;
  }

  .btn-social__text {
    font-size: 15px;
  }
}

/* ==========================================================
   RESPONSIVE — MÓVIL PEQUEÑO
   ========================================================== */
@media (max-width: 360px) {
  .header__home span {
    font-size: 13px;
  }

  .btn-social__text {
    font-size: 14px;
    white-space: normal;
    text-align: left;
    line-height: 18px;
  }
}

/* ==========================================================
   PANTALLAS MUY GRANDES (zoom bajo / monitores anchos)
   ========================================================== */
@media (min-width: 1600px) {
  .footer__inner {
    max-width: 1200px;
  }
}

/* ==========================================================
   ACCESIBILIDAD
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}