/* ==========================================================
   MANAFLOW — The Success Trap (diagnostic)
   Page-scoped styles. Loaded only on success-trap.php.
   Inherits brand tokens from style.css:
     --color-primary #AE152D · --color-dark #111 · --color-text #696969
     --color-light-bg #F5F5F5 · Lato · --radius 8px
   All classes namespaced .st- to avoid Bootstrap / global collisions.
   ========================================================== */

.st-page {
    --st-heat-0: #c9cdcf;   /* low pressure  */
    --st-heat-1: #d98e97;   /* transition    */
    --st-heat-2: var(--color-primary); /* trap */
    --st-ink-soft: #4a4a4a;
    --st-line: #e5e5e5;
}

/* --- Hero (reuses .hero-section from style.css) ------------ */
.st-hero .hero-title { max-width: 780px; }
.st-hero .hero-subtitle { max-width: 620px; }

.st-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1rem;
}

.st-byline {
    margin-top: 1.75rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.72);
}
.st-byline strong { color: #fff; font-weight: 700; }

/* --- Intro / "It's probably not you" ---------------------- */
.st-intro { background: #fff; }

.st-intro p {
    font-size: 1.08rem;
    line-height: 1.85;
    margin-bottom: 1.1rem;
}

.st-pull {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-dark);
    border-left: 4px solid var(--color-primary);
    padding-left: 1.25rem;
    margin: 1.75rem 0 0;
    line-height: 1.5;
}

.st-intro-image {
    width: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* --- Diagnostic --------------------------------------------- */
.st-diagnostic { background: var(--color-light-bg); }

.st-scale {
    background: #fff;
    border: 1px solid var(--st-line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    font-size: 0.9rem;
}
.st-scale__item { color: var(--st-ink-soft); }
.st-scale__num {
    display: inline-block;
    min-width: 1.4rem;
    height: 1.4rem;
    line-height: 1.4rem;
    text-align: center;
    border-radius: 50%;
    background: var(--color-dark);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 0.4rem;
}

/* Lettered section block */
.st-block { margin-bottom: 2.25rem; }

.st-block__head {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--st-line);
}
.st-block__letter {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
}
.st-block__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
    margin: 0;
}

/* One statement */
.st-q {
    border: 0;
    margin: 0 0 0.75rem;
    padding: 1.1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--st-line);
    border-radius: var(--radius);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.st-q.is-answered { border-color: #d8d8d8; }
.st-q:focus-within { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07); }

.st-q__text {
    font-size: 1.02rem;
    line-height: 1.55;
    color: var(--color-dark);
    font-weight: 500;
    margin-bottom: 0.9rem;
    float: none;
    width: auto;
}

/* 0–3 segmented control */
.st-opts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.st-opt {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.15rem;
    padding: 0.6rem 0.3rem;
    border: 1.5px solid var(--st-line);
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    min-height: 62px;
}
.st-opt__input {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
    margin: 0;
}
.st-opt__num { font-size: 1.25rem; font-weight: 700; color: var(--color-dark); line-height: 1; }
.st-opt__label { font-size: 0.72rem; color: var(--st-ink-soft); line-height: 1.15; }

.st-opt:hover { border-color: #c9a2a8; }

/* checked — :has for modern browsers, .is-checked JS fallback */
.st-opt:has(.st-opt__input:checked),
.st-opt.is-checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.st-opt:has(.st-opt__input:checked) .st-opt__num,
.st-opt:has(.st-opt__input:checked) .st-opt__label,
.st-opt.is-checked .st-opt__num,
.st-opt.is-checked .st-opt__label { color: #fff; }

/* keyboard focus */
.st-opt:has(.st-opt__input:focus-visible),
.st-opt.is-focus {
    outline: 3px solid rgba(174, 21, 45, 0.35);
    outline-offset: 2px;
}

/* --- Progress + reveal ------------------------------------- */
.st-actions {
    position: sticky;
    bottom: 0;
    background: rgba(245, 245, 245, 0.96);
    backdrop-filter: blur(6px);
    padding: 1.1rem 0 1.25rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--st-line);
    z-index: 5;
}
.st-progress {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.9rem;
}
.st-progress__track {
    flex: 1;
    height: 8px;
    background: #e2e2e2;
    border-radius: 999px;
    overflow: hidden;
}
.st-progress__fill {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: 999px;
    transition: width 0.35s ease;
}
.st-progress__count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--st-ink-soft);
    white-space: nowrap;
}
.st-reveal[disabled] { opacity: 0.45; cursor: not-allowed; }
.st-hint {
    font-size: 0.82rem;
    color: var(--st-ink-soft);
    margin: 0.5rem 0 0;
}

