: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: center;
  gap: 34px;
  padding: 32px 0;
}

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

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

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;
}

.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;
}

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

.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;
}

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 {
  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;
}

input: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;
}

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

.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;
}

@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 {
    gap: 14px;
    padding-top: 8px;
  }

  .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;
  }

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

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

  .billing-actions {
    width: 100%;
  }

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

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