/**
 * How It Works — refreshed design (theme-aware, Dashboard 4–style depth)
 */

.hiw-page {
    --hiw-cyan: #32d8ff;
    --hiw-violet: #7c8cff;
    --hiw-rose: #f472b6;
}

.hiw-page .howitworks-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.75rem 0 0;
    box-sizing: border-box;
}

.hiw-page .container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

/* —— Hero —— */
.hiw-page .howitworks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 2.5rem);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(900px 480px at 0% 0%, rgba(236, 72, 153, 0.28), transparent 55%),
        radial-gradient(720px 380px at 100% 0%, rgba(124, 140, 255, 0.35), transparent 48%),
        radial-gradient(640px 400px at 50% 100%, rgba(50, 216, 255, 0.2), transparent 52%),
        linear-gradient(155deg, rgba(12, 14, 28, 0.97) 0%, rgba(18, 22, 42, 0.98) 45%, rgba(8, 10, 22, 0.99) 100%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    color: #eef2ff;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hiw-page .howitworks-header::before {
    content: '';
    position: absolute;
    inset: -40% -20%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 55%);
    pointer-events: none;
}

.hiw-page .howitworks-header-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.hiw-page .howitworks-header-icon {
    font-size: clamp(3rem, 8vw, 4.5rem);
    opacity: 0.35;
    background: linear-gradient(135deg, var(--hiw-cyan), var(--hiw-violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 24px rgba(50, 216, 255, 0.25));
}

.hiw-page .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding:0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.hiw-page .hero-badge i {
    color: var(--hiw-cyan);
}

.hiw-page .howitworks-hero-title {
    font-size: clamp(1.65rem, 2.5vw + 1rem, 2.35rem);
    font-weight: 900;
    margin: 0 0 0.5rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.hiw-page .howitworks-hero-subtitle {
    font-size: clamp(0.95rem, 0.5vw + 0.85rem, 1.05rem);
    line-height: 1.55;
    margin: 0;
    max-width: 44rem;
    color: rgba(226, 232, 255, 0.78);
    font-weight: 600;
}

.hiw-page .hero-stats-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1.35rem;
    max-width: 28rem;
}

.hiw-page .preview-stat {
    text-align: center;
    padding: 0.65rem 0.5rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.hiw-page .preview-stat-number {
    font-size: clamp(1.35rem, 2vw + 0.75rem, 1.85rem);
    font-weight: 950;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    background: linear-gradient(90deg, #fff 0%, var(--hiw-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hiw-page .preview-stat-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(220, 226, 255, 0.65);
}

body.light-mode .hiw-page .howitworks-header,
html[data-theme="light"] .hiw-page .howitworks-header {
    border-color: rgba(15, 23, 42, 0.1);
    background:
        radial-gradient(900px 480px at 0% 0%, rgba(236, 72, 153, 0.12), transparent 55%),
        radial-gradient(720px 380px at 100% 0%, rgba(124, 140, 255, 0.18), transparent 48%),
        linear-gradient(165deg, #ffffff 0%, #f4f6ff 50%, #f0fdfa 100%);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

body.light-mode .hiw-page .howitworks-hero-title,
html[data-theme="light"] .hiw-page .howitworks-hero-title {
    color: #0f172a;
}

body.light-mode .hiw-page .howitworks-hero-subtitle,
html[data-theme="light"] .hiw-page .howitworks-hero-subtitle {
    color: rgba(15, 23, 42, 0.65);
}

body.light-mode .hiw-page .hero-badge,
html[data-theme="light"] .hiw-page .hero-badge {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.04);
    color: rgba(15, 23, 42, 0.75);
}

body.light-mode .hiw-page .preview-stat,
html[data-theme="light"] .hiw-page .preview-stat {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light-mode .hiw-page .preview-stat-number,
html[data-theme="light"] .hiw-page .preview-stat-number {
    background: linear-gradient(90deg, #1e1b4b 0%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-mode .hiw-page .preview-stat-label,
html[data-theme="light"] .hiw-page .preview-stat-label {
    color: rgba(15, 23, 42, 0.55);
}

body.light-mode .hiw-page .howitworks-header-icon,
html[data-theme="light"] .hiw-page .howitworks-header-icon {
    opacity: 0.55;
}

/* —— Section chrome —— */
.hiw-page .process-overview {
    padding: 2.75rem 0 3.25rem;
    background: var(--current-bg);
    margin-top: 0;
}

.hiw-page .section-header-modern {
    text-align: center;
    margin-bottom: 2rem;
}

.hiw-page .section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(124, 140, 255, 0.28);
    background: rgba(124, 140, 255, 0.1);
    color: var(--current-text);
}

.hiw-page .section-badge i {
    color: var(--hiw-cyan);
}

.hiw-page .section-header-modern h2 {
    font-size: clamp(1.45rem, 1.5vw + 1rem, 2rem);
    font-weight: 900;
    margin: 0 0 0.65rem;
    color: var(--current-text);
    letter-spacing: -0.02em;
}

.hiw-page .section-subtitle {
    font-size: clamp(0.92rem, 0.4vw + 0.85rem, 1.05rem);
    color: var(--current-text-secondary);
    max-width: 40rem;
    margin: 0 auto;
    line-height: 1.55;
    font-weight: 600;
}

/* —— 4-step process —— */
.hiw-page .process-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.5rem auto 0;
    max-width: 1440px;
    align-items: stretch;
}

.hiw-page .step-connector {
    display: none;
}

.hiw-page .step-card {
    background: var(--current-card-bg);
    border: 1px solid var(--current-border);
    border-radius: 18px;
    padding: 1.35rem 1rem 1.1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
    min-width: 0;
    max-width: none;
    flex: initial;
    transform: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hiw-page .step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 48px rgba(124, 140, 255, 0.15);
    border-color: rgba(124, 140, 255, 0.35);
}

.hiw-page .step-card.featured {
    background:
        radial-gradient(120% 80% at 10% 0%, rgba(124, 140, 255, 0.35), transparent 55%),
        linear-gradient(165deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 27, 75, 0.92) 100%);
    border-color: rgba(50, 216, 255, 0.35);
    color: #e8ecff;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.25);
}

body.light-mode .hiw-page .step-card.featured,
html[data-theme="light"] .hiw-page .step-card.featured {
    background:
        radial-gradient(120% 80% at 10% 0%, rgba(124, 140, 255, 0.22), transparent 55%),
        linear-gradient(165deg, #ffffff 0%, #f1f4ff 100%);
    color: #0f172a;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
}

.hiw-page .step-card.featured:hover {
    transform: translateY(-4px);
}

.hiw-page .step-number {
    top: -12px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--hiw-rose), #fb7185);
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.35);
}

.hiw-page .step-card.featured .step-number {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b4b;
}

.hiw-page .step-icon {
    font-size: 2rem;
    margin-bottom: 0.85rem;
    color: var(--hiw-violet);
}

.hiw-page .step-card.featured .step-icon {
    color: var(--hiw-cyan);
}

body.light-mode .hiw-page .step-card.featured .step-icon,
html[data-theme="light"] .hiw-page .step-card.featured .step-icon {
    color: #4f46e5;
}

.hiw-page .step-card h3 {
    font-size: 1.05rem;
    font-weight: 900;
    margin: 0 0 0.5rem;
    color: var(--current-text);
}

.hiw-page .step-card.featured h3 {
    color: #f8fafc;
}

body.light-mode .hiw-page .step-card.featured h3,
html[data-theme="light"] .hiw-page .step-card.featured h3 {
    color: #0f172a;
}

.hiw-page .step-card p {
    font-size: 0.84rem;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    color: var(--current-text-secondary);
}

.hiw-page .step-card.featured p {
    color: rgba(226, 232, 255, 0.82);
}

body.light-mode .hiw-page .step-card.featured p,
html[data-theme="light"] .hiw-page .step-card.featured p {
    color: rgba(15, 23, 42, 0.68);
}

.hiw-page .step-features {
    gap: 0.35rem;
}

.hiw-page .feature-tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
}

/* —— Who benefits —— */
.hiw-page .who-benefits {
    background: var(--current-bg-secondary, var(--current-bg));
    padding: 3rem 0 3.5rem;
    border-top: 1px solid var(--current-border);
    border-bottom: 1px solid var(--current-border);
}

.hiw-page .benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
    max-width: 1440px;
}

.hiw-page .benefit-card {
    background: var(--current-card-bg);
    border: 1px solid var(--current-border);
    border-radius: 18px;
    padding: 1.35rem 1.15rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.04);
}

