:root {
  --ink: #16333c;
  --muted: #61747a;
  --blue: #1478a4;
  --blue-dark: #0c5e82;
  --blue-soft: #eaf6fa;
  --line: #dbe7e9;
  --cream: #f8fbfa;
  --red: #e96a62;
  --amber: #efb846;
  --green: #46aa7b;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cream);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(130, 204, 215, 0.18), transparent 24rem),
    var(--cream);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 6vw;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(22, 51, 60, 0.09);
}

.brand {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(20, 120, 164, 0.16);
  background:
    white url("images/ibd-control-traffic-lights.jpg") center / cover no-repeat;
  box-shadow: 0 7px 18px rgba(20, 120, 164, 0.18);
}

.intro-panel {
  flex: 1;
  min-height: 670px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  align-items: center;
  gap: 7vw;
  padding: 76px 3vw 100px;
}

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

.kicker,
.question-eyebrow,
.summary-kicker {
  display: block;
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.intro-copy h1,
.results-heading h1 {
  margin: 0;
  font-size: clamp(3.1rem, 5vw, 5.5rem);
  line-height: 1.01;
  letter-spacing: -0.065em;
  max-width: 780px;
}

.intro-copy > p,
.results-heading > p {
  max-width: 590px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}

.intro-actions {
  margin-top: 38px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 54px;
  border-radius: 14px;
  padding: 0 23px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.primary-button {
  color: white;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(20, 120, 164, 0.2);
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.time-note {
  color: var(--muted);
  font-size: 14px;
}

.intro-orbit {
  width: min(42vw, 520px);
  aspect-ratio: 1;
  position: relative;
  margin: 0 auto;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(20, 120, 164, 0.16);
}

.orbit-ring-one {
  inset: 4%;
}

.orbit-ring-two {
  inset: 20%;
  border-style: dashed;
}

.intro-hub {
  position: absolute;
  inset: 32%;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: white;
  box-shadow: 0 26px 60px rgba(22, 51, 60, 0.12);
}

.intro-hub span {
  color: var(--blue);
  font-size: clamp(4rem, 8vw, 6.7rem);
  font-weight: 770;
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.intro-hub small {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.orbit-icon {
  position: absolute;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--blue);
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 13px 30px rgba(22, 51, 60, 0.11);
}

.orbit-symbol {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.question-layout {
  flex: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 50px 0 90px;
}

.progress-area {
  margin-bottom: 34px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8e8;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 280ms ease;
}

.question-card {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(22, 51, 60, 0.08);
  padding: clamp(28px, 5vw, 54px);
  box-shadow: 0 28px 70px rgba(31, 70, 78, 0.08);
  animation: card-in 260ms ease both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 15px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 24px;
  font-weight: 760;
}

.question-eyebrow {
  margin-bottom: 13px;
}

.question-card h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.question-note {
  max-width: 590px;
  margin: 15px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.answer-list {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0;
  margin: 36px auto 0;
  border: 0;
}

.answer-option {
  min-height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-weight: 650;
  cursor: pointer;
  transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.answer-option:hover {
  border-color: #8fc4d5;
  transform: translateY(-1px);
}

.answer-option.selected {
  transform: translateY(-1px);
}

.answer-option.selected.answer-score-0 {
  border-color: rgba(233, 106, 98, 0.72);
  background: rgba(233, 106, 98, 0.12);
}

.answer-option.selected.answer-score-1 {
  border-color: rgba(239, 184, 70, 0.78);
  background: rgba(239, 184, 70, 0.14);
}

.answer-option.selected.answer-score-2 {
  border-color: rgba(70, 170, 123, 0.72);
  background: rgba(70, 170, 123, 0.12);
}

.answer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1.5px solid #9fb4b9;
  border-radius: 50%;
  background: white;
}

.selected.answer-score-0 .radio-dot {
  border: 5px solid var(--red);
}

.selected.answer-score-1 .radio-dot {
  border: 5px solid var(--amber);
}

.selected.answer-score-2 .radio-dot {
  border: 5px solid var(--green);
}

.question-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 38px;
}

.back-button,
.edit-button {
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 670;
  cursor: pointer;
}

.results-layout {
  flex: 1;
  padding: 55px 0 75px;
}

.results-heading {
  text-align: center;
}

.results-heading h1 {
  max-width: 830px;
  margin: 0 auto;
  font-size: clamp(2.4rem, 4vw, 4rem);
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1.25fr) minmax(310px, 0.75fr);
  gap: 24px;
  margin-top: 34px;
}

.wheel-card,
.response-summary {
  min-height: 630px;
  border: 1px solid rgba(22, 51, 60, 0.08);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 65px rgba(31, 70, 78, 0.07);
}

.wheel-card {
  min-height: 700px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 48px 36px;
}

.wheel {
  --wheel-size: 530px;
  --hub-size: 132px;
  width: var(--wheel-size);
  height: var(--wheel-size);
  position: relative;
  margin: 0 auto;
}

.wheel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--wheel-size) - 70px);
  height: calc(var(--wheel-size) - 70px);
  transform: translate(-50%, -50%);
  z-index: 0;
  border: 1px solid rgba(20, 120, 164, 0.08);
  border-radius: 50%;
  background: var(--blue-soft);
}

.spoke {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 56px;
  transform-origin: left center;
  z-index: 1;
}

.segments {
  height: 100%;
  margin-left: calc(var(--hub-size) / 2 - 2px);
  padding-right: 43px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  align-items: center;
}

.segment {
  height: 28px;
  border: 1px solid #dbe7e9;
  background: #edf3f3;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.segment:first-child {
  border-radius: 6px 2px 2px 6px;
}

.segment:last-child {
  border-radius: 2px 6px 6px 2px;
}

.segment.score-0,
.score-badge.score-0 {
  background: var(--red);
  border-color: var(--red);
}

.segment.score-1,
.score-badge.score-1 {
  background: var(--amber);
  border-color: var(--amber);
}

.segment.score-2,
.score-badge.score-2 {
  background: var(--green);
  border-color: var(--green);
}

.wheel-icon {
  position: absolute;
  right: -64px;
  top: 50%;
  width: 82px;
  text-align: center;
  transform-origin: center;
}

.icon-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0 auto 4px;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 18px;
  font-weight: 780;
}

