:root {
  color-scheme: light;
  --green: #007d72;
  --green-dark: #10233f;
  --blue: #0a6cff;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e2ec;
  --surface: #ffffff;
  --background: #eef5f8;
  --danger: #9f2d2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.portal-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: start;
  gap: 30px 42px;
  padding: 38px 0 44px;
}

.login-marketing {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: center;
}

body:not([data-page="subscription"]) .portal-shell {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
}

body[data-page="subscription"] .portal-shell {
  place-items: center;
}

.auth-card,
.billing-panel {
  min-width: 0;
  width: min(100%, 480px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 52px rgba(16, 35, 63, 0.12);
  padding: 28px;
}

.auth-card {
  position: sticky;
  top: 24px;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border-color: #cbd9e4;
  box-shadow: 0 22px 58px rgba(16, 35, 63, 0.16);
}

.billing-panel {
  width: 100%;
}

body[data-page="subscription"] [data-panel="marketing"] {
  display: none;
}

.login-marketing .eyebrow {
  margin: 0 0 -6px;
}

.login-marketing h1 {
  max-width: 760px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.marketing-lede {
  max-width: 720px;
  margin: 0;
  color: #43564b;
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.implementation-card {
  min-width: 0;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(16, 35, 63, 0.08);
}

.implementation-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.implementation-steps {
  margin: 0;
  padding: 0;
  counter-reset: setup-step;
  display: grid;
  gap: 12px;
  list-style: none;
}

.implementation-steps li {
  min-width: 0;
  counter-increment: setup-step;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  color: #2f4237;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.implementation-steps li::before {
  content: counter(setup-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  font-weight: 900;
}

.implementation-steps strong,
.implementation-steps span {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.implementation-steps span {
  margin-top: -8px;
  color: var(--muted);
}

.implementation-steps code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef7ff;
  color: #10233f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
  overflow-wrap: anywhere;
}

.service-grid {
  min-width: 0;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.service-grid article {
  min-width: 0;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fff;
}

.service-grid strong,
.service-grid span {
  display: block;
  min-width: 0;
  max-width: 100%;
  word-break: break-word;
}

.service-grid strong {
  color: var(--green-dark);
  font-size: 15px;
  line-height: 1.25;
}

.service-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.trust-grid,
.gateway-transport-grid,
.seo-section,
.faq-section {
  min-width: 0;
  max-width: 760px;
}

.trust-grid,
.gateway-transport-grid,
.seo-section {
  display: grid;
  gap: 12px;
}

.trust-grid,
.seo-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gateway-transport-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trust-grid article,
.gateway-transport-grid article,
.seo-section article,
.faq-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 35, 63, 0.07);
}

.trust-grid article,
.gateway-transport-grid article,
.seo-section article {
  min-width: 0;
  padding: 18px;
}

.trust-grid strong,
.trust-grid span,
.gateway-transport-grid strong,
.gateway-transport-grid span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.trust-grid strong,
.gateway-transport-grid strong {
  color: var(--green-dark);
  font-size: 16px;
  line-height: 1.25;
}

.trust-grid span,
.gateway-transport-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.gateway-transport-grid code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef7ff;
  color: #10233f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
  overflow-wrap: anywhere;
}

.seo-section h2,
.faq-section h2 {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 20px;
  line-height: 1.25;
}

.seo-section p,
.faq-section p {
  margin: 0;
  color: #34483e;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.faq-section {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.faq-section details {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.faq-section details:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.faq-section summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 900;
}

.faq-section details[open] summary {
  margin-bottom: 8px;
}

.faq-section code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef7ff;
  color: #10233f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
  overflow-wrap: anywhere;
}

.health-panel {
  min-width: 0;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(16, 35, 63, 0.08);
}

.legal-shell > .health-panel {
  max-width: none;
  margin: 0 0 18px;
}

.health-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.health-panel__header strong {
  white-space: nowrap;
}

.health-panel__track {
  height: 10px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef3;
}

.health-panel__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 220ms ease;
}

