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

:root {
  --green: #2d6a4f;
  --green-lt: #52b788;
  --green-bg: #d8f3dc;
  --accent: #1b4332;
  --white: #ffffff;
  --text: #1a2e1f;
  --muted: #4a7c59;
  --radius: 16px;
}

body {
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
  background: #d8f3dc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── LANDING SCREEN ── */
#screen-landing {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

/* .landing-left {} */

.landing-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(45, 106, 79, 0.12);
  border: 1px solid rgba(45, 106, 79, 0.25);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 24px;
}
.landing-tag-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}
.landing-tag span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}

.landing-h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.landing-h1 em {
  color: var(--green-lt);
  font-style: italic;
}

.landing-p {
  padding-left: 10px;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 32px;
  font-weight: 300;
}

.landing-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.landing-pill {
  background: rgba(45, 106, 79, 0.1);
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.btn-start {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 16px 36px;
  border-radius: 12px;
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, transform 0.2s;
  letter-spacing: 0.02em;
}
.btn-start:hover {
  background: var(--green);
  transform: translateY(-2px);
}
.btn-start svg {
  width: 18px;
  height: 18px;
}
/* Arrow nudge animation on Start Quiz button */
.btn-start svg {
  display: inline-block;
  animation: nudge 1.4s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(15px);
    opacity: 0.6;
  }
}
.landing-right {
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-img-wrap {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  box-shadow: 0 8px 28px #0a4d3c;
}

/* ── QUIZ SCREEN ── */
#screen-quiz {
  display: none;
  width: 100%;
  max-width: 680px;
}

.quiz-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 52px 40px;
  box-shadow: 0 20px 60px #2d6a4f;
}

/* Progress */
.quiz-progress-wrap {
  margin-bottom: 32px;
}
.quiz-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.quiz-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.quiz-step-count {
  font-size: 12px;
  color: var(--muted);
}
.progress-bar-track {
  height: 4px;
  background: rgba(45, 106, 79, 0.12);
  border-radius: 100px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question */
.quiz-q-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green-lt);
  margin-bottom: 12px;
}
.quiz-q-text {
  font-family: "Fraunces", serif;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

/* Name input */
.quiz-input-wrap {
  margin-bottom: 8px;
}
.quiz-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid rgba(45, 106, 79, 0.25);
  border-radius: 12px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  transition: border-color 0.2s;
}
.quiz-input:focus {
  border-color: var(--green);
}
.quiz-input::placeholder {
  color: #aaa;
}

/* Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(45, 106, 79, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  user-select: none;
}
.quiz-option:hover {
  border-color: var(--green-lt);
  background: rgba(82, 183, 136, 0.08);
  transform: translateX(4px);
}
.quiz-option.selected {
  border-color: var(--green);
  background: rgba(45, 106, 79, 0.1);
}

.option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(45, 106, 79, 0.3);
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-option.selected .option-radio {
  border-color: var(--green);
  background: var(--green);
}
.option-radio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s, transform 0.2s;
}
.quiz-option.selected .option-radio-dot {
  opacity: 1;
  transform: scale(1);
}

.option-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.4;
}
.quiz-option.selected .option-label {
  font-weight: 500;
  color: var(--accent);
}

/* Nav buttons */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 32px;
}
.btn-back {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid rgba(45, 106, 79, 0.2);
  padding: 12px 24px;
  border-radius: 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-back:hover {
  border-color: var(--green);
  color: var(--green);
}
.btn-next {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 28px;
  border-radius: 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-next:hover {
  background: var(--green);
  transform: translateY(-1px);
}
.btn-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── RESULT SCREEN ── */
#screen-result {
  display: none;
  width: 100%;
  max-width: 680px;
}

.result-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 30px 48px;
  box-shadow: 0 20px 60px rgba(27, 67, 50, 0.12);
  text-align: center;
}

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(45, 106, 79, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}

.result-name {
  font-family: "Fraunces", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.result-label {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--green-lt);
  margin-bottom: 11px;
}

.result-profile {
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}
.result-profile em {
  color: var(--green);
  font-style: italic;
}

.result-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.result-badge {
  background: rgba(45, 106, 79, 0.1);
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
}

.btn-restart,
.btn-get-portfolio {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin: 10px auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-restart:hover {
  background: var(--green);
}

/* Saving indicator */
.saving-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Risk Profile LEFT Animation (Section 3 style) */
#screen-landing .landing-left {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

#screen-landing.visible .landing-left {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle title + pills wiggle */
.landing-h1,
.landing-meta {
  opacity: 0;
  transform: translateY(25px);
  transition: all 0.8s ease;
}

#screen-landing.visible .landing-h1 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

#screen-landing.visible .landing-meta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

/* Button bounce */
.btn-start {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#screen-landing.visible .btn-start {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.4s;
}

/* ══════════════════════════════════════════════════
   TIMEFRAME + CHART
   ══════════════════════════════════════════════════ */

/* Side-by-side wrapper */
.tf-wrapper {
  display: grid;
  grid-template-columns: 30em 1fr;
  align-items: start;
  width: 100%;
}

/* Input card — uses existing .quiz-card */
.tf-input-card {
  flex-shrink: 0;
}

.tf-heading {
  font-family: "Fraunces", serif;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 28px;
}

.tf-info-row {
  margin-bottom: 22px;
}

.tf-info-box {
  background: rgba(45, 106, 79, 0.07);
  border: 1px solid rgba(45, 106, 79, 0.18);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#tf-age-box {
  display: none;
}
.tf-info-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-lt);
  text-align: center;
}

