/* ============== Tokens ============== */
:root {
  --bg: #f4f8fc;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #5b6675;
  --border: #e1e8f0;
  --primary: #1d50a2;        /* ECV Dark Blue */
  --primary-2: #409ad6;      /* ECV Blue */
  --primary-3: #143a78;      /* deeper navy for gradient depth */
  --primary-soft: #e7f1fb;
  --sky: #00a3e5;            /* ECV Sky */
  --aqua: #47bcc6;           /* ECV Aquamarine */
  --accent: #f39800;         /* ECV Orange */
  --warn: #d97706;
  --danger: #dc2626;
  --success: #16a34a;
  --ring: 0 0 0 3px rgba(64, 154, 214, 0.4);
  --grad: #409ad6;           /* single flat ECV Blue (no gradient) */
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06), 0 1px 1px rgba(15, 27, 45, 0.04);
  --shadow: 0 10px 30px -12px rgba(15, 27, 45, 0.18), 0 2px 6px rgba(15, 27, 45, 0.06);
  --shadow-lg: 0 24px 60px -20px rgba(15, 27, 45, 0.28);
  --radius: 16px;
  --radius-sm: 9px;
}

/* ============== Reset ============== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Sarabun", "IBM Plex Sans Thai", "Noto Sans Thai", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(1200px 480px at 78% -8%, rgba(64, 154, 214, 0.14), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(64, 154, 214, 0.12), transparent 55%);
  background-repeat: no-repeat;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem); font-weight: 700; text-wrap: balance; }
h2 { font-size: 1.45rem; font-weight: 700; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
ul, ol { padding-left: 1.2rem; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 5px 12px;
  border-radius: 999px;
  margin: 0 0 0.9rem;
  box-shadow: 0 4px 10px -4px rgba(29, 80, 162, 0.5);
}

/* ============== Header / footer ============== */
.site-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.brand-mark {
  display: inline-block;
  height: 68px;
  width: auto;
  object-fit: contain;
}
.brand-text { font-size: 1rem; }

.footer-brand .brand-mark { height: 48px; }
.header-nav { display: flex; gap: 8px; align-items: center; }
.lang-btn {
  border: 1px solid var(--border);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  color: var(--text);
}
.lang-btn:hover { background: var(--primary-soft); border-color: var(--primary-2); }
.lang-btn .flag {
  display: block;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.lang-btn .lang-code { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--muted); }
.link-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.link-btn:hover { color: var(--text); background: var(--primary-soft); }

.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

/* ============== Generic surfaces ============== */
.view { padding: 36px 0 56px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 22px;
}

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease, filter 0.18s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(29, 80, 162, 0.5);
}
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 14px 26px -8px rgba(29, 80, 162, 0.55); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary-2); color: var(--primary); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============== Welcome / hero ============== */
.hero { padding: 8px 0; }
.hero-top {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e9f3fb 0%, #f3f9ff 55%, #ffffff 100%);
  border: 1px solid #dce8f5;
  border-radius: 22px;
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}
.hero-top::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -90px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(64, 154, 214, 0.22), transparent 70%);
  pointer-events: none;
}
.hero-intro { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.hero-intro h1 { margin-bottom: 0; }
.hero-sticker {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  width: 168px;
  height: auto;
  align-self: center;
  filter: drop-shadow(0 8px 16px rgba(15, 27, 45, 0.12));
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.lead { color: var(--muted); max-width: 70ch; }
.org-card { margin-top: 24px; }
.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}
.form-grid input,
.form-grid select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-grid input:focus,
.form-grid select:focus { outline: none; border-color: var(--primary-2); box-shadow: var(--ring); }
.form-grid input.invalid,
.form-grid select.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.req { color: var(--danger); font-weight: 700; }
.req-note { margin: -4px 0 16px; color: var(--danger); }
.industry-other-input { margin-top: 6px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.pillars-overview { margin-top: 32px; }
.pillars-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.pillars-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.pillars-list li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary-2);
}
.pillar-num {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-3);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pillar-num.small { font-size: 0.7rem; padding: 3px 7px; }
.dim-list { margin-top: 4px; }

/* Pillar tile on the welcome screen: description + dimension list are
   hidden by default and only shown as a hover/focus tooltip, so the grid
   stays compact and scannable. */
