:root {
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  color: #14283a;
  background: #f5f8fb;
  font-synthesis: none;
  --green-950: #113548;
  --green-800: #307080;
  --green-200: #c6dde6;
  --green-100: #eaf2f6;
  --ink-muted: #5a6d79;
  --line: #d9e3e9;
  --white: #ffffff;
  --red: #9f3430;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell { min-height: 100vh; }
.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  color: var(--white);
  background: var(--green-950);
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.brand { display: inline-flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand img { width: auto; height: 46px; }
.brand span { display: grid; gap: 3px; }
.brand strong { font-size: 18px; }
.brand small { color: #c9d9e3; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.login-layout {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: clamp(40px, 8vw, 140px);
  align-items: center;
  padding: clamp(44px, 8vw, 110px) clamp(20px, 7vw, 120px);
  background: #f1f6f9;
}
.login-layout::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 55%;
  background: var(--green-950);
}
.login-copy { max-width: 480px; color: var(--white); }
.login-copy h1, .portal-heading h1 { margin: 8px 0 18px; font-size: clamp(42px, 6vw, 76px); line-height: 1; letter-spacing: 0; }
.login-copy p:not(.kicker) { max-width: 540px; color: #d6e2ea; font-size: 19px; line-height: 1.55; }
.project-credit {
  display: grid;
  gap: 5px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.22);
  color: #c9d9e3;
  font-size: 14px;
  line-height: 1.45;
}
.project-credit strong { color: var(--white); }
.project-credit a { color: var(--white); font-weight: 800; text-underline-offset: 3px; }
.project-credit a:hover { color: #e4eef4; }
.kicker { margin: 0; color: #2e7d9e; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-copy .kicker { color: #9fc3d6; }

.access-form {
  display: grid;
  gap: 18px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(13,67,51,.12);
}
.access-form h2 { margin: 0 0 6px; font-size: 27px; }
label { display: grid; gap: 8px; font-weight: 700; color: #35443b; }
input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #bdcbd4;
  border-radius: 6px;
  color: #14283a;
  background: var(--white);
}
input:focus { outline: 3px solid rgba(43,123,89,.18); border-color: var(--green-800); }

.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 56px; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  padding: 2px 6px;
  background: none;
  color: var(--green-800);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.form-error { min-height: 20px; margin: -2px 0; color: var(--red); font-size: 14px; }

.primary-button, .secondary-button, .quiet-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.primary-button { color: var(--white); background: var(--green-800); }
.primary-button:hover { background: var(--green-950); }
.secondary-button { color: var(--green-950); background: var(--white); border-color: #9fb5a4; }
.quiet-button { color: inherit; background: transparent; border-color: currentColor; }
.site-header .quiet-button { color: var(--white); border-color: rgba(255,255,255,.45); }

.portal-view { padding-bottom: 70px; }
.portal-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 50px;
  align-items: end;
  padding: 64px clamp(20px, 6vw, 100px) 48px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.portal-heading h1 { max-width: 900px; font-size: clamp(42px, 6vw, 68px); }
.portal-heading > div > p:last-child { max-width: 760px; margin: 0; color: var(--ink-muted); font-size: 17px; line-height: 1.55; }
.release-facts { display: grid; grid-template-columns: repeat(3, minmax(110px, auto)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.release-facts span { display: grid; gap: 5px; padding: 16px 18px; border-left: 1px solid var(--line); }
.release-facts span:first-child { border-left: 0; }
.release-facts small { color: var(--ink-muted); }

.download-band, .api-band, .release-note {
  margin: 0;
  padding: 38px clamp(20px, 6vw, 100px);
  display: grid;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}
.download-band { grid-template-columns: minmax(0, 1fr) auto; background: var(--green-100); }
.download-band h2, .api-band h2 { margin: 0 0 8px; font-size: 25px; }
.download-band p, .api-band p { margin: 0; color: var(--ink-muted); line-height: 1.55; }
.download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.download-actions a[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.instructions-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.instructions-grid > div { min-height: 235px; padding: 42px clamp(20px, 4vw, 64px); background: var(--white); border-left: 1px solid var(--line); }
.instructions-grid > div:first-child { border-left: 0; }
.instructions-grid h2 { margin: 7px 0 10px; font-size: 22px; }
.instructions-grid p:last-child { margin: 0; color: var(--ink-muted); line-height: 1.55; }
.step-number { margin: 0; color: var(--green-800); font-weight: 800; }
.open-anyway-band { display: grid; grid-template-columns: minmax(240px, .65fr) minmax(0, 1.35fr); gap: 34px 56px; padding: 42px clamp(20px, 5vw, 76px); border-bottom: 1px solid var(--line); background: #fff8e8; }
.open-anyway-heading h2 { margin: 6px 0 10px; font-size: 25px; }
.open-anyway-heading p:last-child { margin: 0; color: #655c4b; line-height: 1.55; }
.open-anyway-steps { display: grid; gap: 16px; margin: 0; padding-left: 24px; }
.open-anyway-steps li { padding-left: 6px; color: var(--green-950); }
.open-anyway-steps strong, .open-anyway-steps span { display: block; }
.open-anyway-steps span { margin-top: 4px; color: #655c4b; line-height: 1.5; }
.open-anyway-alternative { grid-column: 2; margin: -4px 0 0; padding-top: 16px; color: #655c4b; line-height: 1.5; border-top: 1px solid #ddcfaa; }

.first-launch-band { background: var(--green-100); }
.first-launch-dialog { display: block; max-width: 420px; width: 100%; border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16); }

.api-band { grid-template-columns: minmax(0, 1fr) minmax(360px, 620px); background: var(--white); }
.api-control { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.api-band .inline-message { grid-column: 1 / -1; color: var(--red); }
.privacy-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.privacy-list span { display: grid; gap: 5px; min-height: 92px; padding: 16px; color: var(--ink-muted); border-left: 1px solid var(--line); }
.privacy-list span:first-child { border-left: 0; }
.privacy-list strong { color: var(--green-950); }
.release-note { grid-template-columns: 160px minmax(0, 1fr); background: #eef3f4; }
.release-note p { margin: 0; color: #4f5d64; line-height: 1.55; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; background: var(--green-950); }
  .login-layout::before { display: none; }
  .access-form { max-width: 520px; width: 100%; }
  .portal-heading, .download-band, .api-band, .open-anyway-band { grid-template-columns: 1fr; }
  .release-facts { width: 100%; }
  .instructions-grid { grid-template-columns: 1fr; }
  .instructions-grid > div { min-height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .instructions-grid > div:first-child { border-top: 0; }
}

@media (max-width: 560px) {
  .site-header { align-items: flex-start; }
  .brand img { width: auto; height: 40px; }
  .brand strong { font-size: 16px; }
  .login-copy h1, .portal-heading h1 { font-size: 42px; }
  .access-form { padding: 24px 20px; }
  .release-facts { grid-template-columns: 1fr; }
  .release-facts span { border-left: 0; border-top: 1px solid var(--line); }
  .release-facts span:first-child { border-top: 0; }
  .download-actions, .download-actions a { width: 100%; }
  .api-control { grid-template-columns: 1fr; }
  .privacy-list { grid-template-columns: 1fr; }
  .privacy-list span { border-left: 0; border-top: 1px solid var(--line); }
  .privacy-list span:first-child { border-top: 0; }
  .release-note { grid-template-columns: 1fr; }
  .open-anyway-alternative { grid-column: 1; }
}

.not-found-layout {
  min-height: calc(100vh - 82px);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px clamp(20px, 6vw, 80px);
}

.not-found-layout h1 {
  margin: 0;
  color: var(--green-950);
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1;
}

.not-found-layout p:not(.kicker) {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.55;
}

.home-logo-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--white);
}

.home-brand {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.home-logo-layout img {
  width: clamp(200px, 24vw, 260px);
  height: auto;
}

.home-credit {
  color: var(--green-950);
  font-size: 14px;
  text-decoration: none;
}

.home-credit:hover {
  color: var(--green-800);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-login-notice {
  margin: 0;
  padding: 14px clamp(20px, 6vw, 100px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--green-100);
  color: var(--green-950);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.post-login-notice a {
  color: var(--green-800);
  font-weight: 800;
  text-underline-offset: 3px;
}