.tf-info-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.25;
  text-align: center;
}

.tf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.tf-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-select {
  width: 100%;
  padding: 14px 42px 14px 18px;
  border: 1.5px solid rgba(45, 106, 79, 0.25);
  border-radius: 12px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232d6a4f' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color 0.2s;
}

.tf-select:focus {
  border-color: var(--green);
}

.tf-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

/* ── Chart panel — no card, no shadow ── */
.tf-chart-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  animation: tf-fadein 0.5s ease both;
}

/* Chart + legend side by side */
.tf-chart-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: 6em;
}

@keyframes tf-fadein {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tf-chart-heading {
  font-size: 23px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  letter-spacing: 1.5px;
  margin: 0;
  width: 100%;
}

#tf-pie-canvas {
  display: block;
  width: 340px;
  height: 340px;
}

/* SVG inside the pie container — fills the div */
#tf-pie-canvas svg {
  display: block;
  width: 340px;
  height: 340px;
}

/* Legend — stacked vertically on right of chart */
.tf-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
}

.tf-legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tf-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.tf-legend-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  flex: 1;
}

@media screen and (min-width: 1601px) and (max-width: 1920px) {
  /* Styles for laptops and high-res desktops */
  .quiz-card {
    padding: 37px 40px;
  }
}
/* Mobile: stack vertically */
@media (max-width: 820px) {
  .tf-wrapper {
    grid-template-columns: 1fr;
  }
  #tf-pie-canvas {
    width: 280px !important;
    height: 280px !important;
  }
  .tf-legend {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    display: block;
    text-align: center;
  }
  .tf-chart-panel {
    padding-left: 0em;
    margin-top: 30px;
    padding-bottom: 4em;
  }
}
@media (max-width: 768px) {
  body {
    min-height: 87vh;
  }
  #screen-landing {
    grid-template-columns: 1fr;
    gap: 15px; /* Reduced gap */
  }

  .landing-right {
    display: block !important; /* Show SVG on mobile */
  }

  .landing-tag {
    margin-bottom: 10px;
  }

  .landing-img-wrap {
    padding: 0 20px; /* Smaller padding */
    min-height: 220px; /* Smaller height */
    margin: 0 auto; /* Center */
  }

  /* Scale SVG responsively */
  .landing-img-wrap svg {
    max-height: 70vw; /* Fit viewport width */
    width: 100%;
  }

  .quiz-card,
  .result-card {
    padding: 32px 20px; /* Slightly smaller */
  }
  .landing-p {
    font-size: 13px;
    margin-bottom: 16px;
  }
  .landing-h1 {
    font-size: clamp(32px, 5vw, 56px);
    margin-bottom: 14px;
  }
  .landing-meta {
    margin-bottom: 20px;
  }
  .btn-start {
    padding: 10px 24px;
  }
  .btn-restart,
  .btn-get-portfolio {
    margin: 6px auto;
  }
  .tf-chart-inner {
    display: grid;
    gap: 8em;
    margin-left: 0;
  }
  .tf-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
  }
  .tf-legend-dot {
    margin-left: 10px;
  }
}
@media (max-width: 480px) {
  .tf-info-row {
    grid-template-columns: 1fr;
  }
  .tf-legend {
    grid-template-columns: 1fr;
  }
  #tf-pie-canvas {
    width: 240px !important;
    height: 240px !important;
    margin-right: 6em;
  }
}

/* ── RESULT CARD ADDITIONS ── */

.result-headline {
  font-family: "Fraunces", serif;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.result-subtext {
  font-size: 15px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 20px;
}

.result-traits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}

.result-trait {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(45, 106, 79, 0.05);
  border: 1px solid rgba(45, 106, 79, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
}

.result-trait-full {
  grid-column: 1 / -1;
}

.trait-icon {
  width: 16px;
  height: 16px;
  margin-top: 9px;
}

.trait-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-lt);
  margin-bottom: 3px;
}

.trait-value {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.45;
}

.result-icon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

@media (max-width: 600px) {
  .result-traits {
    grid-template-columns: 1fr;
  }
  .result-trait-full {
    grid-column: 1;
  }
}

/* Arrow nudge animation on Build my Portfolio button on select timeframe card*/
#tf-btn-submit svg {
  display: inline-block;
  animation: nudge 1.4s ease-in-out infinite;
}

/* Arrow nudge animation on Dynamic button */
.btn-get-portfolio svg {
  display: inline-block;
  animation: nudge 1.4s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(12px);
    opacity: 0.6;
  }
}