.pillar-tile { position: relative; cursor: default; z-index: 1; }
/* Lift the hovered/focused tile (and its tooltip) above sibling tiles,
   otherwise later grid items can paint on top of the tooltip. */
.pillar-tile:hover,
.pillar-tile:focus-within { z-index: 30; }
.pillar-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--text);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}
/* When there's not enough room on the right (e.g. rightmost column tile),
   open the tooltip to the left of the tile instead. */
.pillar-tile.tooltip-flip .pillar-tooltip {
  left: auto;
  right: calc(100% + 10px);
  transform: translateX(4px);
}
.pillar-tooltip p { color: #fff; margin: 0 0 6px; }
.pillar-tooltip p:last-child { margin-bottom: 0; }
.pillar-tooltip .dim-list { opacity: 0.85; }
.pillar-tile:hover .pillar-tooltip,
.pillar-tile:focus-visible .pillar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
/* On narrow screens there's no room to the side; fall back to opening
   below the tile, same as the original layout. */
@media (max-width: 640px) {
  .pillar-tooltip,
  .pillar-tile.tooltip-flip .pillar-tooltip {
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    transform: translateY(4px);
  }
  .pillar-tile:hover .pillar-tooltip,
  .pillar-tile:focus-visible .pillar-tooltip {
    transform: translateY(0);
  }
}

/* ============== How it works / scale guide ============== */
.how-card { margin-top: 24px; }
.how-steps {
  list-style: none;
  padding: 0;
  margin: 12px 0 24px;
  display: grid;
  gap: 14px;
}
.how-steps li { display: flex; gap: 14px; align-items: flex-start; }
.how-steps li p { margin: 2px 0 0; }
.how-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px -6px rgba(44, 110, 32, 0.6);
}
.scale-heading { margin-top: 8px; }

.scale-legend {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}
.scale-legend-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.scale-legend-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
}
.scale-legend-text { display: flex; flex-direction: column; gap: 1px; }
.scale-legend-text strong { font-size: 0.95rem; }

