@import url('https://fonts.googleapis.com/css2?family=Domine:wght@400;500;600;700&family=Lato:wght@400;700&display=swap');

:root {
  color-scheme: light;
  --app-background: #fbfbfb;
  --app-surface: #fff;
  --app-title: #00423f;
  --app-text: #5d5d5d;
  --app-subtitle: #718783;
  --app-border: #e3e3e3;
  --app-primary: #19b2ab;
  --app-primary-dark: #087f7a;
  --app-nav-selected: #e7f4f3;
  --app-focus: #007f7a;
  --app-error: #9f3832;
  --font-title: 'Domine', Georgia, serif;
  --font-text: 'Lato', Arial, sans-serif;
  font-family: var(--font-text);
  color: var(--app-text);
  background: var(--app-background);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; min-width: 320px; max-width: 100%; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
.app-shell { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--app-background); color: var(--app-text); }
.skip-link { position: absolute; top: 8px; left: -9999px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--app-surface); color: var(--app-title); }
.skip-link:focus { left: 8px; outline: 3px solid var(--app-focus); outline-offset: 3px; }

.app-header { position: sticky; top: 0; z-index: 20; width: 100%; border-bottom: 1px solid var(--app-border); background: rgba(251, 251, 251, .96); backdrop-filter: blur(10px); }
.app-header-inner { width: min(1200px, calc(100% - 40px)); min-height: 70px; margin: auto; display: flex; align-items: center; gap: 24px; }
.app-brand { display: flex; align-items: center; gap: 12px; color: var(--app-title); text-decoration: none; font-size: 16px; font-weight: 700; }
.app-brand-logo { display: block; width: 72px; height: 50px; object-fit: contain; flex: none; }
.app-brand small { display: block; margin-top: 3px; color: var(--app-subtitle); font-size: 13px; font-weight: 400; }
.app-nav { position: relative; display: flex; align-items: center; gap: 22px; margin-left: auto; }
.app-nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--app-text); text-decoration: none; font-size: 15px; font-weight: 700; transition: color 150ms ease; }
.app-nav a:hover { color: var(--app-primary-dark); }
.app-nav a:focus-visible, .app-brand:focus-visible, .results-head a:focus-visible { outline: 3px solid var(--app-focus); outline-offset: 3px; border-radius: 4px; }
.nav-message { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; width: max-content; max-width: min(84vw, 380px); padding: 12px 14px; border-left: 3px solid #b42318; border-radius: 0 8px 8px 0; background: #fff0ee; color: var(--app-error); font-size: 15px; line-height: 1.5; box-shadow: 0 6px 20px rgba(16, 24, 43, .12); }

.container { width: min(1200px, calc(100% - 40px)); flex: 1; margin: 0 auto; padding: 36px 0 64px; }
.intro { max-width: 900px; }
.eyebrow { margin: 0 0 10px; color: var(--app-primary-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { color: var(--app-title); text-wrap: balance; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; }
h1 { max-width: 720px; margin: 0 0 10px; font-size: clamp(24px, 2.5vw, 30px); line-height: 1.25; letter-spacing: -.02em; }
h2 { margin: 0 0 18px; font-size: clamp(20px, 2vw, 24px); line-height: 1.25; }
h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.35; }
p { line-height: 1.6; text-wrap: pretty; }
.intro > p:not(.eyebrow) { max-width: 760px; margin: 0 0 14px; color: var(--app-text); font-size: 16px; }
.reference-note { margin-top: 18px !important; padding: 12px 14px; border-left: 3px solid var(--app-primary); border-radius: 0 8px 8px 0; background: var(--app-nav-selected); color: var(--app-title) !important; font-size: 14px !important; line-height: 1.55; }

.score-years { display: grid; gap: 0; margin-top: 26px; }
.score-year { min-width: 0; padding: 22px 0; border-bottom: 1px solid var(--app-border); background: transparent; }
.score-year h2 { margin-bottom: 18px; font-size: 20px; }
.score-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.field { min-width: 0; display: grid; gap: 8px; margin-bottom: 18px; }
.field label, .filter-field label { color: var(--app-title); font-size: 14px; font-weight: 700; }
.field input, .field select, .filter-field input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); color: var(--app-title); font-size: 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.field input::placeholder, .filter-field input::placeholder { color: #9bacb0; }
.field input:focus, .field select:focus, .filter-field input:focus { border-color: var(--app-focus); outline: 0; box-shadow: 0 0 0 3px rgb(19 143 139 / 18%); }
.simulation-options { margin: 0; padding-top: 26px; }
.simulation-options > .field { max-width: 380px; margin-bottom: 24px; }
.simulation-options > p { margin: 0 0 18px; color: var(--app-text); font-size: 15px; }
.simulation-options h3 small { color: var(--app-subtitle); font-family: var(--font-text); font-size: 14px; font-weight: 400; }
.option-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.primary-button, .secondary-button, .mode-tabs button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 1px solid var(--app-primary); border-radius: 10px; background: var(--app-primary); color: #fff; font-size: 15px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 150ms ease; }
.primary-button:hover, .mode-tabs button:hover { border-color: var(--app-primary-dark); background: var(--app-primary-dark); color: #fff; }
.primary-button:active, .mode-tabs button:active { transform: translateY(1px); }
.primary-button:focus-visible, .secondary-button:focus-visible, .mode-tabs button:focus-visible, .show-more:focus-visible { outline: 3px solid var(--app-focus); outline-offset: 3px; }
.primary-button:disabled { cursor: not-allowed; opacity: .62; }
.simulation-cta { width: 100%; min-height: 66px; margin-top: 8px; padding: 14px 24px; justify-content: space-between; border-radius: 12px; font-size: 18px; box-shadow: 0 7px 20px rgb(8 127 122 / 20%); }
.simulation-cta:not(:disabled):hover { box-shadow: 0 10px 25px rgb(8 127 122 / 28%); transform: translateY(-1px); }
.cta-arrow { font-size: 24px; line-height: 1; }
.secondary-button { border-color: var(--app-border); background: transparent; color: var(--app-title); }
.secondary-button:hover { border-color: var(--app-primary); background: var(--app-nav-selected); color: var(--app-title); }
.message { margin: 18px 0 0; padding: 12px 14px; border-left: 3px solid var(--app-primary); border-radius: 0 8px 8px 0; background: var(--app-nav-selected); color: var(--app-title); font-size: 15px; font-weight: 700; }
.message:empty { display: none; }
.message.error { border-left-color: #b42318; background: #fff0ee; color: var(--app-error); }

.results { margin-top: 20px; scroll-margin-top: 6rem; }
.results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.results-head p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--app-text); font-size: 15px; }
.results-head .secondary-button { flex: none; }
.mode-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 18px 0; border-bottom: 1px solid var(--app-border); }
.mode-tabs button { flex: none; min-height: 48px; padding: 8px 16px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--app-text); box-shadow: none; }
.mode-tabs button:hover { border-color: transparent; border-bottom-color: var(--app-primary); background: var(--app-nav-selected); color: var(--app-title); }
.mode-tabs button.active { border-bottom-color: var(--app-primary); background: transparent; color: var(--app-title); }
.summary { margin: 0 0 22px; padding: 14px 16px; border-left: 3px solid var(--app-primary); background: var(--app-nav-selected); color: var(--app-title); font-size: 15px; font-weight: 700; }
.filter-field { max-width: 440px; margin-bottom: 18px; }
.filter-field label { display: block; margin-bottom: 8px; }
.results-list { display: grid; gap: 0; }
.result-card { min-width: 0; padding: 22px 0; border-bottom: 1px solid var(--app-border); background: transparent; }
.result-title { display: flex; align-items: flex-start; gap: 14px; }
.result-title h3 { margin: 0 0 4px; font-size: 17px; }
.result-title p { margin: 0; color: var(--app-text); font-size: 15px; }
.preference { flex: none; margin-left: auto; padding: 6px 10px; border-radius: 999px; background: var(--app-primary); color: #fff; font-size: 13px; font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.metric { display: grid; gap: 5px; padding-top: 12px; border-top: 1px solid var(--app-border); }
.metric-label { color: var(--app-subtitle); font-size: 13px; font-weight: 400; }
.metric strong { color: var(--app-title); font-family: var(--font-title); font-size: 17px; }
.metric.positive strong { color: #146c58; }
.metric.negative strong { color: #b42318; }
.result-foot { margin: 14px 0 0; color: var(--app-text); font-size: 14px; }
.source-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--app-border); }
.source-details summary, .notes-panel summary { cursor: pointer; color: var(--app-primary-dark); font-size: 15px; font-weight: 700; }
.source-details p { margin: 9px 0 0; color: var(--app-text); font-size: 14px; }
.notes-panel { margin-bottom: 22px; padding: 14px 0; border-bottom: 1px solid var(--app-border); }
.notes-panel #notes-summary { overflow-x: auto; }
.notes-table { width: 100%; min-width: 620px; margin-top: 10px; border-collapse: collapse; text-align: left; font-size: 14px; }
.notes-table th, .notes-table td { padding: 10px 12px; border-bottom: 1px solid var(--app-border); white-space: nowrap; }
.notes-table thead th { color: var(--app-subtitle); font-weight: 700; }
.notes-table tbody th { color: var(--app-title); font-weight: 700; }
.notes-table td { color: var(--app-text); }
.show-more { display: flex; margin: 18px auto 0; }
.result-card.peek { position: relative; max-height: 136px; overflow: hidden; opacity: .46; pointer-events: none; }
.result-card.peek::after { content: ''; position: absolute; inset: auto 0 0; height: 58px; background: linear-gradient(transparent, var(--app-background)); }

.lead-dialog { width: min(560px, calc(100% - 32px)); max-width: none; max-height: min(88vh, 760px); padding: 0; overflow: auto; border: 1px solid var(--app-border); border-radius: 16px; background: var(--app-surface); color: var(--app-text); box-shadow: 0 24px 80px rgb(0 40 36 / 24%); }
.lead-dialog::backdrop { background: rgb(0 34 31 / 58%); backdrop-filter: blur(3px); }
.lead-dialog-content { position: relative; padding: 32px; }
.lead-dialog-content h2 { max-width: 440px; margin: 0 42px 10px 0; }
.lead-dialog-content > p:not(.eyebrow) { margin: 0 0 20px; font-size: 15px; }
.lead-dialog-close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border: 1px solid var(--app-border); border-radius: 50%; background: var(--app-surface); color: var(--app-title); font-size: 28px; line-height: 1; cursor: pointer; }
.lead-dialog-close:hover { border-color: var(--app-primary); background: var(--app-nav-selected); }
.lead-dialog-close:focus-visible { outline: 3px solid var(--app-focus); outline-offset: 3px; }
.lead-preview-form { display: grid; gap: 2px; }
.lead-name-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lead-preview-note { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--app-primary); background: var(--app-nav-selected); color: var(--app-title); font-size: 14px; }
.lead-required-note { margin: 0 0 12px; color: var(--app-subtitle); font-size: 13px; }
.lead-required-note span, .required-mark { color: var(--app-error); font-weight: 700; }
.lead-submit { width: 100%; min-height: 54px; margin-top: 6px; }
.lead-thanks { text-align: center; }
.lead-thanks-icon { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--app-nav-selected); color: var(--app-primary-dark); font-size: 30px; font-weight: 700; }
.lead-thanks h3 { margin-bottom: 8px; font-size: 21px; }
.lead-thanks p { margin: 0 0 20px; }
.mautic-form-container { display: grid; gap: 14px; }
.lead-form-not-ready { margin: 0; padding: 16px; border-left: 3px solid var(--app-primary); background: var(--app-nav-selected); color: var(--app-title); font-size: 15px; line-height: 1.5; }
.mautic-form-container .mauticform-row { margin-bottom: 14px; }
.mautic-form-container .mauticform-label { display: block; margin-bottom: 7px; color: var(--app-title); font-size: 14px; font-weight: 700; }
.mautic-form-container input:not([type="checkbox"]), .mautic-form-container select, .mautic-form-container textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); color: var(--app-title); font: inherit; font-size: 16px; }
.mautic-form-container input:focus, .mautic-form-container select:focus, .mautic-form-container textarea:focus { border-color: var(--app-focus); outline: 0; box-shadow: 0 0 0 3px rgb(19 143 139 / 18%); }
.mautic-form-container .mauticform-button, .mautic-form-container button[type="submit"] { width: 100%; min-height: 56px; padding: 12px 20px; border: 1px solid var(--app-primary-dark); border-radius: 10px; background: var(--app-primary); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.mautic-form-container .mauticform-button:hover, .mautic-form-container button[type="submit"]:hover { background: var(--app-primary-dark); }

.footer { width: 100%; border-top: 1px solid var(--app-border); background: var(--app-surface); }
.footer-inner { width: min(1200px, calc(100% - 40px)); min-height: 64px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--app-subtitle); font-size: 14px; }
.footer-inner strong { color: var(--app-title); font-family: var(--font-title); font-size: 14px; }

@media (max-width: 850px) {
  .score-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .option-fields { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-head { display: block; }
  .results-head .secondary-button { margin-top: 16px; }
}
@media (max-width: 520px) {
  .app-header-inner { width: calc(100% - 32px); min-height: 66px; gap: 10px; }
  .app-brand { gap: 8px; font-size: 14px; }
  .app-brand-logo { width: 56px; height: 42px; }
  .app-brand small { font-size: 12px; }
  .app-nav { gap: 10px; }
  .app-nav a { font-size: 13px; }
  .container { width: calc(100% - 32px); padding-block: 30px 48px; }
  .score-fields { grid-template-columns: 1fr; }
  .score-year { padding-block: 20px; }
  .primary-button { width: 100%; }
  .simulation-cta { min-height: 62px; font-size: 17px; }
  .metrics { gap: 10px; }
  .result-title { flex-wrap: wrap; }
  .preference { margin-left: 0; }
  .footer-inner { width: calc(100% - 32px); min-height: 68px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 4px; padding-block: 12px; }
  .lead-dialog-content { padding: 28px 22px 22px; }
  .lead-name-fields { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
