/* ==========================================================================
   HOW IT WORKS — style.css
   ========================================================================== */

.intero-hiw {
    background: var(--color-bg);
    padding: var(--section-padding);
}

.intero-hiw__header {
    text-align: center;
    margin-bottom: 60px;
}

.intero-hiw__headline {
    font-size: var(--font-size-h2);
    font-weight: 800;
    color: var(--color-heading);
    line-height: var(--line-height-heading);
    letter-spacing: -0.02em;
    margin: 12px 0 0;
}

.intero-hiw__body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: start;
}

@media (min-width: 992px) {
    .intero-hiw__body {
        grid-template-columns: 1fr 1fr;
        gap: 80px;
        align-items: start;
    }
}

/* ── Accordion ────────────────────────────────────────────────────────────── */
.intero-hiw__item { border-bottom: 1px solid var(--color-border); }

.intero-hiw__trigger {
    display: flex; align-items: center; gap: 16px;
    width: 100%; background: none; border: none;
    padding: 24px 0; cursor: pointer; text-align: left;
    transition: var(--transition-base);
}

.intero-hiw__step-num {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--radius-full);
    background: var(--color-bg-muted); border: 2px solid var(--color-border);
    font-size: var(--font-size-sm); font-weight: 800;
    color: var(--color-text-muted); flex-shrink: 0;
    transition: var(--transition-base);
}

.intero-hiw__step-title {
    flex: 1; font-size: var(--font-size-h3); font-weight: 700;
    color: var(--color-heading); line-height: var(--line-height-heading);
    transition: var(--transition-base);
}

.intero-hiw__chevron {
    flex-shrink: 0; color: var(--color-text-muted);
    transition: transform 0.3s ease;
}
.intero-hiw__chevron svg { width: 20px; height: 20px; display: block; }

.intero-hiw__item--active .intero-hiw__trigger {
    border-left: 3px solid var(--color-secondary); padding-left: 16px;
}
.intero-hiw__item--active .intero-hiw__step-num {
    background: var(--color-secondary); border-color: var(--color-secondary); color: var(--color-bg);
}
.intero-hiw__item--active .intero-hiw__step-title { color: var(--color-secondary); }
.intero-hiw__item--active .intero-hiw__chevron { transform: rotate(180deg); color: var(--color-secondary); }

.intero-hiw__panel { padding: 0 0 24px 52px; }
.intero-hiw__step-body { font-size: var(--font-size-base); color: var(--color-text); line-height: var(--line-height-base); margin: 0; }

.intero-hiw__cta-wrap { margin-top: 32px; }

/* ── Panel container ──────────────────────────────────────────────────────── */
.intero-hiw__panels {
    position: relative;
    height: 540px;          /* fixed height — all panels absolute */
}

.intero-hiw__panel-vis {
    position: absolute;     /* always — never changes */
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    overflow-y: auto;
}

.intero-hiw__panel-vis--active {
    opacity: 1;
    pointer-events: auto;
    /* position stays absolute — height is on the container */
}

@media (min-width: 992px) {
    .intero-hiw__panels {
        height: 560px;
    }
}

/* ── Shared card shell ────────────────────────────────────────────────────── */
.hiw-card {
    background: #121036;
    border-radius: 16px;
    border: 0.5px solid rgba(46,196,182,0.25);
    padding: 24px;
    font-family: var(--font-primary);
    height: 100%;
}

.hiw-card__header { margin-bottom: 18px; }
.hiw-card__title { display: block; font-size: 15px; font-weight: 700; color: rgba(255,255,255,0.9); margin-bottom: 3px; }
.hiw-card__sub   { display: block; font-size: 11px; color: rgba(255,255,255,0.3); }

