:root {
  color-scheme: light;
  --green: #009b3a;
  --green-dark: #007d2f;
  --green-soft: #f0fdf4;
  --green-border: #dcfce7;
  --green-border-strong: #86efac;
  --graphite: #1a202c;
  --muted: #5f6b7a;
  --line: #e4e9e5;
  --danger: #b42318;
  --danger-bg: #fff5f4;
  --success: #067647;
  --white: #ffffff;
  --shadow: 0 22px 60px rgb(21 52 34 / 10%);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--graphite);
  background: var(--green-soft);
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
  min-height: 100vh;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(32px, 7vw, 88px) clamp(28px, 7vw, 96px);
  color: var(--white);
  background:
    radial-gradient(circle at 15% 15%, rgb(255 255 255 / 12%), transparent 32%),
    linear-gradient(145deg, #006f2d 0%, var(--green) 55%, #00b645 100%);
}

.brand-lockup { display: inline-flex; flex-direction: column; width: fit-content; }
.brand-wordmark { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: 0.08em; line-height: 1; }
.brand-caption { margin-top: 9px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; opacity: 0.88; }
.brand-copy { max-width: 560px; }
.brand-copy h1 { max-width: 520px; margin: 16px 0; font-size: clamp(2rem, 4.3vw, 4.25rem); line-height: 1.04; letter-spacing: -0.045em; }
.brand-copy p:not(.eyebrow) { max-width: 450px; margin: 0; color: rgb(255 255 255 / 82%); font-size: 1rem; line-height: 1.7; }
.brand-footer { display: grid; gap: 8px; color: rgb(255 255 255 / 78%); font-size: 0.82rem; }
.brand-footer p { margin: 0 0 3px; color: var(--white); font-weight: 700; }
.brand-footer a { width: fit-content; text-decoration: none; }
.brand-footer a:hover { text-decoration: underline; }

.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 44px clamp(24px, 7vw, 104px); background: var(--white); }
.login-card { width: min(100%, 460px); margin: 0 auto; }
.eyebrow { margin: 0; color: var(--green-dark); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.login-heading h2, .recovery-modal h2 { margin: 10px 0 8px; color: var(--graphite); font-size: clamp(1.85rem, 3vw, 2.35rem); letter-spacing: -0.04em; }
.login-heading > p:not(.eyebrow), .modal-description { margin: 0 0 34px; color: var(--muted); line-height: 1.6; }

.field-group { margin-bottom: 20px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
label { display: block; margin-bottom: 8px; color: var(--graphite); font-size: 0.85rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 15px;
  color: var(--graphite);
  background: var(--white);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
input::placeholder { color: #9aa5b1; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgb(0 155 58 / 13%); }
input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
.password-toggle, .modal-close { display: inline-grid; place-items: center; border: 0; color: var(--muted); background: transparent; }
.password-toggle { width: 32px; height: 28px; margin: -4px -4px 0 0; }
.password-toggle:hover, .modal-close:hover { color: var(--green-dark); }
.password-toggle svg, .modal-close svg { width: 19px; height: 19px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.field-error { min-height: 18px; margin: 6px 0 0; color: var(--danger); font-size: 0.76rem; }

.form-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 2px 0 22px; }
.check-option { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.check-option input { width: 16px; height: 16px; accent-color: var(--green); }
.text-button { border: 0; padding: 0; color: var(--green-dark); background: transparent; font-size: 0.8rem; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.form-feedback { min-height: 22px; margin-bottom: 12px; color: var(--danger); font-size: 0.82rem; line-height: 1.45; }
.form-feedback.success { color: var(--success); }
.primary-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; border: 1px solid var(--green); border-radius: 12px; padding: 13px 18px; color: var(--white); background: var(--green); font-weight: 700; transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.primary-button:hover { background: var(--green-dark); box-shadow: 0 12px 22px rgb(0 125 47 / 18%); transform: translateY(-1px); }
.primary-button:focus-visible, .text-button:focus-visible, .password-toggle:focus-visible, .modal-close:focus-visible { outline: 3px solid rgb(0 155 58 / 28%); outline-offset: 3px; }
.primary-button:disabled { cursor: wait; opacity: 0.72; transform: none; }
.button-loader { display: none; width: 18px; height: 18px; border: 2px solid rgb(255 255 255 / 42%); border-top-color: var(--white); border-radius: 50%; animation: spin 700ms linear infinite; }
.primary-button.is-loading .button-label { display: none; }
.primary-button.is-loading .button-loader { display: block; }
.security-note { margin: 24px 0 0; color: #7b8794; font-size: 0.74rem; line-height: 1.55; text-align: center; }
.contact-footer { width: min(100%, 700px); margin: 42px auto 0; color: #7b8794; font-size: 0.72rem; line-height: 1.6; text-align: center; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 4px; }
.contact-links a { color: var(--green-dark); text-decoration: none; }
.contact-links a:hover { text-decoration: underline; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(26 32 44 / 42%); backdrop-filter: blur(6px); z-index: 10; }
.modal-backdrop[hidden] { display: none; }
.recovery-modal { position: relative; width: min(100%, 440px); border: 1px solid var(--green-border); border-radius: 20px; padding: 34px; background: var(--white); box-shadow: var(--shadow); animation: modal-in 180ms ease-out both; }
.modal-close { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 9px; }
.modal-close:hover { background: var(--green-soft); }
.modal-description { margin-bottom: 24px; font-size: 0.88rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 360px; padding: 38px 28px; }
  .brand-copy h1 { font-size: clamp(2rem, 9vw, 3.4rem); }
  .brand-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  .brand-footer p { width: 100%; }
  .auth-panel { padding: 48px 24px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