/* Compact scale guide shown while answering */
.scale-guide {
  background: var(--primary-soft);
  border: 1px solid #d6dbf7;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.scale-guide { display: flex; align-items: center; gap: 14px; }
.scale-sticker { flex: 0 0 auto; width: 64px; height: 64px; }
.scale-guide-intro { margin: 0 0 12px; font-size: 0.9rem; }
.scale-guide .scale-guide-intro { margin: 0; }
.scale-guide .scale-legend {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.scale-guide .scale-legend-item { background: var(--surface); }

/* ============== Progress / steps ============== */
.progress-wrap { margin-bottom: 20px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-bar {
  height: 10px;
  background: #e7eaf3;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary-2);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.step-dots {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.step-dot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 10px 8px;
  min-height: 86px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

/* Hover tooltip: full pillar description on top of the step dot. */
.step-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: 220px;
  max-width: 60vw;
  background: var(--text);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}
.step-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text);
}
.step-dot:hover .step-tooltip,
.step-dot:focus-visible .step-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.step-dot:first-child .step-tooltip { left: 0; transform: translateX(0) translateY(4px); }
.step-dot:first-child .step-tooltip::after { left: 20px; transform: translateX(-50%); }
.step-dot:last-child .step-tooltip { left: auto; right: 0; transform: translateX(0) translateY(4px); }
.step-dot:last-child .step-tooltip::after { left: auto; right: 20px; transform: translateX(50%); }
.step-dot:first-child:hover .step-tooltip,
.step-dot:last-child:hover .step-tooltip { transform: translateY(0); }
.step-dot .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e7eaf3;
  color: var(--muted);
  font-weight: 700;
}
.step-dot.is-current { border-color: var(--primary-2); color: var(--text); background: var(--primary-soft); }
.step-dot.is-current .step-num { background: var(--primary); color: #fff; }
.step-dot.is-done { border-color: #c8e6d3; color: var(--text); background: #f0fbf4; }
.step-dot.is-done .step-num { background: var(--success); color: #fff; }
.step-dot.is-done .step-num::after { content: '✓'; font-size: 14px; }
.step-dot.is-done .step-num { font-size: 0; }

/* ============== Pillar / questions ============== */
.pillar-head { margin-bottom: 16px; }
.pillar-desc {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: var(--bg);
  border-left: 3px solid var(--primary-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}
.dimension {
  border-top: 1px dashed var(--border);
  padding: 20px 0;
}
.dimension:first-of-type { border-top: none; padding-top: 0; }
.dimension > header h3 { margin-bottom: 2px; }
.dim-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dim-badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.dim-desc { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; }

.question { margin: 16px 0 22px; }
.q-text { font-weight: 600; margin-bottom: 4px; font-size: 1.02rem; }
.q-hint { margin: 0 0 12px; }

/* Highlight a question/field that still needs an answer */
.dimension.needs-answer {
  background: #fef2f2;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 2px #fecaca;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* Free-text "AI needs" box at the end of the assessment / result page */
.help-needed { margin-top: 18px; }
.help-needed h3 { margin: 0 0 10px; font-size: 0.95rem; }
.help-needed .interest-choices { margin-bottom: 12px; }
.help-needed-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  resize: vertical;
  min-height: 84px;
}
.help-needed-input:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Submit/log status banner on the result page */
.log-status { margin: 8px 0 0; font-size: 0.9rem; font-weight: 600; }
.log-status:empty { display: none; }
.log-status.is-info { color: var(--muted); }
.log-status.is-ok { color: #15803d; }
.log-status.is-warn { color: #b45309; }
.log-status.is-err { color: #b91c1c; }

/* Per-question glossary ("คำอธิบายเพิ่มเติม") */
.dim-glossary {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--primary-soft);
  border: 1px solid #d6dbf7;
  border-left: 4px solid var(--primary-2);
  border-radius: var(--radius-sm);
}
.dim-glossary .glossary-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary-2);
}
.dim-glossary .glossary-list { margin: 0; }
.dim-glossary dt {
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 8px;
}
.dim-glossary dt:first-child { margin-top: 0; }
.dim-glossary dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.dim-glossary .glossary-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Vertical anchored options (each with a full description) */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 44px 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.option:hover { border-color: var(--primary-2); background: var(--primary-soft); transform: translateY(-1px); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e7eaf3;
  font-weight: 700;
  color: var(--muted);
}
.option-text { line-height: 1.5; padding-top: 3px; display: flex; flex-direction: column; gap: 2px; }
.option-main { font-weight: 500; }
.option-ex { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.q-title { margin: 0 0 4px; font-size: 1.08rem; }
.q-question { margin: 0 0 12px; color: var(--muted); font-size: 0.94rem; line-height: 1.55; }
.qa-question { margin: 2px 0 6px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

/* Interest question: title left, pills right, on one row */
.interest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.interest-row .q-title { margin: 0; flex: 1 1 auto; min-width: 0; }
.interest-choices { display: flex; gap: 10px; flex: 0 0 auto; }
.interest-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.interest-pill input { position: absolute; opacity: 0; pointer-events: none; }
.interest-pill:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.interest-pill.is-selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(29, 80, 162, 0.18);
}
@media (max-width: 640px) {
  .interest-row { flex-direction: column; align-items: flex-start; }
  .interest-choices { width: 100%; }
  .interest-pill { flex: 1; justify-content: center; }
}
.option.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(29, 80, 162, 0.18);
}
.option.is-selected .option-num { background: var(--primary); color: #fff; }
.option.is-selected .option-text { color: var(--text); font-weight: 600; }
/* Clear "selected" checkmark on the right */
.option.is-selected::after {
  content: '✓';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

/* ============== Result ============== */
.result-header { margin-bottom: 20px; display: flex; align-items: center; gap: 20px; }
.result-sticker { flex: 0 0 auto; width: 120px; height: auto; }
.result-intro {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  max-width: 80ch;
}

/* Maturity ladder */
.maturity-ladder {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: ms;
}
.maturity-step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
}
.maturity-step p { margin: 4px 0 0; }
.maturity-step.is-current {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(48, 71, 176, 0.1);
}
.ms-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms-range { color: var(--muted); font-size: 0.85rem; }
.ms-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.result-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}
.overall { display: flex; flex-direction: column; gap: 18px; }
.overall-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--grad);
  color: #fff;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.score-label { font-size: 0.875rem; opacity: 0.85; }
.score-value { font-size: 3rem; font-weight: 700; line-height: 1; margin-left: auto; }
.score-out { opacity: 0.85; }

.overall-level {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.level-label { display: block; color: var(--muted); font-size: 0.875rem; }
.level-badge {
  display: inline-block;
  margin: 6px 0 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}
.level-desc { margin: 0; color: var(--muted); }

.radar-wrap { display: flex; align-items: center; justify-content: center; }
#radar { width: 100%; height: auto; max-width: 420px; }
.radar-grid { fill: rgba(91, 108, 240, 0.04); stroke: #d6dbeb; stroke-dasharray: 3 4; }
.radar-axis { stroke: #d6dbeb; }
.radar-data { fill: rgba(48, 71, 176, 0.22); stroke: var(--primary); stroke-width: 2; }
.radar-dot { fill: var(--primary); }
.radar-label { font-size: 13px; font-weight: 600; fill: var(--muted); }

.pillar-scores { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.pillar-score .ps-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.pillar-score .ps-value { margin-left: auto; color: var(--muted); font-weight: 600; }
.bar { height: 10px; background: #eef0f7; border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%;
  background: var(--primary-2);
  border-radius: 999px;
}

.dimension-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.dim-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}
.dim-card h4 { margin: 0 0 10px; font-size: 0.95rem; }
.dim-score { color: var(--muted); margin: 8px 0 0; font-size: 0.85rem; }

.recommendations { padding-left: 1.1rem; display: flex; flex-direction: column; gap: 10px; }
.recommendations li { line-height: 1.55; }
.recommendations li p { margin: 2px 0; }

/* Where to start */
.start-card { border-color: var(--primary-2); }
.start-head { display: flex; align-items: flex-start; gap: 16px; }
.start-head > div { flex: 1 1 auto; min-width: 0; }
.start-sticker { flex: 0 0 auto; width: 88px; height: auto; }
.focus-box {
  margin: 14px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--primary-2);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary-soft);
}
.focus-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
}
.focus-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.focus-main strong { font-size: 1.05rem; }
.focus-score { margin-left: auto; font-weight: 700; color: var(--primary); }
.focus-box p { margin: 8px 0 0; }

.start-steps-label { font-weight: 600; margin: 6px 0 10px; }
.start-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.start-step { display: flex; gap: 14px; align-items: flex-start; }
.start-step-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}
.start-step-body { line-height: 1.5; }
.start-step-body p { margin: 2px 0; }

/* Solution tag (eCloudvalley offering) */
.solution-tag {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--primary-2);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
}
.solution-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 4px;
}
.solution-body { display: flex; flex-direction: column; gap: 1px; }
.solution-name { font-weight: 700; color: var(--text); }

