:root {
  --green: #a9e3a2;
  --green-strong: #55a95b;
  --green-dark: #285f31;
  --green-pale: #e9f7e7;
  --cream: #fbfdf9;
  --white: #ffffff;
  --ink: #1f3d25;
  --muted: #6e8171;
  --line: #dceadb;
}

html[data-theme="dark"] {
  --green: #263f2b;
  --green-strong: #8dce8b;
  --green-dark: #a9e3a2;
  --green-pale: #304c35;
  --cream: #101411;
  --white: #171c18;
  --ink: #ffffff;
  --muted: #a4b5a6;
  --line: rgba(169, 227, 162, 0.18);
}

* { box-sizing: border-box; }

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Archivo", sans-serif;
}

.welcome-page {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  place-items: center;
  background: linear-gradient(to bottom, var(--white) 0 40%, var(--green) 40% 100%);
  isolation: isolate;
}

.brand-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -150px;
  bottom: -190px;
  width: 500px;
  height: 500px;
  border: 70px solid rgba(255, 255, 255, 0.13);
  border-radius: 44%;
  transform: rotate(18deg);
}

.brand-logo {
  position: absolute;
  z-index: 2;
  top: 18%;
  left: 50%;
  width: min(300px, 45vw);
  height: auto;
  transform: translateX(-50%);
}

.brand-copy {
  align-self: end;
  z-index: 2;
  width: min(660px, calc(100% - 72px));
  padding-bottom: 70px;
  color: var(--white);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5.4vw, 5.6rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.brand-copy > p:last-child {
  max-width: 570px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.65;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  padding: 56px;
  place-items: center;
  background: var(--cream);
}

.login-inner {
  width: min(430px, 100%);
  animation: content-in 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  margin-bottom: 40px;
  place-items: center;
  border-radius: 16px;
  background: var(--green);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 900;
}

.eyebrow.green { color: var(--green-strong); }

.login-inner h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.login-copy {
  max-width: 390px;
  margin: 20px 0 34px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  margin-top: 7px;
  color: var(--green-dark);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 15px;
  outline: 0;
  background: var(--white);
  color: var(--ink);
  font: 700 0.82rem "Archivo", sans-serif;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input::placeholder { color: #9aab9c; }

.login-form input:focus {
  border-color: var(--green-strong);
  box-shadow: 0 0 0 4px rgba(169, 227, 162, 0.28);
}

.form-message {
  min-height: 1.2em;
  margin: 0 0 8px;
  color: var(--green-strong);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.5;
}

.continue-button.is-loading span::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 9px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 650ms linear infinite;
}

.continue-button {
  display: grid;
  width: 100%;
  min-height: 54px;
  place-items: center;
  border-radius: 15px;
  font: 900 0.7rem "Archivo", sans-serif;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.continue-button {
  margin-top: 8px;
  border: 0;
  background: var(--green-strong);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 8px 0 #3f8c48;
}

.continue-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.continue-button:hover,
.continue-button:focus-visible {
  outline: 0;
  transform: translateY(-2px);
}

.continue-button:active { transform: translateY(4px); box-shadow: 0 4px 0 #3f8c48; }

html[data-theme="dark"] .continue-button {
  color: #fff;
  box-shadow: 0 8px 0 #5d9f61;
}

html[data-theme="dark"] .continue-button:active { box-shadow: 0 4px 0 #5d9f61; }

html[data-theme="dark"] .brand-panel::after { border-color: rgba(169, 227, 162, 0.08); }

html[data-theme="dark"] .brand-copy { color: #fff; }

html[data-theme="dark"] .login-form input { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }

@keyframes content-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes button-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .login-inner { animation: none; }
}

.trust-note {
  margin: 28px 0 0;
  color: #8a9b8d;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
}

.legal-links a {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .welcome-page { grid-template-columns: 1fr; }
  .brand-panel { min-height: 570px; }
  .brand-logo { top: 65px; width: 240px; }
  .brand-copy { padding-bottom: 48px; }
  .login-panel { min-height: auto; padding: 72px 28px; }
}

@media (max-width: 520px) {
  .brand-panel { min-height: 510px; background: linear-gradient(to bottom, var(--white) 0 39%, var(--green) 39% 100%); }
  .brand-logo { top: 54px; width: 190px; }
  .brand-copy { width: calc(100% - 36px); padding-bottom: 36px; }
  .brand-copy h1 { font-size: 2.65rem; }
  .brand-copy > p:last-child { font-size: 0.82rem; }
  .login-panel { padding: 58px 20px; }
  .welcome-mark { margin-bottom: 30px; }
}