.hiw-page .benefit-card:hover {
    background: var(--current-card-bg);
    transform: translateY(-3px);
    box-shadow: 0 16px 44px rgba(124, 140, 255, 0.12);
}

.hiw-page .benefit-icon {
    font-size: 2rem;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, var(--hiw-violet), var(--hiw-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hiw-page .benefit-card h3 {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--current-text);
    margin: 0 0 0.5rem;
}

.hiw-page .benefit-card p {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--current-text-secondary);
    margin: 0 0 0.75rem;
}

.hiw-page .benefit-list li {
    font-size: 0.8rem;
    color: var(--current-text-secondary);
    padding: 0.35rem 0 0.35rem 1.35rem;
}

.hiw-page .benefit-list li::before {
    color: var(--hiw-violet);
}

/* —— Technology —— */
.hiw-page .technology-highlight {
    background: var(--current-bg);
    color: var(--current-text);
    padding: 3rem 0 3.5rem;
    position: relative;
}

.hiw-page .technology-highlight::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(700px 360px at 15% 20%, rgba(236, 72, 153, 0.08), transparent 55%),
        radial-gradient(600px 320px at 85% 70%, rgba(124, 140, 255, 0.12), transparent 50%);
    pointer-events: none;
}

.hiw-page .technology-highlight .container {
    position: relative;
    z-index: 1;
}

