:root {
  --background: hsl(35 60% 95%);
  --foreground: hsl(205 60% 14%);
  --card: hsl(35 60% 97%);
  --primary: hsl(186 60% 42%);
  --primary-foreground: hsl(35 60% 95%);
  --primary-glow: hsl(186 70% 55%);
  --secondary: hsl(205 60% 14%);
  --secondary-foreground: hsl(35 60% 95%);
  --muted: hsl(35 40% 90%);
  --muted-foreground: hsl(205 25% 35%);
  --accent: hsl(186 50% 88%);
  --accent-foreground: hsl(205 60% 14%);
  --border: hsl(35 30% 85%);
  --input: hsl(35 30% 85%);
  --ring: hsl(186 60% 42%);
  --radius: 1rem;

  --gradient-hero: radial-gradient(ellipse at 20% 10%, hsl(186 70% 80% / 0.55), transparent 55%),
    radial-gradient(ellipse at 85% 20%, hsl(35 90% 85% / 0.6), transparent 50%),
    radial-gradient(ellipse at 50% 90%, hsl(186 60% 70% / 0.35), transparent 60%),
    linear-gradient(180deg, hsl(35 60% 96%), hsl(35 55% 92%));
  --gradient-cta: linear-gradient(135deg, hsl(186 60% 35%), hsl(186 70% 50%));
  --gradient-card: linear-gradient(160deg, hsl(35 60% 99%), hsl(35 50% 94%));

  --shadow-soft: 0 10px 30px -12px hsl(205 60% 14% / 0.18);
  --shadow-glow: 0 20px 60px -20px hsl(186 60% 42% / 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foreground);
  font-family: "Inter", system-ui, sans-serif;
  background: var(--gradient-hero);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.diag-shell {
  min-height: 100vh;
  padding: 24px 16px 48px;
}

.diag-container {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.diag-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.diag-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  font-weight: 700;
}

.diag-brand img {
  width: 34px;
  height: 34px;
}

.diag-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid hsla(35, 30%, 85%, 0.9);
  color: var(--foreground);
}

.diag-card {
  background: var(--card);
  border: 1px solid hsla(35, 30%, 85%, 0.95);
  border-radius: calc(var(--radius) * 1.25);
  box-shadow: var(--shadow-soft);
}

.quiz-card {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quiz-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-step {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.quiz-pillar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(54, 167, 183, 0.09);
  color: hsl(186 60% 30%);
  font-size: 0.9rem;
  font-weight: 700;
}

.quiz-pillar::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: hsl(186 60% 42%);
}

.progress {
  width: 100%;
  height: 12px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 18px;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: hsl(186 60% 42%);
  border-radius: inherit;
  transition: width 220ms ease;
}

.quiz-title,
.result-title,
.section-title {
  font-family: "Sora", "Inter", sans-serif;
  letter-spacing: -0.02em;
}

.quiz-title {
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 18px;
}

.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid hsla(35, 30%, 85%, 0.95);
  background: hsl(35 60% 99%);
  color: var(--foreground);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.quiz-option:hover {
  transform: translateY(-2px);
  border-color: hsla(186, 60%, 42%, 0.28);
}

.quiz-option.is-selected {
  border-color: hsl(186 60% 42%);
  background: var(--accent);
  box-shadow: var(--shadow-glow);
}

.quiz-option__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.quiz-option__dot--red { background: #ef4444; }
.quiz-option__dot--yellow { background: #f59e0b; }
.quiz-option__dot--green { background: #22c55e; }

.form-layout {
  display: grid;
  gap: 24px;
  align-items: start;
}

.form-copy,
.form-card {
  padding: 24px;
}

.form-copy .section-title,
.result-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
  margin: 0 0 14px;
}

.highlight {
  color: hsl(186 60% 42%);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}

.checklist li {
  position: relative;
  padding-left: 24px;
  color: var(--muted-foreground);
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: hsl(186 60% 42%);
  box-shadow: 0 0 18px hsl(186 60% 42% / 0.22);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.fieldset-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--foreground);
}

.input,
.select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--input);
  background: var(--background);
  border-radius: 14px;
  color: var(--foreground);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input:focus,
.select:focus {
  border-color: hsl(186 60% 42%);
  box-shadow: 0 0 0 4px hsl(186 60% 42% / 0.12);
}

.field.is-error .input,
.field.is-error .select,
.checkbox-row.is-error {
  border-color: #ef4444;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.checkbox-row input {
  margin-top: 3px;
}

