.screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 100dvh (where supported) tracks the real visible viewport on mobile
     browsers, which shrinks/grows as the address bar hides — 100vh alone
     doesn't, and can leave the page just a few px taller than the screen,
     triggering an unwanted scrollbar. */
  min-height: 100vh;
  min-height: 100dvh;
}

/* LEFT — brand panel */
.brand-panel {
  background: linear-gradient(160deg, var(--navy), #17325a);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(111, 168, 255, 0.16), transparent 45%),
    linear-gradient(160deg, var(--navy), #17325a);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  /* Pinned to the viewport and sized to it, independent of the grid row's
     height — otherwise a tall form (e.g. signup's 5 fields) stretches the
     shared row, and this panel's own (vertically centered) content ends up
     partly below the fold since there's only one page-level scrollbar. */
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
}
.brand-panel .logo {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 28px;
}
.brand-panel .logo span {
  color: #6fa8ff;
}
.brand-panel .logo-img {
  height: 94px;
  width: auto;
}
.brand-panel h2 {
  color: #fff;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: 380px;
  margin-bottom: 16px;
}
.brand-panel p {
  color: #aebbcf;
  max-width: 360px;
  font-size: 0.95rem;
}
.brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 44px;
}
.brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d7e0ef;
  font-size: 0.92rem;
  font-weight: 600;
}
.brand-feature svg {
  width: 20px;
  height: 20px;
  stroke: #6fa8ff;
  flex-shrink: 0;
}

/* RIGHT — form panel */
.form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Less vertical padding than before — the Turnstile widget's height varies
     between its loading and resolved states, and the extra margin here
     keeps that shift from tipping the page into an unwanted scrollbar. */
  padding: 16px 40px;
  background: var(--bg);
}
.back-to-site-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 14px;
}
.back-to-site-link:hover {
  color: var(--blue);
}
.mobile-brand-bar {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 18px;
}
.mobile-brand-bar .logo-img {
  height: 28px;
  width: auto;
}
.form-card {
  width: 100%;
  max-width: 380px;
}
.form-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-card .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.field {
  margin-bottom: 13px;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.forgot-password-link {
  font-size: 0.78rem;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.forgot-password-link:hover {
  text-decoration: underline;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--blue);
}
.password-requirements {
  list-style: disc;
  margin: 6px 0 0 18px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  stroke: var(--text-muted);
  pointer-events: none;
}
.field input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-size: 0.92rem;
  background: #fff;
}
#password {
  padding-right: 42px;
}
.field input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}
.toggle-password {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.toggle-password svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.toggle-password:hover {
  color: var(--blue-dark);
}
.toggle-password.is-showing {
  color: var(--blue-dark);
}

.submit-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  border: 1px solid #000;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 36, 64, 0.18);
  transition:
    background 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.submit-btn:hover {
  background: var(--navy-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 36, 64, 0.28);
}
.submit-btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}
.back-link:hover {
  color: var(--blue);
}
.link-btn {
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  margin-top: 8px;
}


@media (max-width: 860px) {
  .screen {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    display: none;
  }
  .mobile-brand-bar {
    display: inline-flex;
  }
  /* Tighter vertical spacing on small screens only — same content, less
     wasted space between sections, so there's less to scroll through. */
  .form-card .subtitle {
    margin-bottom: 14px;
  }
  .oauth-divider {
    margin: 10px 0;
  }
  .field {
    margin-bottom: 10px;
  }
  .turnstile-wrap {
    margin-bottom: 8px;
  }
  .back-link,
  .back-to-site-link {
    margin-top: 10px;
  }
}
.back-link a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.back-link a:hover {
  text-decoration: underline;
}
.optional-tag {
  font-weight: 400;
  color: var(--text-muted);
}
