/*
 * Interactive self-checks for the clinic renderer.
 *
 * The questionnaire engine in /assets/js/interactive-test.js injects the class
 * names it is given, so this file is the clinic skin: same behaviour as the
 * shared Salus tests, expressed in this site's own tokens. It assumes the
 * variables declared by the tenant stylesheet (--ink, --green, --mint, --sand,
 * --paper, --line, --radius, --shadow, --font-display) are already in scope.
 */

/* --- Index ------------------------------------------------------------- */
.ct-intro { max-width: 62ch; color: var(--ink-soft); font-size: 1.05rem; }
.ct-notes { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 32px; }
.ct-note { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.ct-note__icon { font-size: 1.6rem; display: block; margin-bottom: 12px; }
.ct-note h2, .ct-note h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 8px; color: var(--ink); }
.ct-note p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }

.ct-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ct-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; }
.ct-card__body { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.ct-card__meta { margin: 0; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ct-card h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0; line-height: 1.3; }
.ct-card h3 a { color: var(--ink); text-decoration: none; }
.ct-card h3 a:hover { color: var(--green); }
.ct-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; flex: 1; }
.ct-empty { color: var(--muted); }

/* --- Single: hero and start ------------------------------------------- */
.ct-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ct-meta span { background: var(--mint-soft); color: var(--green-dark); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; font-weight: 600; }
.ct-start { max-width: 68ch; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 28px; }
.ct-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ct-chip, var(--line)); color: var(--ink); background: var(--white); border-radius: 999px; padding: 7px 15px; font-size: 0.9rem; font-weight: 600; }
.ct-disclaimer { margin-top: 26px; color: var(--muted); font-size: 0.88rem; line-height: 1.65; border-left: 3px solid var(--line); padding-left: 16px; }
.ct-disclaimer--end { margin-top: 36px; }
.ct-sections { display: grid; gap: 26px; margin-top: 32px; }
.ct-section h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 8px; color: var(--ink); }
.ct-section p { margin: 0; color: var(--ink-soft); line-height: 1.7; }
.ct-note-text { color: var(--muted); font-size: 0.9rem; line-height: 1.65; margin-bottom: 20px; }
.ct-source { margin-top: 34px; font-size: 0.82rem; color: var(--muted); text-align: center; }
.ct-source a { color: var(--green); }

