/* css/page-how-it-works.css */
@layer pages {

    /* ── Hero ── */
    .hiw-hero {
        text-align: center;
        padding: 3rem 0 2.5rem;
    }

    .hiw-hero .page-h1 em {
        font-style: italic;
        color: var(--color-sub);
    }

    /* ── Section wrapper ── */
    .hiw-section {
        margin: 2.5rem 0;
    }

    .hiw-section-hd {
        margin-bottom: 2rem;
    }

    .hiw-eyebrow-pill {
        display: inline-flex;
        align-items: center;
        font-size: 0.6rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        color: var(--color-text);
        background: rgba(255,255,255,0.7);
        border: 1.5px solid rgba(200,215,245,0.75);
        border-radius: var(--radius-pill);
        padding: 0.35em 1em;
        box-shadow: 0 3px 0 rgba(140,162,215,0.3);
        margin-bottom: 1rem;
    }

    /* ── Steps grid ── */
    .hiw-steps-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .hiw-step {
        padding: 1.7rem 1.4rem 1.6rem;
        border: 1.5px solid transparent;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        position: relative;
        transition: transform 0.14s;
    }
    .hiw-step:hover { transform: translateY(-4px); }

    /* Blue top stripe */
    .hiw-step::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 4px;
        border-radius: 2px 2px 0 0;
    }

    .hiw-step--blue   { background: #e8f0ff; border-color: #c0d0f8; border-radius: 22px 14px 20px 16px / 16px 22px 14px 20px; box-shadow: 0 7px 0 #8898d8, 0 12px 28px rgba(60,80,200,0.16); }
    .hiw-step--green  { background: #e4f8ee; border-color: #a8e0c0; border-radius: 14px 22px 18px 14px / 18px 14px 22px 18px; box-shadow: 0 7px 0 #68b888, 0 12px 28px rgba(40,140,80,0.15); }
    .hiw-step--purple { background: #ede8fc; border-color: #c8b8f0; border-radius: 20px 14px 22px 16px / 14px 20px 16px 22px; box-shadow: 0 7px 0 #9878cc, 0 12px 28px rgba(100,60,180,0.15); }
    .hiw-step--orange { background: #fff8e8; border-color: #f8d8a0; border-radius: 16px 22px 14px 20px / 20px 16px 22px 14px; box-shadow: 0 7px 0 #c8a030, 0 12px 28px rgba(180,140,0,0.15); }
    .hiw-step--teal   { background: #e0f8f0; border-color: #90e0c8; border-radius: 22px 14px 18px 20px / 16px 22px 20px 14px; box-shadow: 0 7px 0 #40b898, 0 12px 28px rgba(20,140,100,0.14); }
    .hiw-step--blue2  { background: #e8f0ff; border-color: #b8ccf8; border-radius: 14px 22px 16px 20px / 20px 14px 22px 16px; box-shadow: 0 7px 0 #7888d8, 0 12px 28px rgba(60,80,200,0.14); }
    .hiw-step--purple2{ background: #ede8fc; border-color: #c0b0f0; border-radius: 20px 16px 22px 12px / 12px 20px 16px 22px; box-shadow: 0 7px 0 #9070cc, 0 12px 28px rgba(100,60,180,0.14); }
    .hiw-step--green2 { background: #e4f8ee; border-color: #a0e0b8; border-radius: 14px 20px 14px 22px / 22px 14px 20px 14px; box-shadow: 0 7px 0 #60b880, 0 12px 28px rgba(40,140,80,0.14); }

    .hiw-step-num {
        font-size: 0.55rem;
        font-weight: 800;
        letter-spacing: 0.12em;
        color: var(--color-lbl);
        text-transform: uppercase;
    }

    .hiw-step-title {
        font-size: 0.78rem;
        font-weight: 800;
        color: var(--color-text);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .hiw-step-body {
        font-size: 0.78rem;
        color: var(--color-sub);
        line-height: 1.65;
    }

    /* ── Algorithm section ── */
    .hiw-algo-wrap {
        background: rgba(255,255,255,0.55);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255,255,255,0.7);
        border-radius: 28px 24px 28px 24px / 24px 28px 24px 28px;
        box-shadow: 0 8px 0 rgba(160,180,220,0.3), 0 3px 24px rgba(100,120,200,0.1);
        padding: 2.5rem 2rem;
        margin: 2.5rem 0;
    }

    .hiw-score-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .hiw-score-card {
        background: #fff;
        border: 1px solid rgba(200,212,238,0.5);
        border-radius: 16px 12px 16px 12px / 12px 16px 12px 16px;
        padding: 1.2rem 0.85rem;
        text-align: center;
    }

    .hiw-score-pct {
        font-size: 1.6rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        line-height: 1;
        margin-bottom: 4px;
    }
    .hiw-score-card--blue   .hiw-score-pct { color: var(--color-blue); }
    .hiw-score-card--green  .hiw-score-pct { color: var(--color-green-d); }
    .hiw-score-card--yellow .hiw-score-pct { color: #d4a800; }
    .hiw-score-card--pink   .hiw-score-pct { color: #d060a0; }
    .hiw-score-card--orange .hiw-score-pct { color: var(--color-orange); }

    .hiw-score-lbl {
        font-size: 0.55rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        color: var(--color-lbl);
        text-transform: uppercase;
        margin-bottom: 8px;
    }

    .hiw-score-track {
        height: 5px;
        background: var(--color-surface2);
        border: 1px solid var(--color-border);
        border-radius: 4px;
        overflow: hidden;
        margin-bottom: 8px;
    }

    .hiw-score-fill { height: 100%; border-radius: 4px; }
    .hiw-score-card--blue   .hiw-score-fill { background: linear-gradient(90deg, var(--color-blue), #88b8fc); }
    .hiw-score-card--green  .hiw-score-fill { background: linear-gradient(90deg, var(--color-green-d), var(--color-green)); }
    .hiw-score-card--yellow .hiw-score-fill { background: linear-gradient(90deg, #d4a800, #f0c820); }
    .hiw-score-card--pink   .hiw-score-fill { background: linear-gradient(90deg, #d060a0, #f080c0); }
    .hiw-score-card--orange .hiw-score-fill { background: linear-gradient(90deg, var(--color-orange), #f8b870); }

    .hiw-score-desc {
        font-size: 0.68rem;
        color: var(--color-sub);
        line-height: 1.5;
        text-align: left;
    }

    /* ── Bottom CTA ── */
    .hiw-cta-dual {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .hiw-cta-card {
        padding: 2.5rem 2.2rem;
        border: 1.5px solid transparent;
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
    }

    .hiw-cta-card--green {
        background: linear-gradient(145deg, #d8f8e8 0%, #c0f0d8 40%, #e0faf0 100%);
        border-color: #90d8b8;
        border-radius: 26px 18px 24px 20px / 20px 26px 18px 24px;
        box-shadow: 0 10px 0 #68b888, 0 20px 40px rgba(40,140,80,0.18);
    }
    .hiw-cta-card--purple {
        background: linear-gradient(145deg, #ece4fc 0%, #d8c8f8 40%, #e8e0ff 100%);
        border-color: #b8a0f0;
        border-radius: 18px 26px 20px 24px / 24px 18px 26px 20px;
        box-shadow: 0 10px 0 #9070c8, 0 20px 40px rgba(100,60,180,0.18);
    }

    .hiw-cta-tag {
        font-size: 0.62rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        padding: 0.3em 0.9em;
        border-radius: var(--radius-pill);
        width: fit-content;
    }
    .hiw-cta-tag--green  { background: #b8eec8; color: #1a6a38; box-shadow: 0 2px 0 #68b888; }
    .hiw-cta-tag--purple { background: #d0b8f8; color: #5030a0; box-shadow: 0 2px 0 #9070c8; }

    .hiw-cta-title {
        font-size: clamp(1.4rem, 2.2vw, 1.8rem);
        font-weight: 800;
        color: var(--color-text);
        line-height: 1.15;
        letter-spacing: -0.03em;
    }

    .hiw-cta-body {
        font-size: 0.82rem;
        color: var(--color-sub);
        line-height: 1.7;
        max-width: 360px;
    }

    .hiw-cta-note {
        font-size: 0.65rem;
        color: var(--color-lbl);
    }

    .hiw-cta-btn {
        display: inline-block;
        padding: 0.65em 1.4em;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        color: #fff;
        text-decoration: none;
        border-radius: var(--radius-pill);
        align-self: flex-start;
        transition: transform 0.1s, box-shadow 0.1s;
    }
    .hiw-cta-btn--green {
        background: linear-gradient(160deg, #50d890, var(--color-green));
        box-shadow: 0 4px 0 var(--color-green-d), 0 6px 16px rgba(40,160,80,0.3);
    }
    .hiw-cta-btn--green:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 var(--color-green-d), 0 8px 20px rgba(40,160,80,0.35); }
    .hiw-cta-btn--green:active { transform: translateY(2px);  box-shadow: 0 2px 0 var(--color-green-d); }
    .hiw-cta-btn--purple {
        background: linear-gradient(160deg, #b898f0, var(--color-purple));
        box-shadow: 0 4px 0 var(--color-purple-d), 0 6px 16px rgba(80,48,168,0.3);
    }
    .hiw-cta-btn--purple:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 var(--color-purple-d), 0 8px 20px rgba(80,48,168,0.35); }
    .hiw-cta-btn--purple:active { transform: translateY(2px);  box-shadow: 0 2px 0 var(--color-purple-d); }

    /* ── Responsive ── */
    @media (max-width: 900px) {
        .hiw-steps-grid { grid-template-columns: repeat(2, 1fr); }
        .hiw-score-grid { grid-template-columns: repeat(3, 1fr); }
        .hiw-cta-dual   { grid-template-columns: 1fr; }
    }

    @media (max-width: 540px) {
        .hiw-steps-grid { grid-template-columns: 1fr; }
        .hiw-score-grid { grid-template-columns: repeat(2, 1fr); }
    }

}
