/* Log in / create password / forgot password. Standalone page (no sidebar). */

:root:has(.lg-page) {
  scrollbar-gutter: auto;
}

.lg-page {
  min-height: 100%;
  background: var(--surface);
}

.lg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Photo panel ---------- */

.lg-brand {
  position: relative;
  overflow: hidden;
  background: #8E9096;
}

.lg-brand-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.lg-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 23, 65, 0.82) 0%, rgba(22, 23, 65, 0.45) 28%, rgba(22, 23, 65, 0) 55%);
  pointer-events: none;
}

.lg-caption {
  position: absolute;
  z-index: 1;
  left: 56px;
  right: 56px;
  bottom: 56px;
  margin: 0;
  max-width: 440px;
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.18;
  color: #fff;
}

/* ---------- Form panel ---------- */

.lg-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.lg-card {
  width: 100%;
  max-width: 400px;
}

.lg-logo {
  display: block;
  height: 26px;
  width: auto;
  max-width: 100%;
  margin-bottom: 40px;
}

.lg-step {
  display: flex;
  flex-direction: column;
}

.lg-step[hidden] {
  display: none;
}

.lg-step h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 8px;
}

.lg-lead {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 24px;
}

.lg-lead strong {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.lg-step .modal-field {
  margin: 0 0 18px;
}

.lg-bigicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(108, 96, 170, 0.12);
  color: var(--purple);
  margin-bottom: 20px;
}

.lg-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.lg-submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

/* ---------- Fields ---------- */

.lg-step .modal-field input.has-error {
  border-color: var(--danger);
  background: #FFF8F8;
}

.lg-error {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--danger);
}

.lg-error[hidden] {
  display: none;
}

.lg-pw {
  position: relative;
}

.lg-pw input {
  padding-right: 46px;
}

.lg-pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.lg-pw-toggle:hover {
  color: var(--navy);
  background: var(--border);
}

.lg-pw-toggle.is-on {
  color: var(--purple);
}

.lg-rules {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lg-rules li {
  position: relative;
  padding-left: 22px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.lg-rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  box-sizing: border-box;
}

.lg-rules li.is-met {
  color: #2C7A76;
}

.lg-rules li.is-met::before {
  border-color: var(--teal);
  background: var(--teal);
}

/* ---------- Links / helper rows ---------- */

.lg-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
  text-decoration: none;
}

.lg-link:hover {
  color: var(--purple-dark);
  text-decoration: underline;
}

.lg-link:disabled {
  color: var(--ink-faint);
  cursor: default;
  text-decoration: none;
}

.lg-row-end {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 18px;
}

.lg-who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.lg-who span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lg-who .lg-link {
  flex-shrink: 0;
}

.lg-back {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  align-self: flex-start;
  margin-top: 20px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}

.lg-back:hover {
  color: var(--navy);
}

.lg-resend {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.lg-demo-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.lg-demo-link[hidden] {
  display: none;
}

.lg-demo-link > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Banners / alerts ---------- */

.lg-banner {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(103, 199, 195, 0.16);
  color: #1F6B67;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

.lg-banner[hidden] {
  display: none;
}

.lg-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(253, 181, 21, 0.14);
  border: 1px solid rgba(253, 181, 21, 0.5);
}

.lg-alert[hidden] {
  display: none;
}

.lg-alert-icon {
  flex-shrink: 0;
  color: #8A5A00;
  margin-top: 1px;
}

.lg-alert p {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  color: #5E3E00;
}

/* ---------- Demo accounts ---------- */

.lg-demo {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-muted);
}

.lg-demo summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-faint);
}

.lg-demo ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lg-demo li {
  line-height: 1.45;
}

.lg-demo button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
  overflow-wrap: anywhere;
  text-align: left;
}

.lg-demo button:hover {
  text-decoration: underline;
}

.lg-demo small {
  display: block;
  color: var(--ink-faint);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .lg-layout {
    grid-template-columns: 1fr;
  }

  .lg-brand {
    display: none;
  }

  .lg-main {
    align-items: flex-start;
    padding: 40px 24px 56px;
  }
}