/* --- Questionnaire overlay -------------------------------------------- */
.ct-quiz { position: fixed; inset: 0; z-index: 60; background: var(--paper); }
.ct-quiz.hidden { display: none; }
.ct-quiz__bar { position: absolute; left: 0; right: 0; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); z-index: 2; }
.ct-quiz__bar--top { top: 0; border-bottom: 1px solid var(--line); }
.ct-quiz__bar--bottom { bottom: 0; border-top: 1px solid var(--line); }
.ct-quiz__inner { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.ct-quiz__progress { display: flex; gap: 4px; height: 5px; padding-top: 10px; }
.ct-quiz__dim { flex: 1; display: flex; gap: 2px; }
.dim-segment { flex: 1; height: 5px; border-radius: 999px; background: var(--mint); transition: background-color 0.3s ease; }
.dim-segment.filled { background: var(--green); }
.ct-quiz__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.ct-quiz__exit, .ct-quiz__step { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.88rem; cursor: pointer; padding: 6px 2px; }
.ct-quiz__exit:hover, .ct-quiz__step:hover { color: var(--ink); }
.ct-quiz__status { display: flex; align-items: center; gap: 14px; }
.ct-quiz__badge { display: inline-flex; align-items: center; gap: 7px; background: var(--mint-soft); color: var(--green-dark); border-radius: 999px; padding: 5px 13px; font-size: 0.8rem; font-weight: 600; transition: all 0.3s ease; }
.ct-quiz__count { font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-quiz__stage { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 120px 20px 110px; }
.ct-quiz__slides { position: relative; width: 100%; max-width: 620px; min-height: 400px; }
.ct-quiz__nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; }
.ct-quiz__hint { font-size: 0.78rem; color: var(--muted); display: none; }
@media (min-width: 720px) { .ct-quiz__hint { display: inline; } }

.q-slide { position: absolute; inset: 0; opacity: 0; transform: translateX(34px); pointer-events: none; transition: opacity 0.35s ease, transform 0.35s ease; }
.q-slide.active { opacity: 1; transform: none; pointer-events: auto; position: relative; }
.q-slide.exit-left { opacity: 0; transform: translateX(-34px); }
.ct-question { font-family: var(--font-display); font-size: clamp(1.35rem, 3.6vw, 1.85rem); font-weight: 700; color: var(--ink); line-height: 1.35; text-align: center; margin: 0 0 34px; }
.ct-options { display: grid; gap: 12px; max-width: 460px; margin: 0 auto; }
.likert-btn.ct-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 15px 18px; font: inherit; font-size: 1rem; color: var(--ink); cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease; }
.likert-btn.ct-option:hover { border-color: var(--green); transform: translateY(-1px); }
.likert-btn.ct-option.selected { border-color: var(--green); background: var(--mint-soft); font-weight: 600; }
.ct-key { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.motiv-msg { margin-top: 26px; min-height: 1.4em; font-size: 0.9rem; color: var(--green); opacity: 0; transition: opacity 0.4s ease; text-align: center; }
.motiv-msg.show { opacity: 1; }

.milestone-toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; z-index: 70; }
.milestone-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ct-toast { display: flex; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 22px; }
.ct-toast span { font-size: 1.5rem; }
.ct-toast p { margin: 0; }
.ct-toast p:first-child { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.ct-toast p:last-child { font-size: 0.78rem; color: var(--muted); }

.exit-overlay { position: fixed; inset: 0; background: rgba(23, 58, 55, 0.5); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 80; }
.exit-overlay.show { display: flex; }
.ct-exit { background: var(--white); border-radius: var(--radius); padding: 32px; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.ct-exit h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 10px; color: var(--ink); }
.ct-exit p { margin: 0 0 6px; color: var(--ink-soft); font-size: 0.92rem; }
.ct-exit__note { color: var(--muted) !important; font-size: 0.82rem !important; margin-bottom: 24px !important; }
.ct-exit__actions { display: flex; gap: 12px; }
.ct-exit__actions .btn { flex: 1; }

/* --- Results ----------------------------------------------------------- */
#test-results.hidden { display: none; }
.ct-results__hero { background: var(--green-dark); color: var(--white); padding: 72px 0 64px; }
.ct-results__grid { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .ct-results__grid { grid-template-columns: minmax(0, 1fr) 300px; } }
.ct-results__hero h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 8px 0 12px; color: var(--white); }
.ct-results__hero .lead { color: rgba(255, 255, 255, 0.82); margin: 0; }
.ct-panel { background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 20px; padding: 22px; margin-top: 22px; }
.ct-panel.hidden { display: none; }
.ct-panel__title, .ct-panel h3 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 10px; color: var(--white); }
.ct-panel p { margin: 0 0 6px; font-size: 0.92rem; line-height: 1.6; color: rgba(255, 255, 255, 0.88); }
.ct-band__title { font-weight: 700; margin-top: 6px; }
.ct-band__text { font-size: 0.9rem; line-height: 1.6; margin-top: 8px; }
.ct-band__note { font-size: 0.78rem; opacity: 0.8; margin-top: 12px; }
.ct-radar { display: flex; justify-content: center; }
.ct-radar svg { width: 280px; height: 280px; }

.ct-results__body { max-width: 680px; }
#results-alerts.hidden { display: none; }
.ct-flag { border: 2px solid var(--coral); background: var(--coral-soft); border-radius: 20px; padding: 24px; margin-bottom: 16px; }
.ct-flag__title { font-family: var(--font-display); font-weight: 700; color: var(--coral-dark); margin: 0 0 8px; }
.ct-flag__text { font-size: 0.92rem; line-height: 1.65; color: var(--ink); margin: 0; }

.result-card.ct-result { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 24px; margin-bottom: 16px; opacity: 0; transform: translateY(12px); transition: opacity 0.45s ease, transform 0.45s ease; }
.result-card.ct-result.visible { opacity: 1; transform: none; }
.ct-result__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.ct-result__icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.ct-result__info { flex: 1; min-width: 0; }
.ct-result__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 12px; }
.ct-result__name { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.ct-result__pct { font-size: 0.85rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.ct-result__track { width: 100%; background: var(--mint-soft); border-radius: 999px; height: 8px; margin-top: 8px; }
.ct-result__fill { height: 8px; border-radius: 999px; transition: width 0.8s ease; }
.ct-result__level { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 0.92rem; margin: 0 0 6px; }
.ct-result__text { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.65; margin: 0; }

.ct-results__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 34px; }
.ct-resume { margin-top: 16px; }
.confetti-piece { position: fixed; width: 9px; height: 9px; top: -12px; z-index: 90; pointer-events: none; animation: ct-fall 3s linear forwards; }
@keyframes ct-fall { to { transform: translateY(105vh) rotate(720deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .q-slide, .result-card.ct-result, .motiv-msg, .milestone-toast, .ct-result__fill { transition: none !important; }
  .confetti-piece { display: none; }
}
