/* ================================================================
   HOW-IT-WORKS — premium SaaS layout (Stripe / Clerk / ElevenLabs feel)
   Used by <HowItWorks /> on landing + use-cases pages.
   Self-contained, unscoped, works anywhere on the site.
================================================================ */

.hiw-root {
    background: #fff;
    padding: 96px 0;
    font-family: 'Cairo', sans-serif;
    color: #14132B;
}
.hiw-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ─────────────────────────────────────────── */
.hiw-head { text-align: center; margin-bottom: 56px; }

.hiw-eyebrow {
    display: inline-block;
    background: rgba(122,92,255,.10);
    color: #7a5cff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.hiw-title {
    font-size: clamp(28px, 3.6vw, 38px);
    font-weight: 800;
    color: #14132B;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
    line-height: 1.15;
}

.hiw-sub {
    font-size: 15.5px;
    color: #5B5F78;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── Flow grid (cards + arrows in alternating columns) ── */
.hiw-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: 0;
}

/* ── Card ──────────────────────────────────────────── */
.hiw-card {
    background: #fff;
    border: 1px solid #EBEDF5;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 1px 2px rgba(11,10,35,.03),
        0 12px 32px -16px rgba(11,10,35,.10);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.hiw-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 1px 2px rgba(11,10,35,.04),
        0 20px 40px -20px rgba(11,10,35,.18);
    border-color: rgba(122,92,255,.28);
}

/* Image area at the top of each card */
.hiw-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    /* Soft gradient — shows while image is loading or if file is missing */
    background:
        radial-gradient(circle at 30% 20%, rgba(122,92,255,.10) 0%, transparent 55%),
        linear-gradient(135deg, #f6f7ff, #eef0fb);
}
.hiw-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Step-number pill — sits on top of the image, top-left */
.hiw-num {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: rgba(20,19,43,.82);
    color: #fff;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    padding: 5px 11px;
    border-radius: 999px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(11,10,35,.18);
}

.hiw-body { padding: 20px 22px 24px; flex: 1; }

.hiw-step-title {
    font-size: 17px;
    font-weight: 700;
    color: #14132B;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}
.hiw-step-desc {
    font-size: 14px;
    color: #5B5F78;
    line-height: 1.6;
    margin: 0;
}

/* ── Arrow between cards (desktop only) ─────────────── */
.hiw-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(122,92,255,.55);
    padding: 0 12px;
}
.hiw-arrow svg { width: 22px; height: 22px; }

/* ── Bottom highlight bar ───────────────────────────── */
.hiw-bottom {
    margin-top: 56px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef0fb 100%);
    border: 1px solid #E6E8F3;
    border-radius: 18px;
    padding: 28px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
/* Subtle decorative glow on the bottom bar */
.hiw-bottom::before {
    content: "";
    position: absolute;
    inset: -40% 60% auto auto;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(122,92,255,.18) 0%, transparent 60%);
    pointer-events: none;
}

.hiw-bottom-left { position: relative; z-index: 1; }
.hiw-bottom-title {
    font-size: 17px;
    font-weight: 800;
    color: #14132B;
    letter-spacing: -.01em;
    margin: 0 0 4px;
    max-width: 520px;
    line-height: 1.4;
}
.hiw-bottom-sub {
    font-size: 13.5px;
    color: #5B5F78;
    margin: 0;
}

.hiw-bottom-right {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.hiw-tick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #14132B;
    white-space: nowrap;
}
.hiw-tick .hiw-check {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7a5cff, #387cfb);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(122,92,255,.35);
}
.hiw-tick .hiw-check svg { width: 11px; height: 11px; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1100px) {
    .hiw-flow {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    .hiw-arrow { display: none; }
}
@media (max-width: 640px) {
    .hiw-root { padding: 64px 0; }
    .hiw-head { margin-bottom: 40px; }
    .hiw-flow { grid-template-columns: 1fr; gap: 14px; }
    .hiw-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }
    .hiw-bottom-right { gap: 14px; }
}
