/* ========================================
   How It Works — Page
   Layout/content based on design/how-it-works-mockup-subpage.html
======================================== */

.cs-hiw-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- Page title ---------- */

.cs-hiw-title-section {
    padding: 80px 0 8px;
}

.cs-hiw-title-section h1 {
    font-size: 34px;
    font-weight: 700;
    color: var(--cs-text);
    margin: 0 0 8px;
    line-height: 1.15;
}

.cs-hiw-subtitle {
    font-size: 18px;
    color: var(--cs-muted);
    margin: 0;
    max-width: 560px;
}

@media (max-width: 767px) {
    .cs-hiw-title-section {
        padding: 40px 0 8px;
    }

    .cs-hiw-title-section h1 {
        font-size: 28px;
    }
}

/* ---------- Card ---------- */

.cs-hiw-card {
    background: var(--cs-card-bg);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-card-radius);
    box-shadow: var(--cs-card-shadow);
    padding: 36px;
    margin: 40px 0;
}

.cs-hiw-card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--cs-text);
    margin: 0 0 24px;
}

/* Steps - icon circle + connecting line, page-scoped sizing
   (smaller icons than the thank-you page's .cs-step, but title/desc sizes
   match it: 18px title, 16px desc - the site's established reading tier) */

.cs-hiw-step {
    display: flex;
    gap: 16px;
}

.cs-hiw-step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48px;
    flex-shrink: 0;
}

.cs-hiw-step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cs-hiw-step-icon i {
    font-size: 18px;
    color: var(--cs-blue);
}

.cs-hiw-step-line {
    width: 2px;
    flex: 1;
    min-height: 20px;
    background: rgba(45, 127, 249, 0.2);
    margin: 6px 0;
}

.cs-hiw-step-content {
    padding-top: 8px;
    padding-bottom: 24px;
}

.cs-hiw-step:last-child .cs-hiw-step-content {
    padding-bottom: 0;
}

.cs-hiw-step-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cs-text);
    margin: 0 0 3px;
}

.cs-hiw-step-desc {
    font-size: 16px;
    color: var(--cs-muted);
    line-height: 1.6;
}

/* Benefits - restrained list, not a marketing grid */

.cs-hiw-benefit-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--cs-border-soft);
}

.cs-hiw-benefit-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.cs-hiw-benefit-row:first-child {
    padding-top: 0;
}

.cs-hiw-benefit-row i {
    color: #2fa83f;
    font-size: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

.cs-hiw-benefit-row h3 {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--cs-text);
    margin: 0 0 2px;
}

.cs-hiw-benefit-row span {
    font-size: 16px;
    color: var(--cs-muted);
    line-height: 1.5;
}

/* ---------- Showcase panel - reuses the score ring visual from the
   homepage "Why ClientScore" exploration (Option P). Both earlier
   full-bleed attempts (width:100vw+position:relative, and the
   calc(50% - 50vw) margin trick) size the actual content box itself off
   viewport width, which broke down inside this page's actual nesting -
   one visibly jumped on load, the other rendered wider than the
   viewport and let the centered text overflow off the right edge.
   Instead: the real content box (.cs-hiw-showcase) stays at its normal,
   safe width - same as every other section on the page, so its text can
   never overflow - and a decorative ::before pseudo-element provides the
   edge-to-edge gray background. If that pseudo-element's vw math is off
   by a few pixels it's invisible (solid color), unlike text. */

.cs-hiw-showcase {
    position: relative;
    padding: 80px 0;
    margin-top: 40px;
    margin-bottom: 40px;
}

.cs-hiw-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    background: #f8fafc;
    z-index: -1;
}

.cs-hiw-showcase-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 56px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.cs-hiw-showcase-visual {
    background: #ffffff;
    border: 1px solid var(--cs-border);
    border-radius: 20px;
    box-shadow: var(--cs-card-shadow);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Client header - avatar initials + name + contact, matching how the
   real client-profile page renders it (.cs-client-avatar/.cs-client-
   header-details/.cs-client-contact-details in clientscore-dashboard.css) */

.cs-hiw-showcase-client {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cs-hiw-showcase-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border: 2px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--cs-blue);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.cs-hiw-showcase-client-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--cs-text);
}

.cs-hiw-showcase-client-contact {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 14px;
    color: var(--cs-muted);
}

.cs-hiw-showcase-client-contact i {
    width: 14px;
    font-size: 13px;
    color: var(--cs-muted-light);
    text-align: center;
}

.cs-hiw-showcase-divider {
    height: 1px;
    background: var(--cs-border-soft);
}

.cs-hiw-showcase-score-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.cs-hiw-ring {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.cs-hiw-ring svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transform: rotate(-90deg);
}

