:root {
  --green: #234a3b;
  --green-ink: #173127;
  --gold: #d6ad65;
  --paper: #f8f5ef;
  --paper-deep: #efe8da;
  --ink: #20231f;
  --muted: #6f746d;
  --line: rgba(35, 74, 59, 0.18);
  --white: #fffdf8;
  --shadow: 0 20px 70px rgba(23, 49, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: auto;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(35, 74, 59, 0.07), rgba(214, 173, 101, 0.1)),
    var(--paper);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 40px);
  background: rgba(248, 245, 239, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--green-ink);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(145px, 18vw, 220px);
  height: auto;
}

.brand-line {
  display: block;
}

.brand-line {
  max-width: 260px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.18;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  justify-content: flex-end;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.progress-shell {
  display: block;
  width: min(180px, 22vw);
  height: 8px;
  overflow: hidden;
  background: rgba(35, 74, 59, 0.12);
}

#progressBar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 260ms ease;
}

main {
  min-height: auto;
  padding-bottom: 0;
}

.screen {
  display: none;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 64px;
  animation: rise 360ms ease both;
}

.screen.active {
  display: block;
}

.intro-screen {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 48px;
  align-items: start;
  min-height: auto;
}

.intro-screen.active {
  display: grid;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--green-ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  max-width: 800px;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 0.9;
}

h2 {
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.94;
}

h3 {
  font-size: clamp(40px, 5vw, 70px);
  line-height: 0.92;
}

.lede {
  max-width: 720px;
  margin: 14px 0 0;
  color: #39423b;
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.35;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.time-note {
  color: var(--muted);
  font-weight: 600;
}

.diagnostic-preview {
  padding-left: 34px;
  border-left: 1px solid var(--line);
}

.preview-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.preview-row:first-child {
  padding-top: 0;
}

.preview-row:last-child {
  border-bottom: 0;
}

.preview-row span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-weight: 800;
}

.preview-row strong {
  display: block;
  color: var(--green-ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.preview-row p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.42;
}

.field-grid,
.field-stack {
  display: grid;
  gap: 18px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--green-ink);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  background: var(--white);
  border-color: rgba(214, 173, 101, 0.75);
  box-shadow: 0 0 0 4px rgba(214, 173, 101, 0.16);
}

.questions {
  display: grid;
  gap: 16px;
}

.scale-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: -24px 0 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.scale-legend span {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 12px;
  align-content: center;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid rgba(35, 74, 59, 0.12);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.18;
}

.scale-legend strong {
  color: var(--green);
  font-size: 18px;
  line-height: 1;
}

.question {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 500px);
  gap: 22px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.question p {
  margin: 0;
  color: #30372f;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 8px;
}

.scale label {
  position: relative;
  display: grid;
  min-height: 52px;
  place-items: center;
  color: var(--green-ink);
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.scale label:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 173, 101, 0.75);
}

.scale input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.scale span {
  font-weight: 800;
}

.scale input:checked + span {
  color: var(--white);
}

.scale label:has(input:checked) {
  background: var(--green);
  border-color: var(--green);
}

.controls {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(18px, 4vw, 40px);
  background: rgba(248, 245, 239, 0.93);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  color: var(--green-ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

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

.button.primary {
  color: var(--paper);
  background: var(--green);
}

.button.primary:hover {
  background: var(--green-ink);
}

.button.secondary {
  background: transparent;
  border-color: var(--line);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.35;
  transform: none;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(30px, 6vw, 72px);
  align-items: start;
}

.client-summary {
  padding: clamp(28px, 5vw, 54px);
  color: var(--paper);
  background: var(--green);
  box-shadow: var(--shadow);
}

.summary-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-summary h3 {
  color: var(--paper);
}

.client-summary p {
  color: rgba(255, 253, 248, 0.86);
  font-size: 20px;
  line-height: 1.42;
}

.secondary-note {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 253, 248, 0.22);
}

.secondary-note span {
  color: rgba(255, 253, 248, 0.7);
  font-weight: 700;
}

.secondary-note strong {
  color: var(--gold);
  font-size: 19px;
}

.session-note {
  margin-bottom: 0;
}

.internal-panel {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading span,
.internal-detail span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel-heading strong {
  color: var(--green-ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  line-height: 1;
}

.score-list {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.score-row {
  display: grid;
  gap: 7px;
}

.score-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--green-ink);
  font-weight: 800;
}

.meter {
  height: 8px;
  overflow: hidden;
  background: rgba(35, 74, 59, 0.12);
}

.meter span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.internal-detail {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.internal-detail + .internal-detail {
  margin-top: 18px;
}

.internal-detail p,
.internal-detail ul {
  margin: 0;
  color: #3e453d;
  line-height: 1.42;
}

.internal-detail ul {
  padding-left: 18px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 116px;
  }

  .topbar-meta {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .progress-shell {
    width: min(54vw, 220px);
  }

  main {
    min-height: auto;
  }

  .intro-screen.active,
  .field-grid,
  .question,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .intro-screen {
    min-height: auto;
  }

  .diagnostic-preview {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .question {
    gap: 14px;
  }

  .scale {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .scale-legend {
    grid-template-columns: 1fr;
    margin-top: -14px;
  }

  .scale-legend span {
    min-height: 0;
    grid-template-columns: 32px 1fr;
    align-items: center;
  }

  .controls {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 50px;
  }

  h2 {
    font-size: 42px;
  }

  .brand-line {
    max-width: 230px;
    padding-left: 0;
    border-left: 0;
  }

  .client-summary,
  .internal-panel {
    padding: 24px;
  }

  .button {
    flex: 1;
    padding: 0 14px;
  }
}


/* Embedded-page refinements */
body {
  min-height: auto;
}

main {
  min-height: auto;
  padding-bottom: 0;
}

.screen {
  padding-top: 30px;
  padding-bottom: 64px;
}

.intro-screen {
  min-height: auto;
  align-items: start;
}

.topbar {
  min-height: 64px;
}

@media (min-width: 861px) {
  .intro-screen.active {
    min-height: auto;
  }
}


/* Embedded tighter bottom spacing */
body {
  min-height: auto;
}

.screen {
  padding-bottom: 18px;
}

.result-screen {
  padding-bottom: 24px;
}

.controls {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (max-width: 860px) {
  .screen {
    padding-bottom: 22px;
  }
}

/* Auto-embed refinements */
html,
body {
  min-height: 0 !important;
  height: auto !important;
  overflow-x: hidden;
}

body {
  background: var(--paper) !important;
}

.screen {
  padding-top: 24px !important;
  padding-bottom: 76px !important;
}

.intro-screen {
  min-height: 0 !important;
  align-items: start !important;
}

.intro-screen.active {
  min-height: 0 !important;
}

main {
  min-height: 0 !important;
}