.health-panel.is-degraded .health-panel__track span {
  background: linear-gradient(90deg, #b42318, #f79009);
}

.health-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.brand-mark {
  width: 52px;
  height: 52px;
}

.auth-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 24px 24px 0;
}

.auth-card__header .eyebrow {
  margin: 0 0 5px;
}

.auth-card__header h1 {
  font-size: 30px;
}

.auth-card .lede {
  margin: 14px 24px 18px;
}

.auth-plan-strip {
  display: grid;
  gap: 3px;
  margin: 0 24px 20px;
  padding: 14px;
  border: 1px solid #cbe4db;
  border-radius: 8px;
  background: #f2fbf7;
}

.auth-plan-strip span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-plan-strip strong {
  color: var(--green-dark);
  font-size: 20px;
  line-height: 1.25;
}

.auth-plan-strip small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.eyebrow {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
}

.lede {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.portal-form {
  display: none;
  gap: 14px;
}

.auth-card .portal-form {
  padding: 0 24px 22px;
}

body[data-page="login"] [data-form="login"],
body[data-page="register"] [data-form="register"],
body[data-page="forgot"] [data-form="forgot"],
body[data-page="reset"] [data-form="reset"] {
  display: grid;
}

body[data-page="subscription"] [data-panel="auth"] {
  display: none;
}

body:not([data-page="subscription"]) [data-panel="subscription"] {
  display: none;
}

label {
  display: grid;
  gap: 7px;
  color: #30443a;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdbd4;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  background: #fff;
}

textarea {
  min-height: 140px;
  padding: 12px;
  resize: vertical;
}

select {
  appearance: auto;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(31, 122, 77, 0.25);
  border-color: var(--green);
}

.primary-button,
.secondary-button,
.plan-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button,
.plan-card button {
  background: var(--green);
  color: #fff;
}

.secondary-button {
  background: #fff;
  border-color: #cfdbd4;
  color: var(--green-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.form-links,
.portal-message {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.portal-message {
  min-height: 22px;
  font-weight: 700;
}

.auth-card > .portal-message {
  margin: -10px 24px 18px;
}

.portal-message.is-error {
  color: var(--danger);
}

.auth-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px 24px 18px;
  border-top: 1px solid var(--line);
  background: #f7faf8;
}

.auth-card__foot span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #d6e4dc;
  border-radius: 999px;
  padding: 0 10px;
  color: #31463b;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.billing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.billing-header .eyebrow {
  margin-top: 0;
}

.billing-actions {
  display: flex;
  gap: 10px;
}

.current-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
  background: #f7faf8;
  font-weight: 800;
}

.current-plan span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.plan-card.is-current {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.plan-card h2 {
  margin: 0;
  font-size: 20px;
}

.plan-card .price {
  font-size: 28px;
  font-weight: 900;
}

.plan-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.plan-card ul {
  margin: 0;
  padding-left: 18px;
  color: #34483e;
  font-size: 14px;
  line-height: 1.55;
}

.auth-legal-footer {
  grid-column: 1 / -1;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
}

.auth-legal-footer nav,
.legal-footer nav,
.legal-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.legal-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 34px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 900;
}

.legal-brand .brand-mark {
  width: 38px;
  height: 38px;
}

.legal-hero {
  max-width: 820px;
  margin-bottom: 24px;
}

.legal-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.legal-updated {
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 35, 63, 0.07);
}

.legal-card--full {
  grid-column: 1 / -1;
}

.legal-card h2 {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 20px;
  line-height: 1.25;
}

.legal-card p {
  margin: 0 0 12px;
  color: #34483e;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.docs-card {
  overflow: hidden;
}

.docs-intro {
  display: grid;
  gap: 14px;
}

.docs-steps,
.docs-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: #34483e;
  line-height: 1.62;
}

.docs-steps {
  display: grid;
  gap: 12px;
}

.docs-steps li {
  padding-left: 2px;
}

.docs-steps strong,
.docs-steps span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.docs-steps span {
  margin-top: 4px;
  color: var(--muted);
}

.docs-list {
  display: grid;
  gap: 8px;
}