.medicine-icon,
.battery-icon,
.calendar-cancel-icon,
.scales-icon,
.flame-icon {
  position: relative;
  font-size: 0;
}

.flame-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 27px;
  transform: translate(-50%, -52%);
  background: currentColor;
  clip-path: polygon(
    52% 0%,
    69% 23%,
    68% 42%,
    82% 31%,
    95% 51%,
    97% 68%,
    88% 85%,
    70% 97%,
    48% 100%,
    27% 94%,
    10% 80%,
    3% 61%,
    10% 41%,
    25% 22%,
    24% 52%,
    40% 36%
  );
}

.flame-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 61%;
  width: 7px;
  height: 11px;
  transform: translate(-50%, -50%) rotate(9deg);
  border-radius: 58% 42% 62% 38%;
  background: var(--blue-soft);
}

.scales-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 27px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(currentColor 0 0) center 5px / 24px 2px no-repeat,
    linear-gradient(currentColor 0 0) 3px 7px / 2px 8px no-repeat,
    linear-gradient(currentColor 0 0) 25px 7px / 2px 8px no-repeat,
    linear-gradient(currentColor 0 0) center 3px / 2px 21px no-repeat,
    linear-gradient(currentColor 0 0) center 24px / 17px 2px no-repeat;
}

.scales-icon::after {
  content: "";
  position: absolute;
  left: calc(50% - 15px);
  top: calc(50% - 2px);
  width: 10px;
  height: 6px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  filter: drop-shadow(20px 0 0 currentColor);
}

.medicine-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 21px;
  transform: translate(-50%, -38%);
  border: 2px solid currentColor;
  border-radius: 3px;
  background:
    linear-gradient(currentColor 0 0) center / 10px 2px no-repeat,
    linear-gradient(currentColor 0 0) center / 2px 10px no-repeat;
}

.medicine-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% - 15px);
  width: 11px;
  height: 5px;
  transform: translateX(-50%);
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}

.battery-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 25px;
  height: 15px;
  padding: 2px;
  transform: translate(-54%, -50%);
  border: 2px solid currentColor;
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      90deg,
      currentColor 0 4px,
      transparent 4px 6px
    ) content-box;
}