.hiw-page .technology-highlight .section-header-modern,
.hiw-page .hiw-tech-head {
    margin-bottom: 2rem !important;
}

.hiw-page .tech-content {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    max-width: 1440px;
}

.hiw-page .tech-features {
    gap: 1rem;
}

.hiw-page .tech-feature {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--current-border);
    background: var(--current-card-bg);
    align-items: center;
    gap: 0.85rem;
}

.hiw-page .tech-feature i {
    font-size: 1.35rem;
    color: var(--hiw-violet);
    margin-top: 0;
}

.hiw-page .tech-feature h4 {
    font-size: 0.95rem;
    font-weight: 900;
    margin: 0 0 0.2rem;
    color: var(--current-text);
}

.hiw-page .tech-feature p {
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0;
    color: var(--current-text-secondary);
    opacity: 1;
}

.hiw-page .ai-brain-animation {
    font-size: clamp(4rem, 12vw, 6.5rem);
    color: rgba(124, 140, 255, 0.2);
    background: linear-gradient(145deg, rgba(124, 140, 255, 0.15), rgba(50, 216, 255, 0.1));
    border-radius: 28px;
    padding: 1.5rem 2rem;
    border: 1px solid var(--current-border);
}

.hiw-page .neural-connections {
    background: radial-gradient(circle, rgba(50, 216, 255, 0.15) 0%, transparent 70%);
}

/* —— CTA —— */
.hiw-page .howitworks-container:last-of-type {
    padding-bottom: 0.5rem;
}

.hiw-page .howitworks-cta-modern {
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(236, 72, 153, 0.25), transparent 52%),
        radial-gradient(700px 300px at 100% 100%, rgba(124, 140, 255, 0.3), transparent 48%),
        linear-gradient(155deg, #1a1033 0%, #12182a 50%, #0d1528 100%);
    padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.75rem);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
    color: #eef2ff;
    margin: 2.5rem 0 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hiw-page .howitworks-cta-content {
    position: relative;
    z-index: 1;
    max-width: 40rem;
    margin: 0 auto;
    padding: 0.35rem 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
}

