/* Sign-in page: identity panel over the depot photo, form panel beside it (stacked below 900px). */

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  background: var(--card);
  color: var(--text);
}

/* Identity panel: always dark over the photo, in both themes. */
.login-hero {
  flex: 1.25 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px clamp(32px, 5vw, 72px);
  color: #ffffff;
  background-color: #0b2545;
  background-image: linear-gradient(180deg, rgba(6, 18, 31, 0.62) 0%, rgba(11, 37, 69, 0.78) 55%, rgba(6, 18, 31, 0.92) 100%),
    url('/assets/login-bg.jpg');
  background-position: center;
  background-size: cover;
}

.login-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-crest {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  object-fit: contain;
}

.login-identity-rule {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.35);
}

.login-identity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-gov {
  font-size: 15px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}

.login-dept {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.login-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}

.login-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ec5f0;
}

.login-title {
  margin: 0;
  font-size: clamp(32px, 3.2vw, 44px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.login-lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

/* Form panel */
.login-panel {
  flex: 1 1 0;
  min-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--card);
}

.login-form-wrap {
  width: 100%;
  max-width: 384px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-heading {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.login-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap .field-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 14px;
}

.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--muted-2);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--card);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Room for the show/hide button, also while the password is shown as text. */
.login-field #login-password {
  padding-right: 50px;
}

.login-field input::placeholder {
  color: var(--muted);
}

.login-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.login-toggle-pass {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.login-toggle-pass:hover {
  color: var(--text);
}

.login-toggle-pass:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.login-btn {
  width: 100%;
  /* Fixed height: the busy state adds a spinner without resizing the button. */
  height: 48px;
  margin-top: 6px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fill-brand);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.login-btn:hover:not(:disabled) {
  background: var(--fill-brand-hover);
}

.login-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.login-btn [hidden] { display: none; }
.login-btn-spinner { margin: 0; border-color: rgba(255, 255, 255, 0.35); border-top-color: #ffffff; }

.login-help {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}

.login-err {
  display: none;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
  align-items: center;
  gap: 8px;
}

.login-err.show {
  display: flex;
}

.login-err i {
  font-size: 14px;
  flex: none;
}

/* Tablets and phones: the photo becomes a band above the form. */
@media (max-width: 900px) {
  .login-screen {
    flex-direction: column;
  }

  .login-hero {
    flex: none;
    gap: 28px;
    padding: 24px 20px 26px;
    /* The band is at most 900px wide: a smaller copy of the photo. */
    background-image: linear-gradient(180deg, rgba(6, 18, 31, 0.62) 0%, rgba(11, 37, 69, 0.78) 55%, rgba(6, 18, 31, 0.92) 100%),
      url('/assets/login-bg-900.jpg');
  }

  .login-crest {
    width: 44px;
    height: 44px;
  }

  .login-gov {
    font-size: 13px;
  }

  .login-dept {
    font-size: 14px;
  }

  .login-hero-copy {
    gap: 8px;
  }

  .login-eyebrow {
    font-size: 11px;
  }

  .login-title {
    font-size: 26px;
    line-height: 1.18;
  }

  .login-lede {
    display: none;
  }

  .login-panel {
    flex: 1 0 auto;
    min-width: 0;
    align-items: flex-start;
    padding: 28px 20px 32px;
  }

  .login-form-wrap {
    gap: 22px;
  }

  .login-heading {
    font-size: 22px;
  }

  .login-desc {
    font-size: 14px;
  }

  /* 16px inputs stop iOS from zooming into the field on focus. */
  .login-field input {
    font-size: 16px;
  }

  /* While the on-screen keyboard is up (.is-compact, set by page.js on focus and cleared once the
     keyboard has closed), it covers the lower half of the screen: the band keeps only the
     identity row and the intro shrinks to its heading, so both fields and Sign in fit above the
     keyboard on phones 360px wide and up. */
  .login-screen.is-compact .login-hero-copy,
  .login-screen.is-compact .login-desc {
    display: none;
  }

  .login-screen.is-compact .login-panel {
    padding-top: 18px;
  }

  .login-screen.is-compact .login-form-wrap {
    gap: 16px;
  }
}
