/* styles.css */
:root{
  color-scheme: dark light;
  --bg: #0b0f14;
  --card: rgba(255,255,255,.045);
  --card2: rgba(255,255,255,.03);
  --text: #eaf0fb;
  --text-strong: #f8fbff;
  --muted: rgba(234,240,251,.82);
  --border: rgba(255,255,255,.12);
  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --primary: #5c8bff;
  --primary2:#2dd4bf;
  --danger: #ff6b85;
  --success: #30d399;
  --chip: rgba(255,255,255,.08);
}

@media (prefers-color-scheme: light){
  :root{
    --bg: #f5f7fb;
    --card: rgba(255,255,255,.95);
    --card2: rgba(255,255,255,.86);
    --text: #151a22;
    --text-strong: #0c1118;
    --muted: rgba(21,26,34,.78);
    --border: rgba(21,26,34,.12);
    --shadow: 0 18px 40px rgba(16,20,28,.12);
    --chip: rgba(21,26,34,.06);
  }
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1000px 650px at 12% 0%, rgba(79,124,255,.18), transparent 60%),
    radial-gradient(900px 600px at 92% 10%, rgba(45,212,191,.14), transparent 55%),
    var(--bg);
  line-height: 1.6;
}

.wrap{ max-width: 980px; margin: 0 auto; padding: 20px; }
.header{
  display:flex; align-items:flex-start; justify-content:space-between; gap: 16px;
  padding-top: 24px;
}
.brand{ display:flex; gap: 14px; align-items:flex-start; }
.logo{
  width: 44px; height: 44px;
  display:grid; place-items:center;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(79,124,255,.22), rgba(45,212,191,.14));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 900;
}

h1{ margin:0 0 6px; font-size: clamp(20px, 2vw, 26px); letter-spacing:.2px; line-height: 1.2; }
h2{ margin:0 0 12px; font-size: clamp(18px, 2vw, 22px); line-height: 1.3; }
h3{ margin:0 0 10px; font-size: clamp(16px, 1.5vw, 18px); }

.lead{ margin: 8px 0 12px; }
.muted{ color: var(--muted); }
.small{ font-size: 12.5px; }
.small.list{ font-size: 12.5px; }

.header-actions{ display:flex; gap: 10px; align-items:center; }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.inner{
  margin-top: 14px;
  background: var(--card2);
}
.hidden{ display:none; }

.fade-in{ animation: fadeSlide .35s ease; }
.step-enter{ animation: stepFade .25s ease; }

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

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

.btn{
  appearance:none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
  user-select:none;
  font-weight: 600;
}
.btn:hover{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn.primary{
  background: linear-gradient(180deg, rgba(92,139,255,.95), rgba(79,124,255,.75));
  border-color: rgba(92,139,255,.85);
}
.btn.primary:hover{
  background: linear-gradient(180deg, rgba(92,139,255,1), rgba(79,124,255,.85));
}
.btn.ghost{ background: transparent; }

.list{ margin: 0 0 14px; padding-left: 18px; }
.list li{ margin: 8px 0; }

.guide{
  border: 1px solid rgba(92,139,255,.22);
  background: rgba(92,139,255,.08);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.guide summary{
  cursor: pointer;
  font-weight: 700;
  color: var(--text-strong);
}
.guide-body{ margin-top: 8px; }
.guide .list{ margin-bottom: 6px; }

.intro-meta{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}
.meta-item{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255,255,255,.04);
  font-size: 12.5px;
}

.notice{
  border:1px solid rgba(79,124,255,.25);
  background: rgba(79,124,255,.08);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
}
.notice p{ margin:0; }

.disclaimer{
  border:1px solid rgba(255,92,122,.35);
  background: rgba(255,92,122,.07);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0 14px;
}
.disclaimer p{ margin:0; }

.row{ display:flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.survey-header{ display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; }
.topline{
  display:flex; align-items:center; justify-content:space-between; gap: 10px;
  margin-bottom: 10px;
}
.pill{
  display:inline-flex; align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  font-size: 12.5px;
  color: var(--muted);
}

.progress{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  overflow:hidden;
  position: sticky;
  top: 10px;
}
.progress-bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(92,139,255,.98), rgba(45,212,191,.90));
  transition: width .4s ease;
}

