/*
 * Login page — split layout (welcome + account form on the left, clinical
 * image on the right). Reuses shared tokens and the .field / .btn components;
 * only page-specific structure lives here.
 */

.login {
  position: relative;
  isolation: isolate;
  overflow: hidden; /* contain the decorative glow */
  padding-block: clamp(1.5rem, 4vw, 3.5rem) var(--section-gap);
}

/* Soft mint glow + top-to-bottom wash, mirroring the site's ambient background. */
.login::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(80% 55% at 50% 82%, rgba(198, 231, 224, 0.55) 0%, rgba(210, 228, 236, 0.24) 44%, rgba(253, 253, 253, 0) 72%),
    linear-gradient(180deg, var(--color-surface) 0%, rgba(212, 221, 227, 0.35) 100%);
}

.login__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(var(--space-6), 5vw, var(--space-10));
}

/* ---- Left column: form panel ---- */
.login-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  max-width: 27rem;
}

.login-head {
  display: grid;
  gap: var(--space-4);
}

.login-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  color: var(--color-muted);
}

.login-intro {
  font-size: var(--fs-sm);
  color: var(--color-text);
  max-width: 100%;
}


.login-form {
  display: grid;
  gap: var(--space-4);
}

/* Base .field__input only stretches inside a flex row; here fields are stacked. */
.login-form .field__input {
  width: 100%;
}

/* Custom-styled select with a token-coloured chevron, matching the design. */
.login-select {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.75rem;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%238a9091" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  cursor: pointer;
}

/* Muted placeholder state until a real option is picked. */
.login-select:required:invalid {
  color: var(--color-text-soft);
}

.login-select option {
  color: var(--color-ink);
}

.login-form__submit {
  margin-top: var(--space-3);
}

.login-alt {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.login-alt a {
  font-weight: var(--fw-semibold);
  text-decoration: underline;
}

.login-legal {
  margin-top: auto;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-soft);
}

.login-legal a {
  text-decoration: underline;
}

/* ---- Right column: clinical image ---- */
.login-media {
  position: relative;
  margin: 0;
  margin-left: auto;
  width: 100%;
  max-width: 34rem;
  aspect-ratio: 712 / 905;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface-alt);
  box-shadow: var(--shadow-card);
}

.login-media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

/* Bottom scrim so the caption stays legible over the photo. */
.login-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(5, 6, 7, 0.45) 0%, rgba(5, 6, 7, 0) 32%);
}

.login-media__caption {
  position: absolute;
  z-index: 1; /* above the scrim pseudo-element */
  right: var(--space-6);
  bottom: var(--space-5);
  max-width: 60%;
  text-align: right;
  color: var(--color-invert);
  font-size: var(--fs-sm);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* ---- Responsive: stack the split, matching the site's breakpoints ---- */
@media (max-width: 820px) {
  .login__grid {
    grid-template-columns: 1fr;
    gap: clamp(var(--space-6), 7vw, var(--space-8));
  }

  .login-panel {
    max-width: 32rem;
    margin-inline: auto;
  }

  .login-media {
    order: -1; /* image leads on narrow screens */
    margin-inline: auto;
    max-width: 32rem;
    aspect-ratio: 16 / 11;
    max-height: 420px;
  }
}

@media (max-width: 520px) {
  .login-media {
    aspect-ratio: 4 / 3;
  }
}
