:root {
  --ink: #06283a;
  --navy: #041b29;
  --navy2: #07344b;
  --blue: #0b6f8f;
  --sky: #50cce8;
  --green: #24e6d3;
  --lime: #a7f03d;
  --violet: #7058ff;
  --coral: #ff6b4a;
  --white: #ffffff;
  --ice: #eaf8fa;
  --light: #f7fbfb;
  --line: #dce7ea;
  --text: #06283a;
  --muted: #627581;
  --shadow: 0 25px 70px rgba(6, 40, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 9% 10%, rgba(36, 230, 211, 0.18), transparent 26rem),
    radial-gradient(circle at 92% 15%, rgba(112, 88, 255, 0.13), transparent 25rem),
    radial-gradient(circle at 72% 92%, rgba(255, 107, 74, 0.11), transparent 24rem),
    var(--white);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  color: var(--navy);
  background: linear-gradient(135deg, var(--green), var(--lime));
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(36, 230, 211, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(13, 59, 102, 0.24);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.secondary {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: none;
}

.success {
  background: var(--green);
}

.hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 76px;
  padding: 0 clamp(24px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 30px rgba(6, 40, 58, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 148px;
  height: 58px;
  object-fit: contain;
}

.brand-kicker,
.eyebrow {
  display: block;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.21em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 3px;
  background: var(--green);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: #078b83;
  background: rgba(36, 230, 211, 0.12);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 700;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero-screen {
  min-height: calc(100vh - 76px);
  height: calc(100vh - 76px);
  display: none;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 0;
  align-items: center;
  padding-left: clamp(25px, 7vw, 110px);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.96) 0 56%, rgba(234, 248, 250, 0.94) 56%),
    radial-gradient(circle at 61% 15%, rgba(36, 230, 211, 0.38), transparent 20rem),
    radial-gradient(circle at 94% 80%, rgba(112, 88, 255, 0.22), transparent 20rem);
}

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

.hero-content h1 {
  max-width: 840px;
  margin: 0.45rem 0 0.8rem;
  color: var(--ink);
  font-size: clamp(2.45rem, 4.9vw, 4.45rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.5;
}

.start-form {
  max-width: 760px;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.start-form label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--navy);
  font-weight: 800;
}

.field-group {
  margin-bottom: 0.68rem;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.field-group input,
.field-group select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.78rem 0.95rem;
  color: var(--text);
  background: var(--white);
}

.field-group select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(100% - 20px) center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(100% - 15px) center / 7px 7px no-repeat,
    var(--white);
}

.note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.hero-panel {
  position: relative;
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 1rem;
  min-height: min(520px, calc(100vh - 118px));
  height: min(520px, calc(100vh - 118px));
  margin: 52px 30px 18px -18px;
  padding: 1.3rem;
  overflow: visible;
  border-radius: 46% 12% 18% 42% / 20% 14% 24% 30%;
  background:
    linear-gradient(90deg, rgba(6, 40, 58, 0.72), rgba(6, 40, 58, 0.48)),
    radial-gradient(circle at 80% 20%, rgba(167, 240, 61, 0.25), transparent 18rem),
    radial-gradient(circle at 12% 86%, rgba(112, 88, 255, 0.35), transparent 18rem),
    linear-gradient(145deg, var(--navy), #0c4159);
  box-shadow: 0 28px 70px rgba(6, 40, 58, 0.18);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(36, 230, 211, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 230, 211, 0.08) 1px, transparent 1px);
  background-size: 55px 55px;
  mask-image: linear-gradient(to bottom, black, transparent);
  border-radius: inherit;
}

.hero-person-window {
  position: absolute;
  inset: -54px 0 0;
  z-index: 2;
  overflow: hidden;
  border-radius: 46% 12% 18% 42% / 20% 14% 24% 30%;
  pointer-events: none;
}

.hero-person {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: auto;
  height: 104%;
  max-height: none;
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%);
  filter: drop-shadow(0 28px 28px rgba(0, 0, 0, 0.24));
}

.quiz-screen,
.result-screen {
  width: min(1180px, calc(100% - 28px));
  max-width: none;
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 30px) 14px 28px;
}

.quiz-screen {
  min-height: calc(100vh - 76px);
  height: calc(100vh - 76px);
  display: none;
}

.quiz-screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-header,
.result-hero,
.course-card-head,
.course-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.quiz-header h2,
.result-hero h2 {
  margin: 0.25rem 0 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.55vw, 2.2rem);
  letter-spacing: -0.045em;
}

