/* Styles for templates/how-it-works.html only. Scope every rule under
   .hiw-page — do not add global rules here. */

.hiw-page {
    font-family: var(--ff-secondary);
    color: var(--core-1-hex);
    background: var(--canvas-base-hex);
}

.hiw-page .hiw-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Hero ---------- */
.hiw-page .hiw-hero {
    padding: 56px 0 44px;
    text-align: center;
}

.hiw-page .hiw-hero h1 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: var(--fz-h1);
    letter-spacing: var(--track-title-primary);
    margin: 0 0 14px;
    text-wrap: balance;
}

.hiw-page .hiw-hero .hiw-answer {
    font-size: 1.15rem;
    line-height: 1.6;
    max-width: 64ch;
    margin: 0 auto 24px;
    color: rgba(var(--core-1-rgb), 0.8);
}

.hiw-page .hiw-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 26px;
}

.hiw-page .hiw-trust span {
    background: var(--light-bg-hex);
    border-radius: 999px;
    padding: 9px 20px;
    font-size: var(--fz-caption);
    font-weight: 600;
    letter-spacing: var(--track-caption-primary);
}

/* ---------- Steps ---------- */
.hiw-page .hiw-steps {
    padding: 40px 0 20px;
}

.hiw-page .hiw-step {
    display: grid;
    grid-template-columns: 72px 1fr 340px;
    gap: 28px;
    align-items: start;
    padding: 34px 0;
    border-bottom: 1px solid rgba(var(--ui-gray-rgb, 209, 213, 219), 0.6);
}

.hiw-page .hiw-step:last-child {
    border-bottom: 0;
}

.hiw-page .hiw-step-num {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--core-2-hex), var(--accent-1-hex));
    color: #fff;
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.hiw-page .hiw-step h2 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: var(--fz-h3);
    margin: 8px 0 10px;
    text-wrap: balance;
}

.hiw-page .hiw-step p {
    margin: 0 0 10px;
    line-height: 1.6;
    max-width: 60ch;
}

.hiw-page .hiw-note {
    background: rgba(var(--core-3-rgb), 0.07);
    border-left: 3px solid var(--core-3-hex);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 10px 14px;
    font-size: var(--fz-caption);
    line-height: 1.5;
    max-width: 60ch;
}

.hiw-page .hiw-step-media img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
}

/* ---------- Cost estimator ---------- */
.hiw-page .hiw-cost {
    padding: 48px 0;
    background: var(--dark-bg-hex);
    color: #fff;
}

.hiw-page .hiw-cost h2 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: var(--fz-h2);
    color: #fff;
    text-align: center;
    margin: 0 0 8px;
    text-wrap: balance;
}

.hiw-page .hiw-cost .hiw-cost-sub {
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    max-width: 62ch;
    margin: 0 auto 30px;
}

.hiw-page .hiw-calc {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1.25rem;
    padding: 28px;
    max-width: 640px;
    margin: 0 auto;
}

.hiw-page .hiw-calc label {
    display: block;
    font-size: var(--fz-caption);
    font-weight: 600;
    letter-spacing: var(--track-caption-primary);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.hiw-page .hiw-calc-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 0.75rem;
    padding: 4px 4px 4px 16px;
}

.hiw-page .hiw-calc-input .hiw-dollar {
    color: var(--core-1-hex);
    font-weight: 600;
}

.hiw-page .hiw-calc-input input {
    flex: 1;
    border: 0;
    outline: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--core-1-hex);
    font-family: var(--ff-secondary);
    font-variant-numeric: tabular-nums;
    padding: 10px 0;
    min-width: 0;
    background: transparent;
}

.hiw-page .hiw-calc-rows {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hiw-page .hiw-calc-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.85);
}

.hiw-page .hiw-calc-row output {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #fff;
}

.hiw-page .hiw-calc-total {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 6px;
    padding-top: 14px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
}

.hiw-page .hiw-calc-total output {
    color: var(--support-1-hex);
    font-size: 1.35rem;
}

.hiw-page .hiw-calc-fineprint {
    margin-top: 16px;
    font-size: var(--fz-caption);
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.hiw-page .hiw-calc-fineprint a {
    color: var(--support-2-hex);
}

/* Crawlable fee table fallback */
.hiw-page .hiw-fee-tables {
    max-width: 640px;
    margin: 26px auto 0;
}

.hiw-page .hiw-fee-tables summary {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    font-size: var(--fz-caption);
    font-weight: 600;
}

.hiw-page .hiw-fee-tables .hiw-fee-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.hiw-page .hiw-fee-tables table {
    width: 100%;
    font-size: var(--fz-caption);
    color: rgba(255, 255, 255, 0.85);
    border-collapse: collapse;
}

.hiw-page .hiw-fee-tables caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    color: #fff;
    padding-bottom: 8px;
}

.hiw-page .hiw-fee-tables th,
.hiw-page .hiw-fee-tables td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-variant-numeric: tabular-nums;
}

/* ---------- Won-now-what timeline ---------- */
.hiw-page .hiw-timeline {
    padding: 52px 0;
}