.question{
  margin: 14px 0 8px;
  line-height: 1.5;
  font-size: clamp(20px, 2.4vw, 26px);
}

.scale{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 6px;
}
.option{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 10px;
  cursor:pointer;
  min-height: 76px;
  display:flex;
  flex-direction:column;
  gap:8px;
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.option strong{ font-size: 15px; color: var(--text-strong); }
.option span{ font-size: 12px; color: var(--muted); }
.option input{ display:none; }
.option .chip{
  align-self:flex-start;
  background: var(--chip);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.option:hover{
  border-color: rgba(92,139,255,.55);
  box-shadow: 0 0 0 2px rgba(92,139,255,.15);
  transform: translateY(-1px);
}
.option:active{ transform: translateY(0); }
.option.selected{
  border-color: rgba(92,139,255,.85);
  background: rgba(92,139,255,.12);
  box-shadow: 0 0 0 2px rgba(92,139,255,.3), 0 6px 16px rgba(92,139,255,.18);
  transform: translateY(-1px) scale(1.01);
}

.quick-select{
  display:flex;
  gap: 8px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}
.quick-select button{
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12.5px;
  background: rgba(255,255,255,.03);
}

.nav{
  display:flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 8px;
}
.nav .btn{ flex:1; }
.nav .btn.primary{ flex: 1.2; }

.review-header{ margin-bottom: 12px; }
.review-list{ display:flex; flex-direction:column; gap: 8px; }
.review-item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.review-item button{
  background: transparent;
  border: none;
  color: inherit;
  text-align:left;
  padding: 0;
  width: 100%;
  cursor: pointer;
  font-size: 14px;
}
.review-score{ font-weight: 700; color: var(--primary2); }

.results-header{
  display:flex; align-items:flex-start; justify-content:space-between; gap: 10px;
  flex-wrap: wrap;
}
.results-actions{ display:flex; gap: 10px; flex-wrap: wrap; }
.total{ margin: 14px 0 10px; }
.total-score{
  font-size: clamp(40px, 6vw, 52px);
  font-weight: 900;
  letter-spacing: .6px;
}
.interpretation{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.03);
}
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.subcard{
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.02);
}
.subtop{
  display:flex; justify-content:space-between; align-items:center; gap: 10px;
}
.subname{ font-weight: 800; }
.subscore{ font-weight: 900; }
.bar{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  overflow:hidden;
  margin-top: 10px;
}
.bar > div{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(92,139,255,.98), rgba(45,212,191,.90));
}

.focus-list{ display:flex; flex-direction:column; gap: 10px; margin-top: 10px; }
.focus-item{ border-left: 3px solid rgba(92,139,255,.8); padding-left: 10px; }
.focus-item strong{ display:block; margin-bottom: 4px; }

.actions{ display:flex; flex-direction:column; gap: 10px; margin-top: 10px; }
.action{
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.02);
}
.action h4{ margin:0 0 8px; font-size: 15px; color: var(--text-strong); }
.action ul{ margin:0; padding-left: 18px; }
.action li{ margin: 6px 0; color: var(--text); font-size: 15px; line-height: 1.5; }

.footer{ padding-bottom: 28px; }

@media (max-width: 720px){
  .header{ flex-direction:column; align-items:stretch; }
  .header-actions{ justify-content:flex-end; }
  .scale{ grid-template-columns: 1fr; }
  .option{
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    min-height:auto;
  }
  .quick-select{ display:none; }
  .grid{ grid-template-columns: 1fr; }
  .nav.sticky{
    position: sticky;
    bottom: 12px;
    background: var(--card);
    padding: 10px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

@media print{
  body{ background: white; color: #000; }
  header, footer, #view_intro, #view_survey, #view_review, .results-actions, .row{ display:none !important; }
  #view_results{ display:block !important; border: none; box-shadow: none; }
  .card{ box-shadow: none; border: 1px solid #ccc; }
}