.cs-hiw-ring circle {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.cs-hiw-ring .ring-bg,
.cs-hiw-ring .ring-gap {
    stroke: #e5e7eb;
}

.cs-hiw-ring .ring-remaining {
    stroke: var(--cs-blue);
}

.cs-hiw-ring .ring-score {
    stroke: #2fa83f;
}

.cs-hiw-ring-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cs-hiw-ring-content strong {
    font-size: 26px;
    font-weight: 800;
    color: var(--cs-text);
    line-height: 1;
}

.cs-hiw-ring-content span {
    font-size: 10px;
    color: var(--cs-muted-light);
    margin-top: 3px;
}

.cs-hiw-stats {
    flex: 1;
}

.cs-hiw-stat {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--cs-border-soft);
}

.cs-hiw-stat:last-child {
    border-bottom: 0;
}

.cs-hiw-stat strong {
    font-weight: 700;
    color: var(--cs-text);
}

.cs-hiw-eyebrow {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--cs-blue);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cs-hiw-showcase-text h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.3;
    color: var(--cs-text);
}

.cs-hiw-showcase-text p {
    font-size: 18px;
    color: var(--cs-muted);
    line-height: 1.6;
    margin: 0;
    max-width: 460px;
}

@media (max-width: 900px) {
    .cs-hiw-showcase {
        padding: 40px 0;
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .cs-hiw-showcase-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 32px;
    }

    .cs-hiw-showcase-visual {
        max-width: 420px;
        margin: 0 auto;
        flex-direction: column;
    }

    .cs-hiw-showcase-client {
        justify-content: center;
    }

    .cs-hiw-showcase-score-row {
        flex-direction: column;
        gap: 20px;
    }

    .cs-hiw-stats {
        width: 100%;
        max-width: 260px;
    }

    .cs-hiw-showcase-text p {
        margin: 0 auto;
    }
}

/* ---------- Closing action - two-column layout matching the homepage
   Final CTA (.cs-final-cta): text left, visual right. Visual is a
   placeholder box until a real image is ready. ---------- */

.cs-hiw-closing {
    padding: 40px 0 80px;
}

.cs-hiw-closing-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
    text-align: left;
}

.cs-hiw-closing-text p {
    font-size: 16px;
    color: var(--cs-muted);
    margin: 0 0 16px;
}

.cs-hiw-closing-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    background: #f8fafc;
    border: 1px dashed var(--cs-border);
    border-radius: var(--cs-card-radius);
    color: var(--cs-muted-light);
    font-size: 14px;
}

/* Matches the homepage Final CTA's button sizing fix - .btn-primary alone
   doesn't carry Elementor's own min-width, so it's restated here too. */
.cs-hiw-closing .btn-primary {
    min-width: 285px;
}

@media (max-width: 767px) {
    body.cs-how-it-works-page #content.site-content,
    body.cs-how-it-works-page .ast-container,
    body.cs-how-it-works-page #primary,
    body.cs-how-it-works-page .entry-content,
    body.cs-how-it-works-page .elementor,
    body.cs-how-it-works-page .e-con,
    body.cs-how-it-works-page .e-con-inner,
    body.cs-how-it-works-page .elementor-widget-shortcode,
    body.cs-how-it-works-page .elementor-shortcode {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .cs-hiw-card {
        padding: 28px 24px;
        margin: 24px 0;
    }

    /* Give up on edge-to-edge full-bleed for this section on mobile -
       every vw-based technique tried broke inside this page's specific
       Astra/Elementor nesting. Contained width (same as every other
       card, which has never overflowed) with the background applied
       directly is boring but guaranteed not to overflow. */
    .cs-hiw-showcase::before {
        display: none;
    }

    .cs-hiw-showcase {
        background: #f8fafc;
        /* No horizontal padding here - .cs-hiw-wrap already supplies
           28px side spacing, and .cs-hiw-showcase-visual has its own
           24px padding. Adding padding here too stacked on top of both,
           throwing off left/right balance (confirmed via DevTools). */
        margin: 24px 0;
    }

    /* .cs-hiw-wrap already supplies 28px side padding now that this
       section is contained (not full-bleed) on mobile - the inner's own
       copy of that padding would just needlessly squeeze it further. */
    .cs-hiw-showcase-inner {
        padding: 0;
        gap: 24px;
        /* Left-align instead of center, matching .cs-hiw-card's steps/
           benefits above and below it - centering a lopsided shape
           (small circle next to wider text) reads as "shifted right"
           since it doesn't share the same left starting edge as the
           rest of the page's content. */
        text-align: left;
    }

    .cs-hiw-showcase-visual {
        padding: 24px;
        margin: 0;
        width: 319px !important;
    }

    .cs-hiw-showcase-client {
        justify-content: flex-start;
    }

    .cs-hiw-showcase-score-row {
        align-items: flex-start;
    }

    .cs-hiw-showcase-text p {
        margin: 0;
    }

    .cs-hiw-closing-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
    }

    .cs-hiw-closing-visual {
        min-height: 140px;
    }

    .cs-hiw-closing {
        padding: 24px 0 32px;
    }

    .cs-hiw-closing .btn-primary {
        width: 100%;
    }
}