.docs-card code,
.docs-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.docs-card :not(pre) > code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef7ff;
  color: #10233f;
  font-size: 0.94em;
  overflow-wrap: anywhere;
}

.docs-callout {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  border: 1px solid #cbe4db;
  border-radius: 8px;
  padding: 14px;
  background: #f2fbf7;
  color: #31463b;
  line-height: 1.5;
}

.docs-callout strong {
  color: var(--green-dark);
}

.docs-callout--warning {
  border-color: #f4d39b;
  background: #fff8eb;
}

.docs-code {
  min-width: 0;
  margin-top: 16px;
  border: 1px solid #cbd9e4;
  border-radius: 8px;
  overflow: hidden;
  background: #f7faf8;
}

.docs-code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #d9e2ec;
  background: #ffffff;
}

.docs-code__bar strong {
  min-width: 0;
  color: var(--green-dark);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.docs-code__bar button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid #cfdbd4;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--green-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.docs-code pre {
  max-height: 520px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre;
  color: #10233f;
  font-size: 13px;
  line-height: 1.55;
}

.docs-link-button {
  width: fit-content;
}

.legal-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.legal-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.cookie-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 52px rgba(16, 35, 63, 0.2);
}

.cookie-consent strong,
.cookie-consent span {
  display: block;
}

.cookie-consent span {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cookie-consent button {
  min-height: 40px;
  border: 1px solid #cfdbd4;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--green-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.cookie-consent button[data-choice="accept"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

@media (max-width: 860px) {
  .portal-shell {
    width: min(100% - 40px, 520px);
    align-items: start;
    gap: 18px;
  }

  body:not([data-page="subscription"]) .portal-shell {
    grid-template-columns: 1fr;
  }

  .login-marketing {
    display: contents;
  }

  .login-marketing > .eyebrow,
  .login-marketing > h1,
  .login-marketing > .marketing-lede {
    order: 1;
  }

  .login-marketing > .health-panel,
  .login-marketing > .implementation-card,
  .login-marketing > .service-grid,
  .login-marketing > .trust-grid,
  .login-marketing > .gateway-transport-grid,
  .login-marketing > .seo-section,
  .login-marketing > .faq-section {
    order: 3;
  }

  .auth-card {
    order: 2;
  }

  .auth-legal-footer {
    order: 4;
  }

  .login-marketing h1 {
    font-size: 26px;
    line-height: 1.12;
    max-width: 100%;
    word-break: break-word;
  }

  .marketing-lede {
    font-size: 14px;
    max-width: 100%;
    word-break: break-word;
  }

  .implementation-card {
    padding: 16px;
  }

  .implementation-card h2 {
    font-size: 19px;
  }

  .implementation-steps {
    gap: 10px;
  }

  .implementation-steps li {
    font-size: 13px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .service-grid article {
    min-height: 0;
  }

  .trust-grid,
  .gateway-transport-grid,
  .seo-section {
    grid-template-columns: 1fr;
  }

  .auth-card,
  .billing-panel {
    padding: 22px;
  }

  .auth-card {
    position: static;
    padding: 0;
  }

  .auth-card__header {
    padding: 22px 22px 0;
  }

  .auth-card__header h1 {
    font-size: 28px;
  }

  .auth-card .lede {
    margin: 12px 22px 16px;
  }

  .auth-plan-strip {
    margin: 0 22px 18px;
  }

  .auth-card .portal-form {
    padding: 0 22px 20px;
  }

  .auth-card > .portal-message {
    margin: -8px 22px 16px;
  }

  .auth-card__foot {
    padding: 14px 22px 16px;
  }

  .billing-header {
    flex-direction: column;
  }

  .billing-actions {
    width: 100%;
  }

  .billing-actions .secondary-button {
    flex: 1;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .legal-header,
  .legal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent {
    position: static;
    width: min(100% - 40px, 520px);
    margin: 0 auto 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  .legal-card {
    padding: 18px;
  }

  .docs-code pre {
    max-height: 420px;
    font-size: 12px;
  }

  .docs-code__bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-code__bar button,
  .docs-link-button {
    width: 100%;
  }

  .cookie-consent__actions button {
    flex: 1;
  }
}