/* footer */
.hiw-card__foot {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.06); padding-top: 14px; margin-top: 16px;
}
.hiw-card__foot-label { display: block; font-size: 11px; color: rgba(255,255,255,0.4); }
.hiw-card__foot-sub   { display: block; font-size: 10px; color: rgba(255,255,255,0.25); margin-top: 2px; }
.hiw-card__foot-val   { font-size: 22px; font-weight: 800; color: #2EC4B6; letter-spacing: -0.02em; opacity: 0; transition: opacity 0.5s; }
.hiw-card__foot-val.hiw-vis   { opacity: 1; }
.hiw-card__foot-val[data-hiw-static] { opacity: 1; font-size: 13px; }

/* ── Panel 1: Audit rows ──────────────────────────────────────────────────── */
.hiw-card__scan-bar  { height: 2px; background: rgba(46,196,182,0.15); border-radius: 2px; margin-bottom: 16px; overflow: hidden; }
.hiw-card__scan-fill { height: 100%; background: #2EC4B6; border-radius: 2px; width: 0; transition: width 0.05s linear; }

.hiw-card__rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }

.hiw-card__row {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    opacity: 0.35; transition: opacity 0.3s, border-color 0.3s, background 0.3s;
}
.hiw-card__row.hiw-scanning { opacity: 1; border-color: rgba(46,196,182,0.3); background: rgba(46,196,182,0.05); }
.hiw-card__row.hiw-ok       { opacity: 1; border-color: rgba(46,196,182,0.15); }
.hiw-card__row.hiw-gap      { opacity: 1; border-color: rgba(232,75,26,0.3); background: rgba(232,75,26,0.05); }

.hiw-card__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: rgba(255,255,255,0.15); transition: background 0.3s; }
.hiw-card__row.hiw-scanning .hiw-card__dot { background: #2EC4B6; }
.hiw-card__row.hiw-ok  .hiw-card__dot { background: #2EC4B6; }
.hiw-card__row.hiw-gap .hiw-card__dot { background: #E84B1A; }

.hiw-card__row-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.5); flex: 1; transition: color 0.3s; }
.hiw-card__row.hiw-scanning .hiw-card__row-label,
.hiw-card__row.hiw-ok  .hiw-card__row-label,
.hiw-card__row.hiw-gap .hiw-card__row-label { color: rgba(255,255,255,0.9); }

.hiw-card__badge { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 20px; opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.hiw-card__badge--ok  { background: rgba(46,196,182,0.15); color: #2EC4B6; }
.hiw-card__badge--gap { background: rgba(232,75,26,0.15);  color: #E84B1A; }
.hiw-card__row.hiw-ok  .hiw-card__badge--ok  { opacity: 1; }
.hiw-card__row.hiw-gap .hiw-card__badge--gap { opacity: 1; }

/* ── Panel 2: Channel bars ────────────────────────────────────────────────── */
.hiw-card__channels { display: flex; flex-direction: column; gap: 11px; margin-bottom: 4px; }

.hiw-card__ch { opacity: 0; transform: translateX(-8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.hiw-card__ch.hiw-vis { opacity: 1; transform: translateX(0); }

.hiw-card__ch-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.hiw-card__ch-name { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.8); }
.hiw-card__ch-pct  { font-size: 12px; font-weight: 800; color: #2EC4B6; }
.hiw-card__ch-pct--orange { color: #E84B1A; }

.hiw-card__bar-track { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.hiw-card__bar-fill  { height: 100%; width: 0; border-radius: 4px; transition: width 1s cubic-bezier(0.16,1,0.3,1); }
.hiw-card__bar-fill--teal   { background: #2EC4B6; }
.hiw-card__bar-fill--orange { background: #E84B1A; }
.hiw-card__bar-fill--dim    { background: rgba(255,255,255,0.18); }

.hiw-card__ch-tag { display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.22); margin-top: 3px; }
.hiw-card__ch-tag--highlight { color: rgba(46,196,182,0.55); }

/* ── Panel 3: Bar chart ───────────────────────────────────────────────────── */
.hiw-card__chart-wrap { position: relative; margin-bottom: 10px; }

.hiw-card__goal-tag {
    position: absolute; top: 0; right: 0;
    background: rgba(232,75,26,0.15); color: #E84B1A;
    font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
    padding: 3px 9px; border-radius: 4px;
    opacity: 0; transition: opacity 0.5s; white-space: nowrap; z-index: 2;
}
.hiw-card__goal-tag.hiw-vis { opacity: 1; }

.hiw-card__goal-line {
    position: absolute; left: 0; right: 0; top: 76px;
    border-top: 1.5px dashed rgba(232,75,26,0.55);
    opacity: 0; transition: opacity 0.5s; z-index: 1;
}
.hiw-card__goal-line.hiw-vis { opacity: 1; }

.hiw-card__bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 44px; }

.hiw-card__bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }

.hiw-card__bar-outer { width: 100%; background: rgba(46,196,182,0.1); border-radius: 4px 4px 0 0; position: relative; overflow: hidden; }
.hiw-card__bar-outer--hit { box-shadow: 0 0 0 1.5px rgba(232,75,26,0.5), 0 0 16px rgba(232,75,26,0.15); }

.hiw-card__bar-inner { width: 100%; height: 0; position: absolute; bottom: 0; border-radius: 4px 4px 0 0; transition: height 0.9s cubic-bezier(0.16,1,0.3,1); }
.hiw-card__bar-inner--teal   { background: #2EC4B6; }
.hiw-card__bar-inner--orange { background: #E84B1A; }

.hiw-card__bar-lbl { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 7px; }

.hiw-card__events { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.hiw-card__event { display: flex; align-items: center; gap: 5px; font-size: 10px; color: rgba(255,255,255,0.4); opacity: 0; transition: opacity 0.4s; }
.hiw-card__event.hiw-vis { opacity: 1; }
.hiw-card__event-dot { width: 6px; height: 6px; border-radius: 50%; background: #E84B1A; flex-shrink: 0; }
.hiw-card__event-dot--teal { background: #2EC4B6; }