.checkbox-row span {
  color: var(--muted-foreground);
  line-height: 1.5;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.btn-primary {
  color: var(--primary-foreground);
  background: var(--gradient-cta);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.52);
  border-color: hsla(35, 30%, 85%, 0.95);
}

.helper-text,
.error-text {
  margin: 8px 0 0;
  font-size: 0.92rem;
}

.field-error {
  margin: 2px 0 0;
  min-height: 1.1em;
  font-size: 0.82rem;
  color: #b91c1c;
}

.helper-text {
  color: var(--muted-foreground);
}

.error-text {
  color: #b91c1c;
}

.result-shell {
  display: grid;
  gap: 18px;
}

.result-card {
  padding: 22px;
}

.result-header {
  display: grid;
  gap: 8px;
}

.report-logo {
  width: 132px;
  height: auto;
  display: block;
  margin-bottom: 8px;
}

.pdf-only {
  display: none;
}

.result-subtitle {
  color: var(--muted-foreground);
}

.overall-card {
  display: grid;
  gap: 14px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.83rem;
  line-height: 1;
  font-weight: 700;
}

.level-badge--red {
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
}

.level-badge--yellow {
  background: rgba(245, 158, 11, 0.16);
  color: #9a6700;
}

.level-badge--green {
  background: rgba(34, 197, 94, 0.13);
  color: #166534;
}

.level-badge--teal {
  background: rgba(54, 167, 183, 0.14);
  color: #36a7b7;
}

.level-summary {
  font-size: clamp(2rem, 5vw, 3.1rem);
  margin: 0;
  color: hsl(205 60% 14%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.overall-card .level-summary {
  display: inline-block;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, hsla(186, 60%, 42%, 0.12), hsla(35, 90%, 85%, 0.42));
  border: 1px solid hsla(186, 60%, 42%, 0.18);
  box-shadow: 0 10px 30px -12px hsl(205 60% 14% / 0.14);
}
.overall-card .level-summary--red {
  color: #991b1b;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(254, 226, 226, 0.76));
  border-color: rgba(239, 68, 68, 0.28);
  box-shadow: 0 10px 30px -12px rgba(239, 68, 68, 0.18);
}
.overall-card .level-summary--yellow {
  color: #9a6700;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(255, 243, 205, 0.72));
  border-color: rgba(245, 158, 11, 0.24);
}
.overall-card .level-summary--green {
  color: #166534;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(220, 252, 231, 0.72));
  border-color: rgba(34, 197, 94, 0.22);
}

.results-grid,
.pillar-grid,
.points-grid,
.actions-grid {
  display: grid;
  gap: 18px;
}

.chart-wrap {
  position: relative;
  min-height: 320px;
}

.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0 auto;
}

.pillar-card,
.point-card,
.closing-card {
  padding: 20px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid hsla(35, 30%, 85%, 0.95);
  box-shadow: var(--shadow-soft);
}

.pillar-head,
.point-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.point-card--strong {
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.10), hsl(35 60% 97%));
  border-color: rgba(34, 197, 94, 0.26);
}

.point-card--attention {
  background: linear-gradient(160deg, rgba(239, 68, 68, 0.12), rgba(254, 242, 242, 0.86));
  border-color: rgba(239, 68, 68, 0.26);
  box-shadow: 0 10px 30px -12px rgba(239, 68, 68, 0.16);
}

.closing-card {
  background:
    radial-gradient(circle at 85% 20%, hsla(186, 70%, 55%, 0.14), transparent 32%),
    radial-gradient(circle at 10% 80%, hsla(35, 90%, 85%, 0.42), transparent 30%),
    var(--gradient-card);
  border-color: hsl(186 60% 42% / 0.32);
  box-shadow: var(--shadow-soft), 0 0 0 1px hsla(186, 60%, 42%, 0.08) inset;
}

.next-steps-section {
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid hsla(35, 30%, 85%, 0.9);
  display: grid;
  gap: 18px;
  page-break-before: always;
  break-before: page;
}

.next-steps-intro {
  display: grid;
  gap: 10px;
}

.next-steps-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.85rem;
  font-weight: 700;
}

.next-steps-intro .section-title {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--foreground);
}

.pdf-export-mode [data-pdf-main],
.pdf-export-mode [data-pdf-next-steps] {
  background: var(--background);
}

.pdf-export-mode .result-shell {
  gap: 16px;
}

.pdf-export-mode .diag-container {
  width: 1240px;
  max-width: none;
}

