/**
 * BPS Assessment — Scoped CSS v1.2.0
 * All rules scoped under .bps-app to avoid affecting the rest of the site.
 */

.bps-app {
    box-sizing: border-box;
    max-width: 780px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Sarabun", "Prompt", "Noto Sans Thai", Roboto, Arial, sans-serif;
    color: #1f2937;
    line-height: 1.6;
    font-size: 16px;
}
.bps-app *, .bps-app *::before, .bps-app *::after { box-sizing: border-box; }
.bps-app .bps-loading { padding: 24px; text-align: center; color: #6b7280; }

.bps-app .bps-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #f3f4f6; }
.bps-app .bps-title { margin: 0 0 6px 0; font-size: 22px; line-height: 1.35; color: #0f172a; font-weight: 700; }
.bps-app .bps-subtitle { margin: 0; color: #6b7280; font-size: 14px; }
.bps-app .bps-h3 { margin: 18px 0 8px; font-size: 17px; color: #111827; font-weight: 700; }

.bps-app .bps-progress { display: flex; align-items: center; gap: 12px; margin: 12px 0 18px; }
.bps-app .bps-progress-track { flex: 1; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.bps-app .bps-progress-bar { height: 100%; background: linear-gradient(90deg, #10b981, #34d399); transition: width .25s ease; }
.bps-app .bps-progress-text { font-size: 13px; color: #6b7280; white-space: nowrap; }

.bps-app .bps-form { display: flex; flex-direction: column; gap: 14px; }
.bps-app .bps-field { display: flex; flex-direction: column; gap: 4px; }
.bps-app .bps-label { font-weight: 600; font-size: 14px; color: #374151; }
.bps-app .bps-hint  { margin: 2px 0 0; font-size: 12px; color: #6b7280; }
.bps-app .bps-input {
    width: 100%; padding: 12px 14px; font-size: 16px;
    border: 1.5px solid #d1d5db; border-radius: 10px; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bps-app .bps-input:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }

.bps-app .bps-btn {
    display: inline-block; padding: 14px 18px; font-size: 16px; font-weight: 600;
    border: none; border-radius: 10px; cursor: pointer; text-align: center;
    transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
    min-height: 48px; width: 100%; margin-top: 8px;
    text-decoration: none;
}
.bps-app .bps-btn:hover { transform: translateY(-1px); }
.bps-app .bps-btn:active { transform: translateY(0); }
.bps-app .bps-btn-primary   { background: #10b981; color: #fff; }
.bps-app .bps-btn-primary:hover { background: #059669; }
.bps-app .bps-btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.bps-app .bps-btn-secondary:hover { background: #e5e7eb; }
.bps-app .bps-btn-disabled  { opacity: .5; cursor: not-allowed; }
.bps-app .bps-btn-line      { background: #06c755; color: #fff; }
.bps-app .bps-btn-line:hover{ background: #04a644; color: #fff; }
.bps-app .bps-btn-restart   { margin-top: 24px; }

.bps-app .bps-nav { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bps-app .bps-nav .bps-btn { flex: 1; min-width: 140px; margin-top: 0; }

.bps-app .bps-question { background: #f9fafb; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.bps-app .bps-q-meta { display: inline-block; background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; letter-spacing: .5px; }
.bps-app .bps-q-text { margin: 0; font-size: 17px; color: #111827; font-weight: 500; }

.bps-app .bps-options { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.bps-app .bps-option {
    width: 100%; padding: 14px 16px; font-size: 16px; text-align: left;
    background: #fff; border: 1.5px solid #e5e7eb; border-radius: 10px;
    cursor: pointer; transition: all .15s ease; line-height: 1.45;
}
.bps-app .bps-option:hover { border-color: #10b981; background: #ecfdf5; }
.bps-app .bps-option-selected { background: #10b981; color: #fff; border-color: #10b981; }

.bps-app .bps-selfcheck-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.bps-app .bps-selfcheck-row { background: #f9fafb; padding: 14px; border-radius: 10px; }
.bps-app .bps-selfcheck-label { margin: 0 0 10px 0; font-size: 15px; color: #1f2937; font-weight: 500; }

.bps-app .bps-prompts { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 14px; }
.bps-app .bps-prompt-row { background: #f9fafb; padding: 14px; border-radius: 10px; }
.bps-app .bps-prompt-text { margin: 0 0 6px; font-size: 15px; color: #1f2937; font-weight: 500; }

.bps-app .bps-scale { display: flex; gap: 6px; flex-wrap: wrap; }
.bps-app .bps-scale-wide .bps-scale-btn { min-width: 44px; }
.bps-app .bps-scale-btn {
    flex: 1; min-width: 40px; min-height: 44px; padding: 8px;
    background: #fff; border: 1.5px solid #e5e7eb; border-radius: 8px;
    cursor: pointer; font-size: 15px; font-weight: 600; color: #374151;
    transition: all .15s ease;
}
.bps-app .bps-scale-btn:hover { border-color: #10b981; }
.bps-app .bps-scale-btn-selected { background: #10b981; color: #fff; border-color: #10b981; }

.bps-app .bps-textarea {
    width: 100%; padding: 14px; font-size: 16px; min-height: 140px;
    border: 1.5px solid #d1d5db; border-radius: 10px; resize: vertical;
    font-family: inherit; line-height: 1.5;
}
.bps-app .bps-textarea:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.bps-app .bps-counter { margin: 6px 0 0; font-size: 13px; color: #6b7280; text-align: right; }
.bps-app .bps-info { margin: 6px 0 14px; padding: 12px; background: #fef9c3; border-left: 4px solid #facc15; border-radius: 6px; font-size: 14px; color: #713f12; }

.bps-app .bps-writing-choice .bps-nav { margin-top: 16px; }

.bps-app .bps-result-hero {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff; border-radius: 14px; padding: 24px; text-align: center; margin-bottom: 18px;
}
.bps-app .bps-result-thanks { margin: 0 0 8px; font-size: 14px; opacity: .9; }
.bps-app .bps-result-level { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.bps-app .bps-result-score { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.bps-app .bps-result-id { margin: 0; font-size: 13px; opacity: .85; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.bps-app .bps-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.bps-app .bps-card h3 { margin: 0 0 10px; font-size: 16px; color: #111827; font-weight: 700; }
.bps-app .bps-card-highlight { background: #fef3c7; border-color: #fcd34d; }
.bps-app .bps-card-soft      { background: #ecfdf5; border-color: #86efac; }
.bps-app .bps-card-note      { background: #f0f9ff; border-color: #93c5fd; }
.bps-app .bps-card-roadmap   { background: #f5f3ff; border-color: #c4b5fd; }
.bps-app .bps-rec-course { margin: 0 0 6px; font-size: 19px; font-weight: 700; color: #92400e; }
.bps-app .bps-rec-package { margin: 0 0 6px; font-size: 15px; color: #78350f; }
.bps-app .bps-rec-reason { margin: 0 0 6px; font-size: 14px; color: #78350f; }
.bps-app .bps-rec-alt    { margin: 8px 0 0; font-size: 13px; color: #6b7280; font-style: italic; }

.bps-app .bps-breakdown,
.bps-app .bps-list,
.bps-app .bps-milestones { margin: 0; padding-left: 20px; }
.bps-app .bps-breakdown li,
.bps-app .bps-list li,
.bps-app .bps-milestones li { margin: 6px 0; font-size: 15px; line-height: 1.5; }
.bps-app .bps-list-good li::marker { content: '✅ '; }
.bps-app .bps-list-warn li::marker { content: '⚠️ '; }
.bps-app .bps-milestone-item strong { color: #5b21b6; }

.bps-app .bps-line-card { background: #f0fdf4; border-color: #86efac; text-align: center; }
.bps-app .bps-line-qr { display: block; max-width: 200px; width: 100%; height: auto; margin: 12px auto; border-radius: 8px; border: 4px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.06); }

.bps-app .bps-disclaimer {
    margin: 12px 0; padding: 10px 12px; background: #f9fafb; border-left: 3px solid #9ca3af;
    border-radius: 4px; font-size: 12px; color: #6b7280; line-height: 1.5;
}

.bps-app .bps-roadmap-chain { font-size: 15px; font-weight: 600; color: #5b21b6; margin: 0 0 6px; }

@media (min-width: 640px) {
    .bps-app { padding: 24px; font-size: 16px; }
    .bps-app .bps-title { font-size: 26px; }
    .bps-app .bps-btn { width: auto; }
    .bps-app .bps-result-hero { padding: 32px; }
    .bps-app .bps-result-level { font-size: 28px; }
}

/* Honeypot anti-spam field: hidden from real users, available to bots */
.bps-app .bps-hp-field {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* === v1.2.1 hotfix: bilingual CEFR + milestones === */
.bps-app .bps-hint-center{text-align:center;margin:12px 0 0;color:#6b7280;font-style:italic;font-size:13px;}
.bps-app .bps-roadmap-wrap > .bps-card{margin-bottom:14px;}
.bps-app .bps-card-cefr{background:#fff;border:1px solid #c4b5fd;}
.bps-app .bps-cefr-block{padding:14px;border-radius:10px;margin:12px 0;border-left:4px solid #c4b5fd;}
.bps-app .bps-cefr-current{background:#ecfdf5;border-left-color:#10b981;}
.bps-app .bps-cefr-target{background:#fef3c7;border-left-color:#f59e0b;}
.bps-app .bps-cefr-badge{display:inline-block;padding:4px 12px;border-radius:999px;background:#fff;font-size:13px;font-weight:700;margin-bottom:8px;color:#1f2937;}
.bps-app .bps-cefr-short{margin:6px 0;font-size:14px;color:#374151;}
.bps-app .bps-cefr-canlabel,.bps-app .bps-cefr-exlabel{margin:10px 0 4px;font-weight:600;font-size:13px;color:#4b5563;}
.bps-app .bps-cefr-cando,.bps-app .bps-cefr-examples{margin:0;padding-left:20px;font-size:14px;line-height:1.6;}
.bps-app .bps-cefr-examples li{font-style:italic;color:#5b21b6;}
.bps-app .bps-roadmap-pkg{background:#fef3c7;padding:10px 12px;border-radius:8px;font-weight:600;margin:8px 0;}
.bps-app .bps-card-milestones{background:#fff;}
.bps-app .bps-milestone-card{border:1px solid #e5e7eb;border-left:4px solid #5b21b6;border-radius:10px;padding:14px;margin:12px 0;background:#fafafa;}
.bps-app .bps-milestone-head{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:8px;}
.bps-app .bps-milestone-hours{background:#5b21b6;color:#fff;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:600;}
.bps-app .bps-milestone-num{font-size:12px;color:#6b7280;font-weight:600;}
.bps-app .bps-milestone-title-th{margin:6px 0 4px;font-weight:700;font-size:15px;color:#111827;}
.bps-app .bps-milestone-title-en{margin:0 0 8px;font-weight:600;font-size:14px;color:#4b5563;font-style:italic;}
.bps-app .bps-milestone-focus{margin-top:8px;}
.bps-app .bps-focus-label{margin:8px 0 4px;font-weight:600;font-size:13px;color:#5b21b6;}
.bps-app .bps-focus-th,.bps-app .bps-focus-en{margin:0;padding-left:20px;font-size:14px;line-height:1.55;}
.bps-app .bps-focus-en li{color:#6b7280;font-size:13px;}
.bps-app .bps-milestone-tip{margin-top:10px;background:#fffbeb;border-left:3px solid #f59e0b;padding:8px 10px;border-radius:4px;font-size:13px;color:#78350f;}
.bps-app .bps-tip-en{font-style:italic;opacity:0.8;margin-top:4px !important;}
.bps-app .bps-en-text{color:#4b5563;font-size:14px;font-style:italic;}

/* === v1.2.1-hotfix2-pink-text: force option text color (theme was overriding to pink) === */
.bps-app .bps-option {
  color: #1f2937 !important;
  background: #fff !important;
  border-color: #e5e7eb !important;
  font-weight: 500 !important;
}
.bps-app .bps-option:hover {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
}
.bps-app .bps-option.bps-option-selected,
.bps-app .bps-option-selected {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}
.bps-app .bps-scale-btn {
  color: #374151 !important;
  background: #fff !important;
}
.bps-app .bps-scale-btn-selected {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}
.bps-app .bps-btn-primary { color: #fff !important; }
.bps-app .bps-btn-secondary { color: #374151 !important; }
.bps-app .bps-input, .bps-app .bps-textarea {
  color: #1f2937 !important;
  background: #fff !important;
}

/* === v1.2.1-hotfix3-supercolor: high-specificity color overrides === */
html body .bps-app button.bps-option,
html body .bps-app .bps-option {
  color: #1f2937 !important;
  background: #fff !important;
  border: 1.5px solid #e5e7eb !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}
html body .bps-app button.bps-option:hover,
html body .bps-app .bps-option:hover {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
}
html body .bps-app button.bps-option.bps-option-selected,
html body .bps-app .bps-option.bps-option-selected,
html body .bps-app .bps-option-selected {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}
html body .bps-app .bps-scale-btn { color: #374151 !important; background: #fff !important; }
html body .bps-app .bps-scale-btn-selected { background: #10b981 !important; color: #fff !important; border-color: #10b981 !important; }
html body .bps-app .bps-btn-primary { background: #10b981 !important; color: #fff !important; }
html body .bps-app .bps-btn-primary:hover { background: #059669 !important; color: #fff !important; }
html body .bps-app .bps-btn-secondary { background: #f3f4f6 !important; color: #374151 !important; }
html body .bps-app .bps-btn-line { background: #06c755 !important; color: #fff !important; }
html body .bps-app .bps-input, html body .bps-app .bps-textarea { color: #1f2937 !important; background: #fff !important; }
