/**
 * How V2 — صفحه «همتالونز چطور کار می‌کند»
 */

body.hpb-how-v2 {
    background: #fff;
    color: #1e293b;
}

body.hpb-how-v2 main.crafto-how,
body.hpb-how-v2 #primary .crafto-how {
    box-sizing: border-box;
    width: 100% !important;
    max-width: var(--hpb-site-container-max, 1400px) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    padding-block: var(--h-gap, 20px);
}

.crafto-how {
    --h-navy: var(--hpb-theme-brand-deep, #0d48a2);
    --h-navy-deep: var(--hpb-theme-brand-deep, #0a3578);
    --h-cyan: var(--hpb-theme-cyan, #5ec8f0);
    --h-muted: var(--hpb-theme-text-muted, #64748b);
    --h-line: var(--hpb-theme-border, #e2e8f0);
    --h-radius: 16px;
    --h-gap: 20px;
    display: flex;
    flex-direction: column;
    gap: var(--h-gap);
}

.crafto-how .crafto-container {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding: 0;
}

/* Preview banner */
.how-preview-banner {
    border-radius: 12px;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

/* Hero */
.how-hero {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--h-radius) + 4px);
    background: linear-gradient(135deg, var(--h-navy-deep) 0%, var(--h-navy) 52%, #1a6fd4 100%);
    color: #fff;
    padding: clamp(2.2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 2.5rem);
    min-height: 260px;
    display: flex;
    align-items: center;
}

.how-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    pointer-events: none;
    width: 240px;
    height: 240px;
    background: var(--h-cyan);
    top: -60px;
    left: -30px;
}

.how-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.how-hero__eyebrow {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.how-hero__title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 900;
    line-height: 1.25;
}

.how-hero__lead {
    margin: 0;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.9);
    max-width: 58ch;
}

/* Section head */
.how-section-head {
    margin-bottom: 18px;
}

.how-section-head h2 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 800;
    color: #0f172a;
}

.how-section-head p {
    margin: 0;
    color: var(--h-muted);
    line-height: 1.75;
}

/* Pillars */
.how-pillars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.how-pillar {
    background: #fff;
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
    padding: 18px 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.how-pillar h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--h-navy);
}

.how-pillar p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--h-muted);
}

/* Bridge */
.how-bridge {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.how-bridge__col {
    border-radius: var(--h-radius);
    padding: 20px;
    border: 1px solid var(--h-line);
    background: #f8fafc;
}

.how-bridge__col--consumer {
    border-color: rgba(13, 72, 162, 0.2);
    background: linear-gradient(180deg, #f0f7ff, #fff);
}

.how-bridge__col--branch {
    border-color: rgba(14, 116, 144, 0.2);
    background: linear-gradient(180deg, #ecfeff, #fff);
}

.how-bridge__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--h-navy);
    margin-bottom: 8px;
}

.how-bridge__col strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.how-bridge__col p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--h-muted);
    line-height: 1.65;
}

.how-bridge__hub {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--h-navy), var(--h-cyan));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.4;
    box-shadow: 0 8px 28px rgba(13, 72, 162, 0.25);
}

.how-bridge__notes {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.how-bridge__notes li {
    font-size: 0.82rem;
    color: #475569;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.55;
}

/* Tabs */
.how-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.how-tab {
    appearance: none;
    border: 1px solid var(--h-line);
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 10px 20px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.how-tab.is-active {
    background: var(--h-navy);
    border-color: var(--h-navy);
    color: #fff;
    box-shadow: 0 6px 20px rgba(13, 72, 162, 0.22);
}

.how-panel[hidden] {
    display: none !important;
}

/* Flow steps */
.how-flow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.how-flow__item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 14px;
    align-items: start;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: var(--how-stagger, 0ms);
}

.how-reveal.is-visible .how-flow__item {
    opacity: 1;
    transform: none;
}

.how-flow__marker {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--h-navy-deep), var(--h-navy));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 900;
    box-shadow: 0 6px 18px rgba(13, 72, 162, 0.2);
}

.how-flow--branch .how-flow__marker {
    background: linear-gradient(135deg, #0e7490, #06b6d4);
    box-shadow: 0 6px 18px rgba(14, 116, 144, 0.2);
}

.how-flow__card {
    background: #fff;
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
    padding: 16px 18px;
}

.how-flow__title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.how-flow__text {
    margin: 0 0 8px;
    color: #334155;
    line-height: 1.7;
}

.how-flow__detail {
    margin: 0;
    font-size: 0.86rem;
    color: var(--h-muted);
    line-height: 1.65;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

/* CTA */
.how-cta {
    border-radius: calc(var(--h-radius) + 4px);
    background: linear-gradient(135deg, #0a3578, #0d48a2);
    color: #fff;
    padding: clamp(1.5rem, 3vw, 2.2rem);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.how-cta__title {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 800;
}

.how-cta__text {
    margin: 0;
    opacity: 0.9;
    line-height: 1.7;
}

.how-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.how-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.how-btn--primary {
    background: #fff;
    color: var(--h-navy-deep);
}

.how-btn--ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.how-btn:hover {
    transform: translateY(-2px);
}

/* Reveal */
.how-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.how-teaser.how-reveal {
    opacity: 1;
    transform: none;
}

.how-reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 991px) {
    .how-pillars {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .how-bridge {
        grid-template-columns: 1fr;
    }

    .how-bridge__hub {
        margin-inline: auto;
    }

    .how-bridge__notes {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .how-pillars,
    .how-bridge__notes {
        grid-template-columns: 1fr;
    }

    .how-flow__item {
        grid-template-columns: 48px 1fr;
    }

    .how-flow__marker {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        font-size: 1rem;
    }
}

/* Teaser — صفحه اصلی و درباره ما */
.how-teaser__shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 2rem);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border-radius: calc(var(--h-radius, 16px) + 4px);
    border: 1px solid var(--h-line, #e2e8f0);
    background: linear-gradient(135deg, #f8fafc 0%, #fff 55%, #eff6ff 100%);
}

.how-teaser__eyebrow {
    display: inline-block;
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--h-navy, #0d48a2);
    letter-spacing: 0.02em;
}

.how-teaser__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
}

.how-teaser__lead {
    margin: 0 0 1.25rem;
    color: var(--h-muted, #64748b);
    line-height: 1.85;
    font-size: 0.95rem;
}

.how-teaser-pillars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.how-teaser-pillar {
    padding: 1rem 1.05rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--h-line, #e2e8f0);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.how-teaser-pillar h3 {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--h-navy, #0d48a2);
}

.how-teaser-pillar p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--h-muted, #64748b);
}

.how-teaser--home .how-teaser__shell {
    background: linear-gradient(135deg, #eff6ff 0%, #fff 50%, #f8fafc 100%);
}

@media (max-width: 991px) {
    .how-teaser__shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .how-teaser-pillars {
        grid-template-columns: 1fr;
    }
}