.progress-track {
  height: 8px;
  margin: 0.85rem 0;
  border-radius: 999px;
  background: #d9e8f2;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.25s ease;
}

.question-card,
.result-hero,
.recommendation-card,
.analysis-grid section,
.chart-section {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.question-card {
  padding: clamp(1rem, 2.2vw, 1.55rem);
  max-height: none;
  overflow: visible;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.question-meta span {
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  color: #087f77;
  background: rgba(36, 230, 211, 0.12);
  font-size: 0.84rem;
  font-weight: 800;
}

.question-card h3 {
  margin: 0 0 0.9rem;
  color: var(--ink);
  font-size: clamp(1.1rem, 1.75vw, 1.55rem);
  line-height: 1.24;
}

.options-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.option-card {
  width: 100%;
  min-height: 54px;
  padding: 0.78rem 0.95rem;
  text-align: left;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: none;
  font-weight: 400;
}

.option-card.selected {
  color: var(--navy);
  border-color: rgba(36, 230, 211, 0.7);
  background: var(--green);
  font-weight: 400;
}

.needs-answer {
  animation: pulse-alert 0.7s ease;
}

@keyframes pulse-alert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 27, 41, 0.72);
  backdrop-filter: blur(8px);
}

.analysis-box {
  width: min(520px, 100%);
  padding: 2rem;
  border-radius: 4px;
  text-align: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.loader {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 5px solid #d5eaf6;
  border-top-color: var(--green);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

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

.result-hero {
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: linear-gradient(115deg, #fff 0 58%, var(--ice) 58%);
}

.result-hero p {
  color: var(--muted);
  line-height: 1.6;
}

.score-ring {
  display: grid;
  place-items: center;
  flex: 0 0 170px;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  color: var(--ink);
  background:
    radial-gradient(circle at center, var(--white) 58%, transparent 59%),
    conic-gradient(var(--green), var(--sky), var(--blue));
  text-align: center;
}

.score-ring span {
  display: block;
  font-size: 2.2rem;
  font-weight: 900;
}

.score-ring small {
  display: block;
  max-width: 110px;
  color: var(--muted);
  font-weight: 700;
}

.recommendation-card,
.chart-section {
  margin-top: 1rem;
  padding: clamp(1.2rem, 3vw, 1.7rem);
}

.recommendation-card h3 {
  margin: 0.35rem 0;
  color: var(--ink);
  font-size: 1.55rem;
}

.next-course {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.analysis-grid section {
  padding: 1.3rem;
}

.analysis-grid h3,
.chart-section h3 {
  margin: 0 0 0.7rem;
  color: var(--ink);
}

.course-results {
  display: grid;
  gap: 1rem;
}

.course-card {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: stretch;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.course-card h4 {
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.course-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.course-card strong {
  color: var(--blue);
  font-size: 1.6rem;
}

.course-card-foot {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.gap-chart {
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  gap: 0.35rem;
  min-height: 190px;
  padding: 1rem;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--ice), #ffffff);
}

.gap-chart-bar {
  display: flex;
  align-items: flex-end;
  width: 52px;
  height: 100%;
  min-height: 120px;
  border-radius: 999px;
  background: #d9e8f2;
  overflow: hidden;
}

.gap-chart-bar span {
  display: block;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--coral), var(--violet));
}

.gap-chart strong {
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
}

.gap-chart small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.closing-message {
  margin: 1rem 0 0;
  padding: 1rem;
  border-left: 4px solid var(--green);
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
}

@media (max-width: 780px) {
  .app-shell {
    width: 100%;
  }

  .topbar,
  .quiz-header,
  .result-hero,
  .course-card-head,
  .course-card-foot,
  .nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-screen.active {
    display: block;
    height: auto;
    min-height: calc(100vh - 76px);
    padding: 32px 20px 20px;
    background: var(--white);
  }

  .hero-panel {
    margin-top: 1.2rem;
    min-height: 330px;
    height: 330px;
    margin-left: 0;
    margin-right: 0;
    border-radius: 44% 48% 14% 16% / 18% 22% 12% 14%;
    overflow: hidden;
  }

  .input-row,
  .analysis-grid,
  .course-card,
  .options-list {
    grid-template-columns: 1fr;
  }

  .question-card {
    max-height: 62vh;
    overflow: auto;
  }

  .score-ring {
    width: 148px;
    height: 148px;
    flex-basis: auto;
    align-self: center;
  }
}

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

  .topbar,
  .nav-actions,
  .analysis-overlay {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .result-screen {
    display: block !important;
  }
}
