/* ========== How It Works — dedicated styles ========== */
.hiw-page {
    --hiw-accent-gold: #c9a227;
    --hiw-accent-gold-light: #f5ecd2;
    --hiw-accent-teal: #0d9488;
    --hiw-accent-teal-light: #ccfbf1;
    --hiw-blue: #003366;
    --hiw-blue-dark: #002244;
    --hiw-font-heading: 'Roboto Slab', Georgia, serif;
    --hiw-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.hiw-main {
    padding-bottom: 0;
}

/* ---------- Hero ---------- */
.hiw-hero {
    position: relative;
    padding: clamp(3rem, 8vw, 4.5rem) 2rem;
    background: linear-gradient(160deg, #001a33 0%, #002244 25%, #003366 55%, #0d3255 85%, #0a2845 100%);
    overflow: hidden;
}

.hiw-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--starry-pattern, none);
    background-size: var(--starry-size, 300px 300px);
    opacity: 0.45;
    pointer-events: none;
}

.hiw-hero-glow {
    position: absolute;
    width: 80%;
    max-width: 600px;
    height: 300px;
    left: 50%;
    bottom: -100px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(13, 148, 136, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hiw-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.hiw-hero-label {
    display: inline-block;
    font-family: var(--hiw-font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--hiw-accent-gold-light);
    margin-bottom: 1rem;
    padding: 0.45rem 1rem;
    background: rgba(201, 162, 39, 0.18);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 8px;
}

.hiw-hero-title {
    font-family: var(--hiw-font-heading);
    font-size: clamp(2.25rem, 5.5vw, 3.25rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.hiw-hero-tagline {
    font-family: var(--hiw-font-body);
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.hiw-hero-line {
    width: 100px;
    height: 4px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(90deg, transparent, var(--hiw-accent-gold), transparent);
    border-radius: 2px;
}

.hiw-hero-intro {
    font-family: var(--hiw-font-body);
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
    max-width: 560px;
    margin: 0 auto;
}

.hiw-hero-shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.1;
}

.hiw-hero-shape--1 {
    width: min(320px, 60vw);
    height: min(320px, 60vw);
    background: var(--hiw-accent-teal);
    top: -100px;
    right: -80px;
}

.hiw-hero-shape--2 {
    width: min(180px, 35vw);
    height: min(180px, 35vw);
    background: var(--hiw-accent-gold);
    bottom: -60px;
    left: 5%;
}

.hiw-hero-shape--3 {
    width: min(100px, 20vw);
    height: min(100px, 20vw);
    background: #2dd4bf;
    top: 45%;
    left: -30px;
}

/* ---------- Steps section ---------- */
.hiw-steps-section {
    padding: clamp(3rem, 6vw, 4rem) 2rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 20%, #fff 100%);
}

.hiw-steps-container {
    max-width: 1100px;
    margin: 0 auto;
}

.hiw-steps-heading {
    font-family: var(--hiw-font-heading);
    font-size: clamp(1.35rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--hiw-blue-dark);
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}

.hiw-steps-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    grid-template-rows: auto auto;
    gap: 0;
    align-items: stretch;
}

/* Cards — scroll-in animation */
.hiw-card {
    position: relative;
    min-height: 220px;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: var(--hiw-delay, 0ms);
}

.hiw-card.hiw-visible {
    opacity: 1;
    transform: translateY(0);
}

.hiw-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    color: #94a3b8;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transition-delay: var(--hiw-delay, 0ms);
}

.hiw-connector.hiw-visible {
    opacity: 1;
    transform: scale(1);
}

.hiw-card-inner {
    position: relative;
    height: 100%;
    padding: 1.75rem 1.5rem;
    background: #fff;
    border-radius: 18px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

.hiw-card:hover .hiw-card-inner {
    border-color: var(--hiw-blue);
    box-shadow: 0 20px 25px -5px rgba(0, 51, 102, 0.08), 0 8px 10px -6px rgba(0, 51, 102, 0.04);
    transform: translateY(-6px);
}

.hiw-card-number {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--hiw-font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    background: var(--hiw-blue);
    border-radius: 50%;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

.hiw-card--2 .hiw-card-number {
    background: var(--hiw-accent-teal);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.hiw-card--3 .hiw-card-number {
    background: var(--hiw-accent-gold);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.4);
}

.hiw-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    border-radius: 18px 0 0 18px;
}

.hiw-card-accent--blue { background: var(--hiw-blue); }
.hiw-card-accent--teal { background: var(--hiw-accent-teal); }
.hiw-card-accent--gold { background: var(--hiw-accent-gold); }

.hiw-card-icon {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    width: 40px;
    height: 40px;
}

.hiw-card-icon svg {
    width: 100%;
    height: 100%;
}

.hiw-card--1 .hiw-card-icon { color: rgba(0, 51, 102, 0.28); }
.hiw-card--2 .hiw-card-icon { color: rgba(13, 148, 136, 0.35); }
.hiw-card--3 .hiw-card-icon { color: rgba(201, 162, 39, 0.4); }

.hiw-card-title {
    font-family: var(--hiw-font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--hiw-blue-dark);
    margin-bottom: 0.6rem;
    padding-right: 56px;
    padding-left: 3.25rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.hiw-card-desc {
    font-family: var(--hiw-font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
    margin: 0 0 1rem;
    padding-left: 3.25rem;
}

.hiw-card-link {
    display: inline-block;
    font-family: var(--hiw-font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hiw-blue);
    text-decoration: none;
    margin-left: 3.25rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.hiw-card-link:hover {
    color: var(--hiw-accent-teal);
}

.hiw-card--1 .hiw-card-link:hover { color: var(--hiw-blue-dark); }
.hiw-card--2 .hiw-card-link:hover { color: #0f766e; }
.hiw-card--3 .hiw-card-link:hover { color: #a16207; }

.hiw-connector svg {
    width: 52px;
    height: 24px;
}

.hiw-connector--1-2 { grid-column: 2; grid-row: 1; }
.hiw-connector--2-3 { grid-column: 4; grid-row: 1; }

/* ---------- CTA ---------- */
.hiw-cta-section {
    position: relative;
    padding: clamp(2.5rem, 5vw, 3.5rem) 2rem;
    overflow: hidden;
}

.hiw-cta-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e0f2fe 0%, rgba(204, 251, 241, 0.6) 40%, #fef9c3 100%);
    opacity: 0.95;
}

.hiw-cta-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.hiw-cta-box {
    text-align: center;
    padding: clamp(2rem, 4vw, 2.75rem);
    background: #fff;
    border-radius: 24px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

.hiw-cta-heading {
    font-family: var(--hiw-font-body);
    font-size: clamp(1.15rem, 2vw, 1.3rem);
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hiw-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    justify-content: center;
    align-items: center;
}

.hiw-cta-btn {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    font-family: var(--hiw-font-body);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
}

.hiw-cta-btn--primary {
    background: var(--hiw-blue);
    color: #fff !important;
    border-color: var(--hiw-blue);
}

.hiw-cta-btn--primary:hover {
    background: var(--hiw-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 51, 102, 0.25);
}

.hiw-cta-btn--secondary {
    background: #fff;
    color: var(--hiw-blue) !important;
    border-color: var(--hiw-blue);
}

.hiw-cta-btn--secondary:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 51, 102, 0.12);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hiw-steps-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
    }
    .hiw-connector--1-2,
    .hiw-connector--2-3 {
        grid-column: 1;
        padding: 0.75rem 0;
    }
    .hiw-connector--1-2 { grid-row: 2; }
    .hiw-connector--2-3 { grid-row: 4; }
    .hiw-connector svg {
        transform: rotate(90deg);
        width: 24px;
        height: 52px;
    }
    .hiw-card--1 { grid-row: 1; }
    .hiw-card--2 { grid-row: 3; }
    .hiw-card--3 { grid-row: 5; }
}

@media (max-width: 600px) {
    .hiw-hero {
        padding: 2.5rem 1.25rem;
    }
    .hiw-hero-shape--1 { width: 200px; height: 200px; top: -60px; right: -50px; }
    .hiw-hero-shape--2 { width: 120px; height: 120px; }
    .hiw-hero-intro {
        font-size: 1rem;
    }
    .hiw-steps-section {
        padding: 2.5rem 1rem;
    }
    .hiw-steps-heading {
        margin-bottom: 1.75rem;
    }
    .hiw-card-inner {
        padding: 1.5rem 1.25rem;
    }
    .hiw-card-title,
    .hiw-card-desc,
    .hiw-card-link {
        padding-left: 0;
        margin-left: 0;
    }
    .hiw-card-title {
        padding-right: 52px;
    }
    .hiw-card-icon {
        position: static;
        margin-bottom: 0.5rem;
    }
    .hiw-cta-box {
        padding: 1.5rem 1.25rem;
    }
    .hiw-cta-buttons {
        flex-direction: column;
    }
    .hiw-cta-btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hiw-card,
    .hiw-connector {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hiw-card:hover .hiw-card-inner {
        transform: none;
    }
    .hiw-cta-btn:hover {
        transform: none;
    }
}