.pdf-export-mode .diag-shell {
  padding: 10px 12px 14px;
}

.pdf-export-mode .result-card,
.pdf-export-mode .pillar-card,
.pdf-export-mode .point-card,
.pdf-export-mode .closing-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid hsla(35, 30%, 85%, 0.95);
  background: var(--card);
  box-shadow: 0 6px 18px -12px hsl(205 60% 14% / 0.16);
}

.pdf-export-mode .results-grid,
.pdf-export-mode .pillar-grid,
.pdf-export-mode .points-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pdf-export-mode .report-logo {
  width: 92px;
  margin: 0 auto 6px;
}

.pdf-export-mode .quiz-pillar,
.pdf-export-mode .next-steps-kicker {
  padding: 5px 9px;
  font-size: 0.72rem;
}

.pdf-export-mode .result-title {
  font-size: 1.72rem;
  margin-bottom: 6px;
}

.pdf-export-mode .result-header {
  justify-items: center;
  text-align: center;
}

.pdf-export-mode .result-subtitle,
.pdf-export-mode .muted-text,
.pdf-export-mode .point-card p,
.pdf-export-mode .pillar-card p,
.pdf-export-mode .closing-card p {
  font-size: 0.94rem;
  line-height: 1.52;
}

.pdf-export-mode .level-summary {
  font-size: 1.42rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

.pdf-export-mode .section-title {
  font-size: 1.22rem;
}

.pdf-export-mode .level-badge {
  padding: 5px 8px;
  font-size: 0.7rem;
}

.pdf-export-mode .pdf-only {
  display: inline-flex;
}

.pdf-export-mode .overall-card {
  gap: 10px;
}

.pdf-export-mode .overall-card .level-summary--red {
  color: #991b1b;
}

.pdf-export-mode .overall-card .level-summary--yellow {
  color: #9a6700;
}

.pdf-export-mode .overall-card .level-summary--green {
  color: #166534;
}

.pdf-export-mode .chart-wrap {
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-export-mode .next-steps-section {
  margin-top: 18px;
  padding: 16px;
  border-top: 0;
  border: 1px solid hsla(35, 30%, 85%, 0.95);
  border-radius: 18px;
  background: hsl(35 60% 96%);
  gap: 12px;
  page-break-before: auto;
  break-before: auto;
}

.pdf-export-mode .next-steps-intro {
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid hsla(35, 30%, 85%, 0.72);
  justify-items: center;
  text-align: center;
}

.pdf-export-mode .next-steps-intro .section-title {
  font-size: 1.36rem;
  font-weight: 800;
}

.pdf-export-mode .next-steps-intro .muted-text {
  font-size: 0.92rem;
  max-width: 84%;
}

.pdf-export-mode .point-card--strong {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
  box-shadow: 0 6px 18px -12px rgba(34, 197, 94, 0.16);
}

.pdf-export-mode .point-card--attention {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  box-shadow: 0 6px 18px -12px rgba(239, 68, 68, 0.16);
}

.pdf-export-mode .closing-card {
  grid-column: 1 / -1;
  background: hsl(35 60% 97%);
  border-color: hsla(186, 60%, 42%, 0.22);
  box-shadow: 0 6px 18px -12px hsl(205 60% 14% / 0.14);
}

.pdf-export-mode .closing-card .section-title {
  font-size: 1.36rem;
  margin-bottom: 8px;
}

.pdf-export-mode .point-head {
  align-items: flex-start;
}

.pdf-export-mode .pillar-card {
  min-height: 172px;
}

.pdf-export-mode .overall-card .muted-text {
  font-size: 0.94rem;
}

.pdf-export-mode .pillar-card:last-child {
  grid-column: 1 / -1;
}

.pdf-export-mode .overall-card,
.pdf-export-mode .result-card,
.pdf-export-mode .pillar-card,
.pdf-export-mode .point-card,
.pdf-export-mode .closing-card {
  align-content: start;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.divider {
  width: 100%;
  height: 1px;
  background: hsla(35, 30%, 85%, 0.8);
  margin: 6px 0;
}

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

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

@media (min-width: 768px) {
  .diag-shell {
    padding: 28px 24px 56px;
  }

  .quiz-card,
  .form-copy,
  .form-card,
  .result-card,
  .pillar-card,
  .point-card,
  .closing-card {
    padding: 28px;
  }

  .form-layout {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .results-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

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

@media (min-width: 1024px) {
  .pillar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