.battery-icon::after {
  content: "";
  position: absolute;
  left: calc(50% + 12px);
  top: 50%;
  width: 3px;
  height: 7px;
  transform: translateY(-50%);
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.calendar-cancel-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 21px;
  transform: translate(-50%, -50%);
  border: 2px solid currentColor;
  border-radius: 3px;
  background:
    linear-gradient(currentColor 0 0) 6px 0 / 2px 6px no-repeat,
    linear-gradient(currentColor 0 0) 16px 0 / 2px 6px no-repeat,
    linear-gradient(currentColor 0 0) 0 6px / 100% 2px no-repeat,
    linear-gradient(currentColor 0 0) 5px 11px / 2px 2px no-repeat,
    linear-gradient(currentColor 0 0) 11px 11px / 2px 2px no-repeat,
    linear-gradient(currentColor 0 0) 17px 11px / 2px 2px no-repeat,
    linear-gradient(currentColor 0 0) 5px 16px / 2px 2px no-repeat,
    linear-gradient(currentColor 0 0) 11px 16px / 2px 2px no-repeat;
}

.calendar-cancel-icon::after {
  content: "";
  position: absolute;
  left: calc(50% + 6px);
  top: calc(50% + 6px);
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 1px;
  background:
    linear-gradient(
      45deg,
      transparent 45%,
      currentColor 45% 55%,
      transparent 55%
    ),
    linear-gradient(
      -45deg,
      transparent 45%,
      currentColor 45% 55%,
      transparent 55%
    ),
    var(--blue-soft);
}

.icon-label {
  display: block;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--hub-size);
  height: var(--hub-size);
  transform: translate(-50%, -50%);
  z-index: 2;
  display: grid;
  place-content: center;
  text-align: center;
  border: 8px solid white;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  box-shadow: 0 13px 30px rgba(12, 94, 130, 0.24);
}

.hub-score {
  font-size: 48px;
  font-weight: 790;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.hub-total {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.response-summary {
  padding: 32px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.summary-kicker {
  margin-bottom: 8px;
  font-size: 10px;
}

.summary-header h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.edit-button {
  color: var(--blue);
}

.response-summary ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.response-summary li {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f2;
}

.summary-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 18px;
  font-weight: 760;
}

.score-badge {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: white;
  font-size: 13px;
  font-weight: 780;
}

.summary-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.summary-text strong {
  font-size: 13px;
  line-height: 1.35;
}

.summary-text small {
  color: var(--muted);
}

.results-actions {
  max-width: 700px;
  margin: 32px auto 0;
  text-align: center;
}

.results-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.secondary-button {
  min-width: 145px;
  color: var(--blue);
  border: 1.5px solid #93c6d6;
  background: var(--blue-soft);
}

.results-actions p {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

footer {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(22, 51, 60, 0.09);
  color: var(--muted);
  font-size: 12px;
}

footer a {
  color: var(--blue);
  text-decoration: none;
}

.landing-footer {
  flex-wrap: wrap;
  row-gap: 12px;
  padding: 16px 0;
}

.privacy-note {
  flex: 0 0 100%;
  margin: 0;
  text-align: center;
  line-height: 1.55;
}

.privacy-note strong {
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
label:has(input:focus-visible) {
  outline: 3px solid rgba(20, 120, 164, 0.35);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .intro-panel {
    grid-template-columns: 1fr minmax(330px, 0.7fr);
  }

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

  .response-summary {
    min-height: auto;
  }

  .wheel-card {
    min-height: 700px;
  }

  .response-summary {
    max-width: 650px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 20px;
  }

  .topbar {
    min-height: 70px;
  }

  .intro-panel {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 60px 0 75px;
  }

  .intro-copy h1 {
    font-size: clamp(2.8rem, 13vw, 4.4rem);
  }

  .intro-orbit {
    width: min(92vw, 430px);
  }

  .question-layout {
    padding-top: 34px;
  }

  .answer-list {
    grid-template-columns: 1fr;
  }

  .answer-option {
    min-height: 58px;
  }

  .question-actions .primary-button {
    gap: 24px;
  }

  .results-grid {
    margin-left: -20px;
    margin-right: -20px;
  }

  .wheel-card {
    min-height: 520px;
    padding: 38px 2px 52px;
    overflow: hidden;
  }

  .wheel {
    --wheel-size: min(100vw, 410px);
    --hub-size: 96px;
    transform: scale(0.78);
    margin: -10px auto;
  }

  .spoke {
    height: 42px;
  }

  .segments {
    padding-right: 34px;
    gap: 3px;
  }

  .segment {
    height: 21px;
  }

  .wheel-icon {
    right: -34px;
    width: 72px;
  }

  .icon-mark {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .icon-label {
    font-size: 8px;
  }

  .hub {
    border-width: 6px;
  }

  .hub-score {
    font-size: 38px;
  }

  .response-summary {
    padding: 25px 22px;
  }

  .results-buttons {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  footer {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: center;
  }

  footer a {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
