/* ════════════════════════════════════════════════════════════════
   dimensions.css — Plearnprai 5-Dimension Wellness Quiz
   ════════════════════════════════════════════════════════════════ */

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

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0fdf4;
  color: #1a1a1a;
  min-height: 100vh;
  line-height: 1.6;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* ─── HEADER ───────────────────────────────────────────────────── */
.dim-header {
  text-align: center;
  padding: 20px 0 16px;
  border-bottom: 2px solid #bbf7d0;
  margin-bottom: 24px;
}
.dim-header .logo { height: 56px; margin-bottom: 8px; }
.dim-header h1 { font-size: 1.5rem; color: #166534; font-weight: 700; }
.dim-header p { font-size: .9rem; color: #6b7280; margin-top: 4px; }

/* ─── CARDS ────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  margin-bottom: 16px;
}
.card h2 { color: #166534; font-size: 1.25rem; margin-bottom: 12px; }
.card h3 { color: #166534; font-size: 1.05rem; margin-bottom: 10px; }
.card h4 { color: #374151; font-size: 1rem; margin-bottom: 8px; text-align: center; }
.card p { color: #374151; font-size: .95rem; }

/* ─── INTRO ────────────────────────────────────────────────────── */
.intro-lead {
  margin-bottom: 16px;
  line-height: 1.75;
  color: #374151;
}

.dim-list { list-style: none; margin: 12px 0 24px; }
.dim-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f0fdf4;
}
.dim-list li:last-child { border: none; }
.dim-list .dl-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0; background: #dcfce7;
}
.dim-list .dl-name { font-weight: 700; color: #166534; }
.dim-list .dl-desc { font-size: .82rem; color: #6b7280; margin-top: 2px; }

.form-section { margin: 20px 0; }
.section-label {
  display: block; font-weight: 700; color: #374151;
  margin-bottom: 10px; font-size: .95rem;
}

.gender-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.gender-btn {
  background: #fff; border: 2px solid #e5e7eb; border-radius: 12px;
  padding: 16px; cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: inherit;
}
.gender-btn:hover { border-color: #86efac; }
.gender-btn.selected {
  border-color: #16a34a; background: #f0fdf4;
}
.gender-btn .g-icon { font-size: 1.8rem; color: #16a34a; }
.gender-btn .g-label { font-weight: 700; color: #374151; }

.intro-note {
  text-align: center; font-size: .82rem; color: #9ca3af; margin-top: 10px;
}

/* ─── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: block; width: 100%;
  padding: 14px; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all .2s; margin-bottom: 10px;
  font-family: inherit;
}
.btn-primary { background: #16a34a; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #15803d; }
.btn-primary:disabled { background: #d1d5db; cursor: not-allowed; }
.btn-secondary {
  background: #fff; color: #16a34a; border: 2px solid #16a34a;
}
.btn-secondary:hover:not(:disabled) { background: #f0fdf4; }
.btn-secondary:disabled { color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }
.btn-outline {
  background: transparent; color: #6b7280;
  border: 2px solid #e5e7eb;
}
.btn-outline:hover { border-color: #9ca3af; }

.line-button {
  display: inline-block; background: #00B900; color: #fff;
  padding: 12px 28px; border-radius: 8px;
  text-decoration: none; font-weight: 700;
  margin-top: 8px;
}
.line-button:hover { background: #00a300; }

/* ─── PROGRESS ─────────────────────────────────────────────────── */
.progress-wrap { margin-bottom: 16px; }
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: .85rem; color: #6b7280; margin-bottom: 6px;
}
.progress-bar {
  height: 8px; background: #d1fae5; border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: #16a34a; border-radius: 99px;
  transition: width .3s ease; width: 0%;
}

.dim-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 4px;
}
.dim-tab {
  flex-shrink: 0; padding: 6px 14px; border-radius: 99px;
  font-size: .8rem; font-weight: 600;
  background: #e5e7eb; color: #6b7280;
  white-space: nowrap;
}
.dim-tab.done { background: #bbf7d0; color: #166534; }
.dim-tab.active { background: #16a34a; color: #fff; }

/* ─── DIM BANNER ───────────────────────────────────────────────── */
.dim-banner {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  margin-bottom: 14px;
}
.dim-banner-icon { font-size: 2.2rem; }
.dim-banner-name { font-size: 1.2rem; color: #166534; font-weight: 700; }
.dim-banner-desc { font-size: .85rem; color: #6b7280; margin-top: 2px; line-height: 1.5; }

.quiz-instructions {
  background: #f0fdf4; border-left: 4px solid #16a34a;
  border-radius: 6px; padding: 10px 14px;
  font-size: .88rem; color: #166534;
  margin-bottom: 14px;
}

/* ─── SUBGROUP HEADER ──────────────────────────────────────────── */
.subgroup-header {
  font-size: .95rem; font-weight: 700; color: #166534;
  margin: 18px 0 10px;
  padding: 8px 14px;
  background: #dcfce7; border-radius: 8px;
}

/* ─── QUESTION CARD ────────────────────────────────────────────── */
.question-card {
  background: #fff; border-radius: 12px; padding: 16px;
  margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.q-image-wrap {
  margin-bottom: 12px; border-radius: 10px; overflow: hidden;
  background: #f3f4f6; min-height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.q-image {
  display: block; width: 100%; max-height: 200px; object-fit: contain;
  cursor: zoom-in;
}
.q-image-placeholder {
  color: #9ca3af; font-size: 2rem; text-align: center; padding: 32px 16px;
}
.q-image-placeholder span {
  display: block; font-size: .82rem; margin-top: 6px;
}

.q-text {
  font-size: 1rem; color: #1f2937; font-weight: 600;
  margin-bottom: 12px; line-height: 1.5;
}

.opts {
  display: grid; gap: 6px;
}
.opts-frequency { grid-template-columns: repeat(4, 1fr); }
.opts-scale2 { grid-template-columns: repeat(3, 1fr); }

.opt-btn {
  padding: 10px 6px; border: 2px solid #e5e7eb; border-radius: 8px;
  background: #fff; font-size: .82rem; cursor: pointer;
  transition: all .15s; font-family: inherit; color: #374151;
  text-align: center; line-height: 1.3;
}
.opt-btn:hover { border-color: #86efac; }
.opt-btn.selected.opt-0 { border-color: #22c55e; background: #f0fdf4; color: #166534; font-weight: 700; }
.opt-btn.selected.opt-1 { border-color: #eab308; background: #fefce8; color: #854d0e; font-weight: 700; }
.opt-btn.selected.opt-2 { border-color: #f97316; background: #fff7ed; color: #9a3412; font-weight: 700; }
.opt-btn.selected.opt-3 { border-color: #ef4444; background: #fef2f2; color: #991b1b; font-weight: 700; }

/* ─── NAV BUTTONS ──────────────────────────────────────────────── */
.nav-buttons {
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  margin-top: 16px;
}
.nav-buttons .btn { margin-bottom: 0; }

/* ─── RESULT ───────────────────────────────────────────────────── */
.result-title {
  text-align: center; font-size: 1.5rem; color: #166534;
  margin-bottom: 6px;
}
.overall-summary {
  text-align: center; color: #6b7280; font-size: .92rem;
  margin-bottom: 18px;
}

.chart-card { text-align: center; }
.radar-wrap {
  position: relative; max-width: 480px; margin: 12px auto 6px;
}
.radar-legend {
  font-size: .8rem; color: #9ca3af; text-align: center; margin-top: 8px;
}

/* ─── DIM RESULT CARDS ─────────────────────────────────────────── */
.dim-result-card {
  background: #fff; border-radius: 12px; padding: 16px;
  margin-bottom: 12px; border-left: 5px solid #16a34a;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.drc-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.drc-icon { font-size: 1.6rem; }
.drc-name {
  font-size: 1.05rem; font-weight: 700; color: #1f2937;
  flex: 1;
}
.drc-zone {
  padding: 4px 12px; border-radius: 99px;
  font-size: .8rem; font-weight: 700;
  white-space: nowrap;
}
.drc-bar {
  height: 10px; background: #f3f4f6; border-radius: 99px;
  overflow: hidden; margin-bottom: 8px;
}
.drc-fill {
  height: 100%; border-radius: 99px; transition: width .6s ease;
}
.drc-stats {
  font-size: .82rem; color: #6b7280; margin-bottom: 8px;
}
.drc-desc {
  font-size: .88rem; color: #4b5563; line-height: 1.6;
  margin-bottom: 8px;
}
.drc-tips {
  margin-top: 10px; padding: 10px 14px;
  background: #f9fafb; border-radius: 8px;
  font-size: .88rem;
}
.drc-tips summary {
  cursor: pointer; color: #16a34a; font-weight: 700;
  padding: 2px 0;
}
.drc-tips ul {
  list-style: none; padding: 0; margin: 10px 0 0;
}
.drc-tips li {
  padding: 6px 0; color: #374151; line-height: 1.6;
  border-top: 1px solid #f3f4f6;
}
.drc-tips li:first-child { border: none; }

/* ─── MODIFIER (ธาตุ × มิติ) ────────────────────────────────────── */
.modifier-cta {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 2px dashed #86efac;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.modifier-cta p {
  color: #166534;
  font-weight: 600;
  margin-bottom: 10px;
}

.drc-modifiers {
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fefce8, #f0fdf4);
  border-radius: 10px;
  border: 1px solid #d9f99d;
  font-size: .9rem;
}
.drc-modifiers > summary {
  cursor: pointer;
  color: #166534;
  font-weight: 700;
  padding: 4px 0;
}
.drc-modifiers[open] > summary {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d9f99d;
}

.modifier-block {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
  border-left: 3px solid #86efac;
}
.modifier-block:first-child { margin-top: 0; }
.modifier-ลม { border-left-color: #7dd3fc; background: #f0f9ff; }
.modifier-ไฟ { border-left-color: #fcd34d; background: #fffbeb; }
.modifier-น้ำ { border-left-color: #6ee7b7; background: #f0fdf4; }

.mod-head {
  font-weight: 700;
  color: #1f2937;
  font-size: .92rem;
  margin-bottom: 6px;
}
.mod-pattern {
  font-size: .85rem;
  color: #6b7280;
  font-style: italic;
  margin: 6px 0 8px;
  line-height: 1.5;
}
.modifier-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.modifier-block li {
  padding: 5px 0;
  font-size: .88rem;
  color: #374151;
  line-height: 1.5;
  border-top: 1px solid #f3f4f6;
}
.modifier-block li:first-child { border: none; padding-top: 0; }

/* ─── PERSONAL BLUEPRINT ─────────────────────────────────────── */
.blueprint-card {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 35%, #f0fdf4 100%);
  border: 2px solid #fcd34d;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(251,191,36,0.15);
}
.blueprint-card.balanced {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: #86efac;
  box-shadow: 0 4px 16px rgba(134,239,172,0.15);
}

.bp-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(251,191,36,0.4);
}
.balanced .bp-head { border-bottom-color: rgba(134,239,172,0.4); }
.bp-emoji {
  font-size: 2.2rem;
  flex-shrink: 0;
}
.bp-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #92400e;
}
.balanced .bp-title { color: #166534; }
.bp-sub {
  font-size: .88rem;
  color: #6b7280;
  margin-top: 2px;
}
.bp-sub strong { color: #1f2937; }

.bp-section {
  margin-bottom: 16px;
}
.bp-section:last-child { margin-bottom: 0; }
.bp-section h4 {
  color: #1f2937;
  font-size: 1rem;
  margin-bottom: 10px;
  text-align: left;
}

.bp-priority-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: bp-counter;
}
.bp-priority-list li {
  counter-increment: bp-counter;
  position: relative;
  padding: 8px 0 8px 32px;
  border-top: 1px solid rgba(251,191,36,0.25);
  font-size: .92rem;
}
.bp-priority-list li:first-child { border: none; }
.bp-priority-list li::before {
  content: counter(bp-counter);
  position: absolute;
  left: 0;
  top: 7px;
  width: 24px;
  height: 24px;
  background: #92400e;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
}
.bp-pri-name {
  font-weight: 700;
  color: #1f2937;
}
.bp-pri-zone {
  display: block;
  font-size: .82rem;
  margin-top: 2px;
  font-weight: 600;
}

.bp-pattern-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bp-pattern-list li {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  font-size: .88rem;
  color: #374151;
  line-height: 1.6;
}
.bp-pattern-list li:last-child { margin-bottom: 0; }

.bp-actions-section {
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  padding: 14px;
}
.bp-action-list {
  padding-left: 22px;
  margin: 0;
}
.bp-action-list li {
  padding: 6px 0;
  font-size: .9rem;
  color: #1f2937;
  line-height: 1.6;
}
.bp-action-tag {
  font-size: .75rem;
  color: #9ca3af;
  margin-left: 4px;
}

.bp-strong {
  background: rgba(187,247,208,0.4);
  border-radius: 10px;
  padding: 12px 14px;
}
.bp-strong h4 { color: #166534; }
.bp-strong p {
  font-size: .9rem;
  color: #166534;
  line-height: 1.6;
  margin: 0;
}

.bp-balanced-msg {
  font-size: .95rem;
  color: #166534;
  line-height: 1.7;
  margin: 0;
}

/* ─── BLUEPRINT NARRATIVE ─────────────────────────────────────── */
.bp-narrative {
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border-left: 4px solid #fcd34d;
}
.balanced .bp-narrative {
  border-left-color: #86efac;
}
.bp-narrative p {
  font-size: .96rem;
  color: #374151;
  line-height: 1.85;
  margin: 0 0 10px;
}
.bp-narrative p:last-child { margin-bottom: 0; }
.bp-narrative strong { color: #92400e; }
.balanced .bp-narrative strong { color: #166534; }

/* ─── PRIORITY RICH ───────────────────────────────────────────── */
.bp-priority-rich {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bp-priority-item {
  background: rgba(255,255,255,0.65);
  border-radius: 10px;
  padding: 12px 14px;
  border-left: 4px solid #fcd34d;
}
.bp-pri-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.bp-pri-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #92400e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .85rem;
}
.bp-pri-info { flex: 1; }
.bp-pat-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.bp-pat-list li {
  font-size: .85rem;
  color: #4b5563;
  line-height: 1.6;
  padding: 4px 0;
  border-top: 1px dashed rgba(0,0,0,0.06);
}
.bp-pat-list li:first-child { border: none; padding-top: 0; }
.bp-pat-base {
  font-weight: 700;
  color: #92400e;
  margin-right: 4px;
}

/* ─── THEMED ACTIONS ──────────────────────────────────────────── */
.bp-themes-section {
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  padding: 14px;
}
.bp-themes-lead {
  font-size: .85rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 12px !important;
}
.bp-theme {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid #fde68a;
}
.bp-theme:last-child { margin-bottom: 0; }
.bp-theme-head {
  font-weight: 700;
  color: #1f2937;
  font-size: .92rem;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f3f4f6;
}
.bp-theme-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bp-theme-list li {
  font-size: .88rem;
  color: #374151;
  line-height: 1.6;
  padding: 5px 0;
  padding-left: 16px;
  position: relative;
  border-top: 1px solid #f9fafb;
}
.bp-theme-list li:first-child { border: none; }
.bp-theme-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: #ca8a04;
  font-weight: 700;
}

/* ─── FEEDBACK ─────────────────────────────────────────────────── */
.feedback-options {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin: 14px 0;
}
.feedback-options label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 8px 14px;
  border: 2px solid #e5e7eb; border-radius: 8px;
  cursor: pointer; transition: all .15s;
  background: #fff; font-weight: 600;
}
.feedback-options input { display: none; }
.feedback-options input:checked + label,
.feedback-options label.checked {
  background: #16a34a; color: #fff; border-color: #15803d;
}

.thankyou-msg {
  text-align: center; color: #166534;
  font-weight: 700; margin-top: 8px;
}

.consultation { text-align: center; }

/* ─── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 18px; }
  .opts-frequency { grid-template-columns: repeat(2, 1fr); }
  .dim-banner { padding: 14px; gap: 10px; }
  .dim-banner-icon { font-size: 1.8rem; }
  .dim-banner-name { font-size: 1.05rem; }
  .nav-buttons { grid-template-columns: 1fr 1.5fr; }
}