/* --- Results ----------------------------------------------- */
.st-results { background: #fff; }
.st-results[hidden] { display: none; }

.st-result-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-primary);
    display: block;
    margin-bottom: 0.75rem;
}
.st-score-num {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--color-dark);
    line-height: 1;
}
.st-score-num small { font-size: 1.5rem; font-weight: 400; color: var(--color-text); }
.st-band-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--color-dark);
    margin: 0.75rem 0 1rem;
    line-height: 1.2;
}
.st-band-body { font-size: 1.05rem; line-height: 1.8; }

/* Current gauge (signature) */
.st-gauge-wrap { margin: 2.5rem 0 1rem; }
.st-gauge {
    position: relative;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        var(--st-heat-0) 0%,
        var(--st-heat-1) 55%,
        var(--st-heat-2) 100%);
}
.st-gauge__tick {
    position: absolute;
    top: -6px; bottom: -6px;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
}
.st-gauge__marker {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    transition: left 0.9s cubic-bezier(.22,.61,.36,1);
    z-index: 2;
}
.st-gauge__dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--color-dark);
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.st-gauge__bubble {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-dark);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    white-space: nowrap;
}
.st-gauge__bubble::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-dark);
}
.st-zones {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin-top: 0.85rem;
    font-size: 0.75rem;
    color: var(--st-ink-soft);
}
.st-zones span { text-align: center; }
.st-zones span:first-child { text-align: left; }
.st-zones span:last-child { text-align: right; }

/* Section breakdown */
.st-breakdown {
    background: var(--color-light-bg);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-top: 1rem;
}
.st-breakdown h3 {
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--st-ink-soft);
    margin-bottom: 1.25rem;
    font-weight: 700;
}
.st-brk-row {
    display: grid;
    grid-template-columns: 160px 1fr 32px;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.7rem;
}
.st-brk-name { font-size: 0.9rem; color: var(--color-dark); font-weight: 500; }
.st-brk-track { height: 10px; background: #e2e2e2; border-radius: 999px; overflow: hidden; }
.st-brk-fill {
    height: 100%; width: 0%;
    background: #c2c2c2;
    border-radius: 999px;
    transition: width 0.7s ease;
}
.st-brk-row.is-key .st-brk-fill { background: var(--color-primary); }
.st-brk-row.is-key .st-brk-name { font-weight: 700; }
.st-brk-val { font-size: 0.85rem; font-weight: 700; color: var(--st-ink-soft); text-align: right; }

/* Named trap */
.st-trap {
    margin-top: 2.5rem;
    background: var(--color-dark);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.5rem;
}
.st-trap__eyebrow {
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}
.st-trap__name {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0.4rem 0 0.4rem;
}
.st-trap__quote {
    font-style: italic;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.25rem;
}
.st-trap__body { color: rgba(255, 255, 255, 0.82); font-size: 1.02rem; line-height: 1.8; margin: 0; }
.st-trap__also {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Closing insight */
.st-insight { background: var(--color-light-bg); }
.st-insight p { font-size: 1.08rem; line-height: 1.85; margin-bottom: 1.1rem; }
.st-insight .st-pull { border-left-color: var(--color-primary); }

/* Retake */
.st-retake {
    background: transparent;
    border: 0;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 575px) {
    .st-opt { padding: 0.55rem 0.15rem; min-height: 58px; }
    .st-opt__num { font-size: 1.1rem; }
    .st-opt__label { font-size: 0.66rem; }
    .st-trap { padding: 1.75rem 1.4rem; }
    .st-trap__name { font-size: 1.6rem; }
    .st-score-num { font-size: 3.5rem; }
    .st-band-title { font-size: 1.5rem; }
    .st-brk-row { grid-template-columns: 120px 1fr 28px; gap: 0.6rem; }
    .st-breakdown { padding: 1.35rem; }
}

/* --- Reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .st-gauge__marker,
    .st-progress__fill,
    .st-brk-fill,
    .st-q { transition: none; }
    html { scroll-behavior: auto; }
}