:root {
  --cream: #eddecc;
  --charcoal: #424547;
  --black: #000000;
  --olive: #6b764c;
  --steel: #3a5f85;
  --navy: #0a1f44;
  --blush: #f8dbd5;
  --danger: #a8322d;
  --danger-dark: #6f1e1a;
  --danger-soft: #fde8e4;
  --paper: #fffaf4;
  --white: #ffffff;
  --line: rgba(66, 69, 71, 0.18);
  --shadow: 0 24px 70px rgba(10, 31, 68, 0.14);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--charcoal);
  background:
    linear-gradient(90deg, rgba(237, 222, 204, 0.94), rgba(255, 250, 244, 0.8)),
    linear-gradient(180deg, var(--paper), var(--white));
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(420px, 0.82fr);
  min-height: 100vh;
}

.tool-panel,
.report-panel {
  padding: clamp(24px, 5vw, 64px);
}

.tool-panel {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  width: min(280px, 58vw);
  height: auto;
  display: block;
}

.header-actions,
.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--olive);
  box-shadow: 0 0 0 4px rgba(107, 118, 76, 0.16);
}

.intro-copy {
  max-width: 700px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--olive);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  color: var(--black);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 5vw, 5.15rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: clamp(1.55rem, 3vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  color: var(--charcoal);
  font-size: 1rem;
}

.intro-copy p:not(.eyebrow),
.privacy-note,
.field-help,
.result-copy,
.report-state p {
  color: rgba(66, 69, 71, 0.82);
  line-height: 1.6;
}

.checker-form {
  display: grid;
  max-width: 680px;
  gap: 12px;
}

.field-label {
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
}

textarea,
input[type="email"] {
  width: 100%;
  border: 1px solid rgba(66, 69, 71, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--black);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.hmo-field {
  display: grid;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 0;
  border: 0;
}

.hmo-field legend {
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
}

.hmo-field legend span {
  display: block;
  margin-top: 5px;
  color: rgba(66, 69, 71, 0.78);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

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

.segmented-control label {
  position: relative;
  min-height: 54px;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 54px;
  place-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(66, 69, 71, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.segmented-control input:focus-visible + span {
  border-color: var(--steel);
  box-shadow: 0 0 0 4px rgba(58, 95, 133, 0.16);
}

.segmented-control input:checked + span {
  border-color: var(--olive);
  background: rgba(107, 118, 76, 0.13);
  box-shadow: inset 0 0 0 1px rgba(107, 118, 76, 0.2);
}

textarea {
  min-height: 112px;
  padding: 16px;
  resize: vertical;
}

input[type="email"] {
  min-height: 52px;
  padding: 0 16px;
}

textarea:focus,
input[type="email"]:focus {
  border-color: var(--steel);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(58, 95, 133, 0.16);
}

.field-help {
  margin: -4px 0 10px;
  font-size: 0.9rem;
}

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 6px;
  color: rgba(66, 69, 71, 0.88);
  font-size: 0.94rem;
  line-height: 1.45;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--olive);
}

.form-actions,
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border-radius: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button {
  min-width: 170px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 14px 28px rgba(10, 31, 68, 0.2);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--line);
  color: var(--navy);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.privacy-note {
  max-width: 620px;
  margin: 10px 0 0;
  font-size: 0.86rem;
}

.report-panel {
  display: grid;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(10, 31, 68, 0.94), rgba(58, 95, 133, 0.94)),
    var(--navy);
}

.report-panel.has-active-scheme {
  background:
    linear-gradient(180deg, rgba(111, 30, 26, 0.96), rgba(168, 50, 45, 0.92)),
    var(--danger-dark);
}

.report-state,
.report-card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.98);
  box-shadow: var(--shadow);
}

.report-state {
  min-height: 410px;
  padding: clamp(24px, 5vw, 42px);
}

.report-skeleton {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.report-skeleton span {
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(237, 222, 204, 0.8), rgba(248, 219, 213, 0.48));
}

.report-skeleton span:nth-child(2) {
  width: 82%;
}

.report-skeleton span:nth-child(3) {
  width: 58%;
}

.is-loading {
  text-align: center;
}

.loader {
  display: inline-block;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border: 4px solid rgba(58, 95, 133, 0.18);
  border-top-color: var(--steel);
  border-radius: 999px;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.is-error {
  border-color: rgba(248, 219, 213, 0.8);
}

.report-card {
  padding: clamp(22px, 4vw, 36px);
}

.report-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.saved-badge {
  border-color: rgba(107, 118, 76, 0.24);
  background: rgba(107, 118, 76, 0.12);
  color: var(--olive);
}

.saved-badge.is-muted {
  border-color: rgba(66, 69, 71, 0.18);
  background: rgba(66, 69, 71, 0.08);
  color: rgba(66, 69, 71, 0.76);
}

.report-card.requires h2 {
  color: var(--danger-dark);
}

.report-card.requires {
  border-color: rgba(168, 50, 45, 0.36);
  box-shadow: 0 24px 80px rgba(111, 30, 26, 0.28);
}

.report-card.requires .eyebrow {
  color: var(--danger);
}

.report-card.requires .saved-badge {
  border-color: rgba(168, 50, 45, 0.22);
  background: rgba(168, 50, 45, 0.1);
  color: var(--danger-dark);
}

.report-card.clear h2 {
  color: var(--olive);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.summary-grid div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

dt {
  margin-bottom: 8px;
  color: rgba(66, 69, 71, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

dd {
  margin: 0;
  color: var(--black);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.schemes-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.report-warning {
  margin: -8px 0 24px;
  padding: 16px;
  border: 1px solid rgba(58, 95, 133, 0.22);
  border-radius: 8px;
  background: rgba(58, 95, 133, 0.08);
  color: rgba(10, 31, 68, 0.9);
  line-height: 1.55;
}

.report-card.requires .report-warning {
  border-color: rgba(168, 50, 45, 0.32);
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.report-warning strong {
  display: block;
  margin-bottom: 5px;
  color: inherit;
}

.scheme-card {
  display: grid;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.scheme-card:last-child {
  border-bottom: 0;
}

.scheme-card strong {
  color: var(--navy);
}

.scheme-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(66, 69, 71, 0.76);
  font-size: 0.9rem;
}

.scheme-link {
  color: var(--steel);
  font-weight: 800;
  text-decoration: none;
}

.scheme-link:hover {
  text-decoration: underline;
}

.no-schemes {
  margin: 0;
  color: rgba(66, 69, 71, 0.78);
  line-height: 1.6;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .report-panel {
    min-height: 520px;
  }
}

@media (max-width: 620px) {
  .tool-panel,
  .report-panel {
    padding: 22px;
  }

  .brand-header,
  .report-topline {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .segmented-control {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.35rem, 14vw, 3.55rem);
  }

  .form-actions,
  .report-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .tool-panel,
  .form-actions,
  .report-actions,
  .header-actions {
    display: none;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  .report-panel {
    padding: 0;
    background: var(--white);
  }

  .report-card {
    box-shadow: none;
    border: 0;
  }
}