.hiw-page .hiw-timeline-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 34px;
}

.hiw-page .hiw-tl-item {
    position: relative;
    background: var(--light-bg-hex);
    border-radius: 1rem;
    padding: 22px 20px;
}

.hiw-page .hiw-tl-item .hiw-tl-when {
    font-size: var(--fz-caption);
    font-weight: 600;
    letter-spacing: var(--track-caption-primary);
    text-transform: uppercase;
    color: var(--core-2-hex);
    display: block;
    margin-bottom: 8px;
}

.hiw-page .hiw-tl-item h3 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 8px;
}

.hiw-page .hiw-tl-item p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(var(--core-1-rgb), 0.75);
}

/* ---------- Coverage strip ---------- */
.hiw-page .hiw-coverage {
    padding: 10px 0 52px;
}

.hiw-page .hiw-coverage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hiw-page .hiw-cov-card {
    border: 1px solid var(--ui-gray-hex);
    border-radius: 1rem;
    padding: 24px;
}

.hiw-page .hiw-cov-card h3 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 8px;
}

.hiw-page .hiw-cov-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(var(--core-1-rgb), 0.75);
}

/* ---------- Power Buyers ---------- */
.hiw-page .hiw-power {
    padding: 48px 0;
    background: var(--light-bg-hex);
}

.hiw-page .hiw-power .hiw-power-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hiw-page .hiw-power h2 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: var(--fz-h2);
    margin: 0 0 12px;
    text-wrap: balance;
}

.hiw-page .hiw-power p {
    line-height: 1.6;
    max-width: 58ch;
}

.hiw-page .hiw-power ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hiw-page .hiw-power li {
    background: var(--canvas-base-hex);
    border-radius: 0.75rem;
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    line-height: 1.5;
}

.hiw-page .hiw-power li strong {
    display: block;
}

/* ---------- Section headers & FAQ ---------- */
.hiw-page .hiw-section-title {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: var(--fz-h2);
    text-align: center;
    margin: 0 0 8px;
    text-wrap: balance;
}

.hiw-page .hiw-section-sub {
    text-align: center;
    color: rgba(var(--core-1-rgb), 0.7);
    margin: 0 auto 32px;
    max-width: 62ch;
}

.hiw-page .hiw-faq {
    padding: 52px 0;
}

.hiw-page .hiw-faq-list {
    max-width: 780px;
    margin: 0 auto;
}

.hiw-page .hiw-faq-item {
    border-bottom: 1px solid var(--ui-gray-hex);
}

.hiw-page .hiw-faq-item summary {
    cursor: pointer;
    padding: 18px 6px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.hiw-page .hiw-faq-item summary::-webkit-details-marker {
    display: none;
}

.hiw-page .hiw-faq-item summary:focus-visible {
    outline: 3px solid var(--core-3-hex);
    outline-offset: 2px;
}

.hiw-page .hiw-faq-item h3 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0;
}

.hiw-page .hiw-faq-item summary::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--core-2-hex);
    flex-shrink: 0;
    transition: transform 0.2s ease-in-out;
}

.hiw-page .hiw-faq-item[open] summary::after {
    transform: rotate(45deg);
}

.hiw-page .hiw-faq-item .hiw-faq-answer {
    padding: 0 6px 20px;
    line-height: 1.6;
    color: rgba(var(--core-1-rgb), 0.8);
    max-width: 68ch;
}

/* ---------- Byline & CTA ---------- */
.hiw-page .hiw-byline {
    text-align: center;
    font-size: var(--fz-caption);
    color: rgba(var(--core-1-rgb), 0.6);
    padding: 0 0 32px;
}

.hiw-page .hiw-cta {
    padding: 56px 0;
    text-align: center;
    background: var(--dark-bg-hex);
}

.hiw-page .hiw-cta h2 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: var(--fz-h2);
    color: #fff;
    margin: 0 0 10px;
    text-wrap: balance;
}

.hiw-page .hiw-cta p {
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 24px;
}

.hiw-page .hiw-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* ---------- Scroll reveal ---------- */
.hiw-page .hiw-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.hiw-page .hiw-reveal.hiw-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .hiw-page .hiw-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .hiw-page .hiw-step {
        grid-template-columns: 56px 1fr;
    }
    .hiw-page .hiw-step-media {
        grid-column: 2;
    }
    .hiw-page .hiw-timeline-track {
        grid-template-columns: repeat(2, 1fr);
    }
    .hiw-page .hiw-coverage-grid {
        grid-template-columns: 1fr;
    }
    .hiw-page .hiw-power .hiw-power-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hiw-page .hiw-hero h1 {
        font-size: var(--fz-h1-mobile);
    }
    .hiw-page .hiw-step {
        grid-template-columns: 1fr;
    }
    .hiw-page .hiw-step-media {
        grid-column: 1;
    }
    .hiw-page .hiw-timeline-track {
        grid-template-columns: 1fr;
    }
    .hiw-page .hiw-fee-tables .hiw-fee-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- v2 additions: guarantee band, icons, buyer toggle ---------- */