.cta {
  margin-top: 22px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cta p { margin: 0; max-width: 60ch; }
.cta-sticker { flex: 0 0 auto; width: 76px; height: auto; }
.cta .btn-primary {
  background: #fff;
  color: var(--primary);
  box-shadow: none;
  white-space: nowrap;
}
.cta .btn-primary:hover { filter: none; background: #f0f7e7; }

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

/* ============== Responsive ============== */
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero-top { flex-direction: column-reverse; align-items: flex-start; gap: 12px; padding: 24px 22px; }
  .hero-sticker { width: 120px; align-self: center; }
  .result-header { flex-direction: column; align-items: flex-start; }
  .result-sticker { width: 96px; }
  .start-head { flex-direction: column-reverse; align-items: flex-start; }
  .start-sticker { width: 72px; align-self: flex-end; }
  .cta-sticker { display: none; }
  .step-dots { grid-template-columns: repeat(6, 1fr); font-size: 0.7rem; }
  .step-dot { min-height: 0; }
  .step-dot .step-label { display: none; }
  .option { padding: 12px 12px; }
  .result-summary { grid-template-columns: 1fr; }
  .score-value { font-size: 2.4rem; }
}

/* ============== One-page PDF summary (off-screen, captured for export) ============== */
.pdf-summary {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 760px;
  background: #fff;
  color: var(--text);
  font-family: "Sarabun", "IBM Plex Sans Thai", "Noto Sans Thai", sans-serif;
  padding: 32px;
}
.pdf-summary h1 { font-size: 1.4rem; margin: 0 0 2px; }
.pdf-summary .pdf-meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 18px; }
.pdf-summary .pdf-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  margin-bottom: 18px;
}
.pdf-summary .pdf-score { font-size: 2rem; font-weight: 800; color: var(--primary); }
.pdf-summary .pdf-level-badge {
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
}
.pdf-summary h2 { font-size: 1.02rem; margin: 18px 0 8px; color: var(--primary-3); border-bottom: 2px solid var(--primary-soft); padding-bottom: 4px; }
.pdf-summary ul, .pdf-summary ol { margin: 0; padding-left: 20px; }
.pdf-summary li { margin: 4px 0; font-size: 0.88rem; line-height: 1.5; }
.pdf-summary .pdf-domain-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.pdf-summary .pdf-domain-row:last-child { border-bottom: none; }
.pdf-summary .pdf-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pdf-summary .pdf-footer { margin-top: 22px; font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }

