:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #ffffff;
  --ink: #162124;
  --muted: #66716d;
  --line: #d8ddd6;
  --green: #166a4c;
  --green-strong: #0f4f3a;
  --blue: #236b9a;
  --coral: #bd5148;
  --amber: #a66c16;
  --soft-green: #e8f5ee;
  --soft-blue: #e8f2f8;
  --soft-red: #fdeceb;
  --shadow: 0 24px 70px rgba(22, 33, 36, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background:
    linear-gradient(rgba(35, 107, 154, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 106, 76, 0.055) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--ink);
}

body:has(.login-shell) {
  overflow: hidden;
}

body:has(.email-auth:not([hidden])) {
  overflow: auto;
}

button,
a {
  font: inherit;
}

a {
  color: var(--green-strong);
  font-weight: 800;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  min-height: 100svh;
  max-height: 100svh;
}

.login-shell:has(.email-auth:not([hidden])) {
  max-height: none;
}

.login-hero {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(150px, 1fr);
  align-content: start;
  row-gap: clamp(24px, 5vh, 44px);
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(20px, 4vw, 54px);
  background: #f8faf7;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-size: 15px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #b9d6c8;
  border-radius: 8px;
  background: var(--soft-green);
  color: var(--green-strong);
  font-weight: 900;
}

.login-copy {
  position: relative;
  display: grid;
  gap: 14px;
  align-self: start;
  max-width: 690px;
  padding: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  margin: 0;
  border: 1px solid rgba(22, 106, 76, 0.18);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(232, 245, 238, 0.72);
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 690px;
  margin-bottom: 0;
  font-size: clamp(44px, 5.4vw, 68px);
  line-height: 1.01;
  letter-spacing: 0;
  text-wrap: balance;
}

.lead {
  max-width: 560px;
  margin-bottom: 0;
  border-left: 3px solid rgba(22, 106, 76, 0.32);
  padding: 4px 0 4px 15px;
  color: #43514d;
  font-size: clamp(16px, 1.45vw, 18px);
  line-height: 1.48;
}

.signal-board {
  position: relative;
  align-self: start;
  min-height: 200px;
}

