:root {
  color-scheme: light;
  --ink: #17202e;
  --muted: #667085;
  --line: #d9e0e7;
  --accent: #06bf52;
  --accent-strong: #047a35;
  --accent-soft: #eafbf0;
  --accent-border: #a9e9bd;
  --accent-ink: #052e16;
  --brand-gradient: linear-gradient(145deg, #48e782 0%, #06bf52 54%, #047a35 100%);
  --danger: #b42318;
  --danger-soft: #fff2f0;
  --warning: #8a5a00;
  --warning-soft: #fff8e1;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  background: #f8fafb;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button { cursor: pointer; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(390px, .9fr) minmax(520px, 1.1fr);
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  background:
    radial-gradient(circle at 88% 12%, rgba(72, 231, 130, .24), transparent 25%),
    radial-gradient(circle at 10% 94%, rgba(6, 191, 82, .2), transparent 30%),
    linear-gradient(145deg, #0f1d15 0%, #102a1b 54%, #0d3d22 100%);
  color: #f8fffe;
}

.brand-panel::after {
  position: absolute;
  z-index: -1;
  right: -110px;
  bottom: -160px;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(112, 233, 160, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 58px rgba(112, 233, 160, .04), 0 0 0 116px rgba(112, 233, 160, .022);
  content: "";
}

.brand-lockup,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--brand-gradient);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 8px 24px rgba(0,0,0,.18);
}

.brand-lockup strong,
.brand-lockup small { display: block; }
.brand-lockup strong { font-size: 1rem; letter-spacing: -.01em; }
.brand-lockup small { margin-top: 2px; color: #9fb5b5; font-size: .72rem; }

.brand-message {
  max-width: 580px;
  margin: auto 0;
  padding: clamp(70px, 11vh, 140px) 0 54px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #70e9a0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.brand-message h1 {
  max-width: 540px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 4.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.brand-message > p:last-child {
  max-width: 520px;
  margin: 28px 0 0;
  color: #b8cac9;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.65;
}

.environment-card {
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 430px;
  padding: 15px 17px;
  border: 1px solid rgba(112, 233, 160, .18);
  border-radius: 12px;
  background: rgba(5, 25, 27, .38);
  backdrop-filter: blur(8px);
}

.environment-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(6, 191, 82, .14);
  color: #70e9a0;
}

.environment-card strong,
.environment-card span { display: block; }
.environment-card strong { font-size: .82rem; }
.environment-card div span { margin-top: 3px; color: #98b0af; font-size: .72rem; }

.brand-footer {
  margin: 24px 0 0;
  color: #728e8d;
  font-size: .7rem;
}

.form-panel {
  display: grid;
  place-items: center;
  padding: clamp(26px, 6vw, 92px);
  background: #f7f6f3;
}

.form-wrap { width: min(100%, 440px); }
.mobile-brand { display: none; margin-bottom: 50px; }
.mobile-brand strong { font-size: .95rem; }

.form-heading { margin-bottom: 34px; }
.form-heading .eyebrow { color: var(--accent-strong); }
.form-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 2.65rem);
  letter-spacing: -.045em;
}
.form-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.55;
}

#login-form, #otp-form { display: grid; gap: 22px; }

.field { display: grid; gap: 8px; }
.field > label { font-size: .82rem; font-weight: 750; }
.field small { color: var(--muted); font-size: .71rem; line-height: 1.45; }

.field input {
  width: 100%;
  height: 50px;
  border: 1px solid #cbd5df;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:hover { border-color: #9ca9b7; }
.field input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(6, 191, 82, .14);
}
.field input[aria-invalid="true"] { border-color: var(--danger); }

.password-control { position: relative; display: block; }
.password-control input { padding-right: 74px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 56px;
  min-height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-strong);
  font-size: .75rem;
  font-weight: 750;
}
.password-toggle:hover { background: var(--accent-soft); }
.password-toggle:focus-visible,
.sign-in-button:focus-visible,
.account-help summary:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.form-error,
.session-message {
  border: 1px solid #f0c0ba;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 12px 14px;
  font-size: .78rem;
  line-height: 1.5;
}

.form-error.locked {
  border-color: #ead79e;
  background: var(--warning-soft);
  color: var(--warning);
}

.session-message {
  margin: -12px 0 24px;
  border-color: #b8e2d7;
  background: #effaf7;
  color: #087565;
}

.sign-in-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--brand-gradient);
  color: var(--accent-ink);
  padding: 0 17px;
  font-weight: 750;
  box-shadow: 0 8px 20px rgba(6, 191, 82, .2);
}
.sign-in-button:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
.sign-in-button:disabled { cursor: wait; opacity: .72; }
.button-arrow { font-size: 1.1rem; transition: transform .15s ease; }
.sign-in-button:hover .button-arrow { transform: translateX(3px); }

.account-help {
  margin-top: 21px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.55;
}
.account-help summary {
  width: fit-content;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}
.account-help summary::-webkit-details-marker { display: none; }
.account-help p {
  margin: 12px 0 0;
  border-left: 2px solid #bdded8;
  padding-left: 12px;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #7a8493;
  font-size: .69rem;
  line-height: 1.45;
}
.security-note > span { color: var(--accent-strong); font-size: 1rem; }
.security-note p { margin: 0; }
.security-note strong { color: #4b5565; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; }
  .mobile-brand { display: flex; }
}

@media (max-width: 540px) {
  .form-panel { place-items: start stretch; padding: 28px 22px 36px; }
  .form-wrap { margin: auto 0; }
  .mobile-brand { margin-bottom: 44px; }
  .form-heading { margin-bottom: 28px; }
  .security-note { margin-top: 38px; }
}

[hidden] { display: none !important; }

.otp-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.otp-actions button { padding: 10px 12px; border: 1px solid #cdd5df; border-radius: 8px; background: white; color: #334155; cursor: pointer; font: inherit; }
.otp-actions button:disabled { opacity: .55; cursor: not-allowed; }
#otp-code { letter-spacing: .25em; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