/* PDF appendix: full question/answer detail (admin-only, not shown on-screen) */
.pdf-summary .pdf-appendix-break { break-before: page; page-break-before: always; height: 1px; }
.pdf-summary .pdf-appendix-title { font-size: 1.2rem; margin-top: 0; }
.pdf-summary .pdf-qa-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  font-size: 0.95rem;
}
.pdf-summary .pdf-qa-item {
  border-left: 3px solid var(--primary-2);
  padding: 4px 0 8px 10px;
  margin-bottom: 8px;
  break-inside: avoid;
}
.pdf-summary .pdf-qa-title { font-weight: 600; margin: 0 0 2px; font-size: 0.88rem; }
.pdf-summary .pdf-qa-question { margin: 0 0 4px; color: var(--muted); font-size: 0.8rem; }
.pdf-summary .pdf-qa-answer { margin: 0; font-size: 0.85rem; }
.pdf-summary .pdf-qa-ex { color: var(--muted); font-size: 0.8rem; }

/* ============== Print ============== */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .pdf-summary { display: none !important; } /* only used for html2canvas export, not browser print */
  .container { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #d0d4dc; break-inside: avoid; page-break-inside: avoid; }
  .view { padding: 0; }

  /* Keep cards, list items, and grouped blocks from splitting across pages. */
  .report-card, .roadmap-phase, .report-item, .report-usecase,
  .qa-item, .qa-group, .maturity-step, .dimension, .report-goal, .report-next {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  /* Don't leave a heading stranded at the bottom of a page. */
  h2, h3, .report-level { break-after: avoid; page-break-after: avoid; }

  .result-summary { grid-template-columns: 1fr 1fr; }
  .overall-score { background: #409ad6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bar-fill, .progress-fill { background: #409ad6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .level-badge { background: #e8f1ff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .scale-sticker, .cta-sticker, .start-sticker { display: none !important; }
  .result-sticker { width: 80px; }
}


/* ============== Consulting report (result page) ============== */
.report-overview p { margin: 8px 0 0; line-height: 1.7; }
.report-level {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.report-level-label { color: var(--muted); font-size: 0.9rem; }
.report-level-score { font-weight: 700; color: var(--primary-2); }

.report-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stat-chip {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}
.stat-chip.stat-strength { background: #f0fbf4; color: #15803d; }
.stat-chip.stat-develop { background: #fffbeb; color: #b45309; }
.stat-chip.stat-priority { background: #fef2f2; color: #b91c1c; }

.priority-subhead {
  margin: 18px 0 10px;
  font-size: 0.95rem;
  color: var(--primary-3);
}
.priority-subhead:first-of-type { margin-top: 4px; }

.report-goal, .report-next {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border-left: 4px solid var(--primary-2);
}
.report-goal h3, .report-next h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: var(--primary-3);
}
.report-goal p { margin: 0; line-height: 1.7; }
.report-next-list { margin: 0; padding-left: 20px; }
.report-next-list li { margin: 6px 0; line-height: 1.6; }


.report-pillars, .report-dimensions, .report-usecases {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.report-item, .report-usecase {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface);
}
.report-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.report-item-head .ps-value { margin-left: auto; font-weight: 700; white-space: nowrap; }
.report-item p { margin: 4px 0 0; line-height: 1.6; }
.report-usecase p { margin: 4px 0 0; color: var(--muted); line-height: 1.6; }

.status-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.status-priority { background: #fef2f2; color: #b91c1c; }
.status-develop { background: #fffbeb; color: #b45309; }
.status-strength { background: #f0fbf4; color: #15803d; }

.report-item.dim-priority { border-left: 4px solid #ef4444; }
.report-item.dim-develop { border-left: 4px solid #f59e0b; }
.report-item.dim-strength { border-left: 4px solid var(--success); }

.report-roadmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.roadmap-phase {
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface);
}
.roadmap-phase h3 { margin: 0 0 8px; font-size: 0.98rem; }
.roadmap-phase ul { margin: 0; padding-left: 18px; }
.roadmap-phase li { margin: 6px 0; line-height: 1.55; }

@media (max-width: 720px) {
  .report-roadmap { grid-template-columns: 1fr; }
}


/* ============== Questions & answers (result page) ============== */
.qa-group { margin-top: 18px; }
.qa-group:first-child { margin-top: 0; }
.qa-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.qa-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
  margin-bottom: 10px;
}
.qa-dim { margin: 0 0 2px; }
.qa-q { margin: 0 0 8px; font-weight: 600; line-height: 1.5; }
.qa-a { display: flex; align-items: flex-start; gap: 10px; }
.qa-a-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.qa-a-text { line-height: 1.5; display: flex; flex-direction: column; gap: 2px; }
.qa-a-main { font-weight: 500; }
.qa-a-ex { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }


/* Section-6 survey result on the result page */
.survey-result { display: flex; flex-direction: column; gap: 10px; }
.survey-item { display: flex; align-items: center; gap: 12px; }
.survey-item .qa-q { margin: 0; flex: 1; }
.interest-badge {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}
.interest-badge.is-yes { background: #f0fbf4; color: #15803d; }
.interest-badge.is-no { background: #fef2f2; color: #b91c1c; }
.interest-badge.is-none { background: #eef0f5; color: var(--muted); }


/* Detailed explanation under each maturity level */
.maturity-step .ms-detail {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #111827;
  font-weight: 600;
}


/* Industry use cases (recommended by score) inside the use-case card */
.report-industry-note { margin-top: 16px; font-weight: 600; color: var(--text); }
.report-industry-note:empty { display: none; }
#report-industry-usecases:empty { display: none; }
#report-industry-usecases { margin-top: 10px; }


/* Locked step dots (cannot skip ahead past unanswered questions) */
.step-dot.is-locked { opacity: 0.45; cursor: not-allowed; }
.step-dot.is-locked:hover { transform: none; }


/* Question body: options on the left, glossary on the right */
.dim-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}
.dim-body .dim-glossary { margin-top: 0; }
@media (max-width: 820px) {
  .dim-body { grid-template-columns: 1fr; }
}


/* Step label: clamp long names to 2 lines (full text via title tooltip) */
.step-dot .step-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

/* Inline real-time form validation feedback */
.field-error {
  display: none;
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--danger);
}
label.has-error .field-error { display: block; }
label.has-error input { border-color: var(--danger); }
label.is-valid input { border-color: var(--success); }
input.invalid { border-color: var(--danger); }

/* ============== Footer ============== */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer .footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 22px 0;
}
.site-footer .footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer .footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.site-footer .footer-links a:hover { color: var(--primary); }
.site-footer .footer-note { width: 100%; color: var(--muted); font-size: 0.82rem; margin: 0; }
.site-footer .footer-copy { color: var(--muted); font-size: 0.85rem; }


/* Footer social icons */
.footer-social { display: inline-flex; align-items: center; gap: 12px; }
.footer-social a { display: inline-flex; align-items: center; line-height: 0; transition: transform 0.15s ease, opacity 0.15s ease; }
.footer-social a:hover { transform: translateY(-1px); opacity: 0.85; }
.footer-social svg { display: block; }


/* AI journey roadmap (4 levels) on the result page */
.report-roadmap { display: flex; flex-direction: column; gap: 12px; }
.journey-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.journey-step.is-current {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(29, 80, 162, 0.18);
}
.journey-badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.journey-body { flex: 1; }
.journey-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.journey-current {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 2px 10px;
  border-radius: 999px;
}
.journey-step p { margin: 2px 0 0; line-height: 1.6; }