.hiw-page .hiw-hero-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.hiw-page .hiw-guarantee {
    padding: 10px 0 8px;
}

.hiw-page .hiw-guarantee-band {
    display: flex;
    align-items: center;
    gap: 22px;
    background: linear-gradient(118deg, rgba(3, 255, 136, 0.12), rgba(0, 213, 254, 0.12));
    border: 2px solid rgba(3, 200, 110, 0.45);
    border-radius: 1.25rem;
    padding: 22px 28px;
}

.hiw-page .hiw-guarantee-shield {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #067a4b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.hiw-page .hiw-guarantee-shield svg {
    width: 34px;
    height: 34px;
}

.hiw-page .hiw-guarantee-band h2 {
    font-family: var(--ff-primary);
    font-weight: 600;
    font-size: 1.35rem;
    margin: 0 0 4px;
    color: #065f3c;
}

.hiw-page .hiw-guarantee-band p {
    margin: 0;
    line-height: 1.5;
    max-width: 70ch;
}

.hiw-page .hiw-step-icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 0.65rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.hiw-page .hiw-step-icon svg {
    width: 22px;
    height: 22px;
}

.hiw-page .hiw-ic-blue   { background: rgba(var(--core-3-rgb), 0.12); color: var(--core-3-hex); }
.hiw-page .hiw-ic-purple { background: rgba(var(--accent-2-rgb), 0.12); color: var(--accent-2-hex); }
.hiw-page .hiw-ic-orange { background: rgba(var(--core-2-rgb), 0.12); color: var(--core-2-hex); }
.hiw-page .hiw-ic-green  { background: rgba(3, 200, 110, 0.12); color: #067a4b; }
.hiw-page .hiw-ic-cyan   { background: rgba(var(--support-2-rgb), 0.15); color: #0083a3; }

.hiw-page .hiw-opt-label {
    display: block;
    font-size: var(--fz-caption);
    font-weight: 600;
    letter-spacing: var(--track-caption-primary);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin: 18px 0 8px;
}

.hiw-page .hiw-buyer-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.75rem;
    overflow: hidden;
}

.hiw-page .hiw-buyer-toggle button {
    flex: 1;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--ff-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 11px 8px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.hiw-page .hiw-buyer-toggle button[aria-pressed="true"] {
    background: var(--core-2-hex);
    color: #fff;
}

.hiw-page .hiw-buyer-toggle button:focus-visible {
    outline: 3px solid var(--support-2-hex);
    outline-offset: -3px;
}

.hiw-page .hiw-cov-icon {
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(var(--core-1-rgb), 0.06);
    color: var(--core-1-hex);
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.hiw-page .hiw-cov-icon svg {
    width: 24px;
    height: 24px;
}

.hiw-page .hiw-cov-card--hero {
    border: 2px solid rgba(3, 200, 110, 0.5);
    background: linear-gradient(118deg, rgba(3, 255, 136, 0.08), rgba(0, 213, 254, 0.08));
}

.hiw-page .hiw-cov-card--hero .hiw-cov-icon {
    background: #067a4b;
    color: #fff;
}

@media (max-width: 640px) {
    .hiw-page .hiw-guarantee-band {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
    .hiw-page .hiw-buyer-toggle {
        flex-direction: column;
    }
}


/* ---------- v3 additions: flow strip, colored step numbers ---------- */

.hiw-page .hiw-flow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 4px 0 22px;
}

.hiw-page .hiw-flow-chip {
    background: var(--canvas-base-hex);
    border: 1.5px solid var(--ui-gray-hex);
    border-radius: 999px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.hiw-page .hiw-flow-chip--done {
    border-color: rgba(3, 200, 110, 0.6);
    background: rgba(3, 255, 136, 0.1);
    color: #065f3c;
}

.hiw-page .hiw-flow-arrow {
    color: var(--core-2-hex);
    font-weight: 700;
}

/* Step number circles pick up each step's accent color */
.hiw-page .hiw-step:nth-child(1) .hiw-step-num { background: linear-gradient(135deg, var(--core-3-hex), var(--support-2-hex)); }
.hiw-page .hiw-step:nth-child(2) .hiw-step-num { background: linear-gradient(135deg, var(--accent-2-hex), var(--core-3-hex)); }
.hiw-page .hiw-step:nth-child(3) .hiw-step-num { background: linear-gradient(135deg, var(--core-2-hex), var(--accent-1-hex)); }
.hiw-page .hiw-step:nth-child(4) .hiw-step-num { background: linear-gradient(135deg, #067a4b, var(--support-1-hex)); }
.hiw-page .hiw-step:nth-child(5) .hiw-step-num { background: linear-gradient(135deg, var(--support-2-hex), var(--core-3-hex)); }

.hiw-page .hiw-fee-link {
    text-align: center;
    margin: 26px auto 0;
    color: rgba(255, 255, 255, 0.8);
}

.hiw-page .hiw-fee-link a {
    color: var(--support-2-hex);
    font-weight: 600;
    text-decoration: none;
}

.hiw-page .hiw-fee-link a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .hiw-page .hiw-flow-arrow {
        display: none;
    }
}