.signal-card {
  position: absolute;
  display: grid;
  gap: 7px;
  width: min(300px, 40vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.signal-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.signal-card strong {
  font-size: 22px;
  line-height: 1;
}

.signal-card.top {
  left: 2%;
  top: 10px;
}

.signal-card.middle {
  left: 30%;
  top: 68px;
  border-color: #c9dcf0;
}

.signal-card.bottom {
  left: 12%;
  top: 134px;
  border-color: #efd6bd;
}

.mini-bars,
.mini-row,
.sparkline {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 34px;
}

.mini-bars i,
.mini-row b,
.sparkline i {
  display: block;
  border-radius: 6px;
}

.mini-bars i {
  width: 38px;
  background: var(--green);
}

.mini-bars i:nth-child(1) {
  height: 18px;
}

.mini-bars i:nth-child(2) {
  height: 32px;
  background: var(--blue);
}

.mini-bars i:nth-child(3) {
  height: 42px;
  background: var(--coral);
}

.mini-row b {
  width: 58px;
  height: 10px;
  background: var(--soft-blue);
}

.mini-row b:nth-child(2) {
  width: 86px;
  background: var(--green);
}

.mini-row b:nth-child(3) {
  width: 44px;
  background: #eadfcf;
}

.sparkline i {
  width: 13px;
  background: var(--amber);
}

.sparkline i:nth-child(1) {
  height: 12px;
}

.sparkline i:nth-child(2) {
  height: 26px;
}

.sparkline i:nth-child(3) {
  height: 18px;
  background: var(--blue);
}

.sparkline i:nth-child(4) {
  height: 38px;
  background: var(--green);
}

.auth-surface {
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(18px, 3vw, 44px);
  background: rgba(255, 255, 255, 0.62);
  border-left: 1px solid rgba(216, 221, 214, 0.95);
  backdrop-filter: blur(12px);
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid rgba(216, 221, 214, 0.96);
  border-radius: 8px;
  padding: clamp(20px, 3.1vw, 30px);
  background: var(--panel);
  box-shadow: var(--shadow);
}

h2 {
  margin-bottom: 10px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.auth-note {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.42;
}

.google-button,
.email-toggle,
.email-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #3c4043;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0;
}

.google-button {
  width: 100%;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 16px;
}

.google-button:hover,
.email-toggle:hover,
.email-submit:hover {
  border-color: #c8d5cd;
  box-shadow: 0 8px 18px rgba(60, 64, 67, 0.12);
}

.google-button:disabled,
.email-toggle:disabled,
.email-submit:disabled,
.mode-button:disabled,
#password-reset:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.google-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.google-mark svg {
  display: block;
  width: 18px;
  height: 18px;
}

.consent-note,
.legal-links {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.consent-note {
  margin-bottom: 12px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.email-toggle {
  width: 100%;
  gap: 10px;
  margin-bottom: 12px;
  border-color: #cbded2;
  background: #f8fffb;
  color: var(--green-strong);
  font-size: 16px;
}

.email-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #b7d7c7;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
}

.email-auth {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

.email-auth[hidden] {
  display: none;
}

.auth-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  background: #f8faf7;
}

.mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.mode-button.active {
  background: #fff;
  color: var(--green-strong);
  box-shadow: 0 1px 4px rgba(18, 36, 39, 0.08);
}

.email-auth label {
  display: grid;
  gap: 6px;
  color: #43514d;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.email-auth input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd1ca;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-transform: none;
}

.email-auth input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(25, 128, 91, 0.14);
  outline: none;
}

.email-submit {
  width: 100%;
  min-height: 42px;
  border-color: #146b4d;
  background: var(--green);
  color: #fff;
  font-size: 15px;
}

.email-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.email-secondary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#password-reset {
  border: 0;
  background: transparent;
  color: var(--green-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.identity-status {
  margin-bottom: 12px;
  min-height: 38px;
  border: 1px solid #cbded2;
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--soft-green);
  color: var(--green-strong);
  font-size: 14px;
  font-weight: 780;
}

.identity-status.busy {
  border-color: #e5cf9e;
  background: #fff5db;
  color: #75500e;
}

.identity-status.error {
  border-color: #f0b8b2;
  background: var(--soft-red);
  color: #96332d;
}

.setup-panel {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border: 1px solid #f0b8b2;
  border-radius: 8px;
  padding: 12px;
  background: var(--soft-red);
  color: #63302b;
  font-size: 14px;
  line-height: 1.45;
}

.legal-links {
  margin-top: 14px;
}

@media (max-width: 920px) {
  body:has(.login-shell) {
    overflow: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .login-hero {
    min-height: auto;
    grid-template-rows: auto auto auto;
    padding-bottom: 20px;
  }

  .login-copy {
    padding: 42px 0 24px;
  }

  .signal-board {
    min-height: 235px;
  }

  .signal-card {
    width: min(310px, 76vw);
  }

  .auth-surface {
    min-height: auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-height: 760px) and (min-width: 921px) {
  .login-hero {
    grid-template-rows: auto auto 150px;
    row-gap: 20px;
  }

  h1 {
    font-size: clamp(40px, 5vw, 58px);
  }

  .lead {
    font-size: clamp(15px, 1.25vw, 17px);
  }

  .signal-board {
    min-height: 150px;
  }

}

@media (max-width: 560px) {
  .login-hero,
  .auth-surface {
    padding: 18px;
  }

  .login-hero {
    gap: 22px;
  }

  .login-copy {
    padding: 28px 0 0;
  }

  h1 {
    font-size: 36px;
    line-height: 1.02;
  }

  h2 {
    font-size: 28px;
  }

  .lead {
    max-width: none;
    font-size: 15px;
  }

  .signal-board {
    display: none;
  }

  .email-secondary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.policy-page {
  overflow: auto;
}

.policy-shell {
  display: grid;
  gap: 28px;
  width: min(100% - 32px, 860px);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 58px) 0;
}

.policy-card {
  display: grid;
  gap: 20px;
  border: 1px solid rgba(216, 221, 214, 0.96);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 44px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.policy-card h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(36px, 6vw, 58px);
}

.policy-card .lead {
  margin-bottom: 6px;
}

.policy-card section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.policy-card section h2 {
  margin-bottom: 0;
  font-size: 21px;
}

.policy-card section p {
  margin-bottom: 0;
  color: #43514d;
  font-size: 16px;
  line-height: 1.55;
}