body.light-mode .hiw-page .howitworks-cta-modern,
html[data-theme="light"] .hiw-page .howitworks-cta-modern {
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(236, 72, 153, 0.12), transparent 52%),
        radial-gradient(700px 300px at 100% 0%, rgba(124, 140, 255, 0.18), transparent 48%),
        linear-gradient(165deg, #ffffff 0%, #f3f4ff 100%);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.hiw-page .howitworks-cta-modern::before {
    display: none;
}

.hiw-page .cta-badge {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    margin: 0;
    flex-shrink: 0;
}

body.light-mode .hiw-page .cta-badge,
html[data-theme="light"] .hiw-page .cta-badge {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.04);
    color: rgba(15, 23, 42, 0.8);
}

.hiw-page .howitworks-cta-title {
    font-size: clamp(1.45rem, 2vw + 0.9rem, 2rem);
    font-weight: 900;
    color: inherit;
    margin: 0;
    line-height: 1.22;
    max-width: 100%;
}

.hiw-page .howitworks-cta-subtitle {
    font-size: clamp(0.92rem, 0.5vw + 0.85rem, 1.08rem);
    color: rgba(226, 232, 255, 0.78);
    font-weight: 600;
    margin: 0;
    line-height: 1.55;
    max-width: 36rem;
}

body.light-mode .hiw-page .howitworks-cta-subtitle,
html[data-theme="light"] .hiw-page .howitworks-cta-subtitle {
    color: rgba(15, 23, 42, 0.65);
}

.hiw-page .howitworks-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.875rem 1rem;
    width: 100%;
    max-width: 36rem;
    margin-top: 0.35rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

body.light-mode .hiw-page .howitworks-cta-buttons,
html[data-theme="light"] .hiw-page .howitworks-cta-buttons {
    border-top-color: rgba(15, 23, 42, 0.08);
}

.hiw-page .howitworks-btn-primary {
    background: linear-gradient(135deg, #f97370, #f59e0b 55%, #ec4899);
    font-size: 0.95rem;
    padding: 0.95rem 1.5rem;
    min-height: 2.875rem;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(236, 72, 153, 0.35);
    box-sizing: border-box;
}

.hiw-page .howitworks-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(236, 72, 153, 0.45);
}

.hiw-page .howitworks-btn-secondary {
    font-size: 0.95rem;
    padding: 0.95rem 1.5rem;
    min-height: 2.875rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f8fafc !important;
    box-sizing: border-box;
}

body.light-mode .hiw-page .howitworks-btn-secondary,
html[data-theme="light"] .hiw-page .howitworks-btn-secondary {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #0f172a !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

/* —— Responsive —— */
@media (max-width: 1024px) {
    .hiw-page .process-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hiw-page .benefits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hiw-page .tech-content {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .hiw-page .tech-visual {
        order: -1;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 720px) {
    .hiw-page .howitworks-container,
    .hiw-page .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hiw-page .howitworks-header {
        flex-direction: column;
        text-align: center;
    }

    .hiw-page .howitworks-header-icon {
        margin-top: 0.25rem;
    }

    .hiw-page .howitworks-hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hiw-page .hero-stats-preview {
        margin-left: auto;
        margin-right: auto;
    }

    .hiw-page .process-steps {
        grid-template-columns: 1fr;
    }

    .hiw-page .benefits-grid {
        grid-template-columns: 1fr;
    }

    .hiw-page .howitworks-cta-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        gap: 1rem;
    }

    .hiw-page .howitworks-cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: none;
        padding-top: 1.1rem;
        gap: 0.75rem;
    }

    .hiw-page .howitworks-btn-primary,
    .hiw-page .howitworks-btn-secondary {
        width: 100%;
        max-width: 22rem;
        justify-content: center;
    }
}
