/* how-it-works.php — радикальный лендинг «Как это работает» */

.hiw-page {
    --hiw-primary: #720AA4;
    --hiw-primary-soft: #9333ea;
    --hiw-dark: #050A24;
    --hiw-dark-mid: #12082a;
    --hiw-gold: #f0b429;
    --hiw-gold-soft: #ffe08a;
    --hiw-surface: #f7f5fb;
    --hiw-muted: #5c647d;
    --hiw-radius: 20px;
    --hiw-radius-sm: 14px;
    color: var(--hiw-dark);
    overflow-x: clip;
}

/* ── Hero ── */
.hiw-hero {
    position: relative;
    min-height: clamp(520px, 78vh, 720px);
    display: flex;
    align-items: center;
    padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7rem);
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(147, 51, 234, 0.45), transparent 55%),
        radial-gradient(ellipse 55% 45% at 88% 75%, rgba(240, 180, 41, 0.18), transparent 50%),
        linear-gradient(155deg, #050A24 0%, #1a0a38 42%, #2d0a4e 72%, #050A24 100%);
    color: #fff;
}

.hiw-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 80% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

.hiw-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: hiw-orb-float 14s ease-in-out infinite;
}

.hiw-hero__orb--1 {
    width: 320px;
    height: 320px;
    top: 8%;
    right: 12%;
    background: rgba(114, 10, 164, 0.35);
}

.hiw-hero__orb--2 {
    width: 200px;
    height: 200px;
    bottom: 18%;
    left: 6%;
    background: rgba(240, 180, 41, 0.15);
    animation-delay: -5s;
}

@keyframes hiw-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(12px, -18px) scale(1.06); }
}

.hiw-hero__inner {
    position: relative;
    z-index: 2;
}

.hiw-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem 0.45rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 1.25rem;
    backdrop-filter: blur(8px);
}

.hiw-hero__badge i {
    color: var(--hiw-gold);
}

.hiw-hero__title {
    font-size: clamp(2.2rem, 5.5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

.hiw-hero__title span {
    background: linear-gradient(120deg, #fff 0%, var(--hiw-gold-soft) 55%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hiw-hero__lead {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    max-width: 36rem;
    margin-bottom: 2rem;
}

.hiw-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.hiw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hiw-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.hiw-btn--primary {
    background: linear-gradient(135deg, #fff 0%, #f3e8ff 100%);
    color: var(--hiw-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.hiw-btn--primary:hover {
    color: var(--hiw-primary);
    box-shadow: 0 12px 40px rgba(114, 10, 164, 0.35);
}

.hiw-btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
}

.hiw-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.hiw-btn--accent {
    background: linear-gradient(135deg, var(--hiw-primary) 0%, var(--hiw-primary-soft) 100%);
    color: #fff;
    box-shadow: 0 8px 28px rgba(114, 10, 164, 0.35);
}

.hiw-btn--accent:hover {
    color: #fff;
    box-shadow: 0 12px 36px rgba(114, 10, 164, 0.45);
}

.hiw-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 32rem;
}

.hiw-stat {
    padding: 1rem 1.1rem;
    border-radius: var(--hiw-radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.hiw-stat__num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hiw-gold);
    line-height: 1.2;
}

.hiw-stat__label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 0.15rem;
}

.hiw-hero__visual {
    position: relative;
    min-height: 340px;
}

.hiw-flow-card {
    position: absolute;
    padding: 1rem 1.15rem;
    border-radius: var(--hiw-radius-sm);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: hiw-card-drift 8s ease-in-out infinite;
}

.hiw-flow-card--1 { top: 8%; left: 5%; animation-delay: 0s; }
.hiw-flow-card--2 { top: 38%; right: 0; animation-delay: -2.5s; }
.hiw-flow-card--3 { bottom: 8%; left: 18%; animation-delay: -5s; }

@keyframes hiw-card-drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hiw-flow-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hiw-primary), var(--hiw-primary-soft));
    color: #fff;
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.hiw-flow-card__title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.hiw-flow-card__text {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

.hiw-flow-card__line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(240, 180, 41, 0.5), transparent);
    transform: rotate(-25deg);
    pointer-events: none;
}

/* ── Role switcher + timeline ── */
.hiw-journey {
    padding: clamp(3.5rem, 8vw, 5.5rem) 0;
    background: var(--hiw-surface);
}

.hiw-section-head {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto 2.5rem;
}

.hiw-section-head__eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hiw-primary);
    margin-bottom: 0.65rem;
}

.hiw-section-head__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.hiw-section-head__sub {
    color: var(--hiw-muted);
    font-size: 1.05rem;
    margin: 0;
}

.hiw-role-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    padding: 0.35rem;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 24px rgba(5, 10, 36, 0.08);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.hiw-role-tab {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--hiw-muted);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.hiw-role-tab.is-active {
    background: linear-gradient(135deg, var(--hiw-primary), var(--hiw-primary-soft));
    color: #fff;
    box-shadow: 0 6px 20px rgba(114, 10, 164, 0.3);
}

.hiw-role-tab[data-role="owner"].is-active {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}

.hiw-role-panel {
    display: none;
    animation: hiw-fade-up 0.45s ease;
}

.hiw-role-panel.is-active {
    display: block;
}

@keyframes hiw-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.hiw-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 0;
}

.hiw-timeline::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 24px;
    bottom: 24px;
    width: 3px;
    background: linear-gradient(180deg, var(--hiw-primary), var(--hiw-gold), var(--hiw-primary-soft));
    border-radius: 3px;
    opacity: 0.35;
}

.hiw-timeline--owner::before {
    background: linear-gradient(180deg, #0d9488, var(--hiw-gold), #14b8a6);
}

.hiw-step {
    position: relative;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem 1.25rem 0;
    margin-bottom: 0.5rem;
}

.hiw-step:last-child {
    margin-bottom: 0;
}

.hiw-step__marker {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(145deg, var(--hiw-primary), var(--hiw-primary-soft));
    box-shadow: 0 8px 24px rgba(114, 10, 164, 0.25);
    flex-shrink: 0;
}

.hiw-timeline--owner .hiw-step__marker {
    background: linear-gradient(145deg, #0d9488, #14b8a6);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.25);
}

.hiw-step__body {
    background: #fff;
    border-radius: var(--hiw-radius);
    padding: 1.35rem 1.5rem;
    border: 1px solid rgba(114, 10, 164, 0.08);
    box-shadow: 0 8px 32px rgba(5, 10, 36, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hiw-step__body:hover {
    transform: translateX(6px);
    box-shadow: 0 14px 40px rgba(114, 10, 164, 0.1);
}

.hiw-step__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(114, 10, 164, 0.1);
    color: var(--hiw-primary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.hiw-timeline--owner .hiw-step__icon {
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
}

.hiw-step__title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.hiw-step__text {
    color: var(--hiw-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ── Bento features ── */
.hiw-features {
    padding: clamp(3.5rem, 8vw, 5.5rem) 0;
    background: #fff;
}

.hiw-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.hiw-bento__item {
    grid-column: span 4;
    padding: 1.5rem 1.6rem;
    border-radius: var(--hiw-radius);
    background: var(--hiw-surface);
    border: 1px solid rgba(114, 10, 164, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hiw-bento__item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 100% 0%, rgba(114, 10, 164, 0.08), transparent 70%);
    pointer-events: none;
}

.hiw-bento__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(5, 10, 36, 0.08);
    border-color: rgba(114, 10, 164, 0.15);
}

.hiw-bento__item--wide {
    grid-column: span 6;
}

.hiw-bento__item--tall {
    grid-column: span 4;
    grid-row: span 1;
}

.hiw-bento__item--hero {
    grid-column: span 6;
    background: linear-gradient(135deg, var(--hiw-dark) 0%, #2d0a4e 100%);
    color: #fff;
    border: none;
}

.hiw-bento__item--hero::after {
    background: radial-gradient(circle at 100% 0%, rgba(240, 180, 41, 0.2), transparent 70%);
}

.hiw-bento__item--hero .hiw-bento__text {
    color: rgba(255, 255, 255, 0.75);
}

.hiw-bento__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--hiw-primary), var(--hiw-primary-soft));
    color: #fff;
}

.hiw-bento__item--hero .hiw-bento__icon {
    background: rgba(255, 255, 255, 0.12);
}

.hiw-bento__title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.hiw-bento__text {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--hiw-muted);
    margin: 0;
}

/* ── FAQ ── */
.hiw-faq {
    padding: clamp(3.5rem, 8vw, 5rem) 0;
    background: linear-gradient(180deg, var(--hiw-surface) 0%, #fff 100%);
}

.hiw-faq__list {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.hiw-faq__item {
    border-radius: var(--hiw-radius-sm);
    background: #fff;
    border: 1px solid rgba(114, 10, 164, 0.08);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(5, 10, 36, 0.04);
    transition: box-shadow 0.25s ease;
}

.hiw-faq__item.is-open {
    box-shadow: 0 12px 40px rgba(114, 10, 164, 0.1);
    border-color: rgba(114, 10, 164, 0.18);
}

.hiw-faq__q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    border: none;
    background: transparent;
    text-align: left;
    font-weight: 700;
    font-size: 1rem;
    color: var(--hiw-dark);
    cursor: pointer;
}

.hiw-faq__q i {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(114, 10, 164, 0.1);
    color: var(--hiw-primary);
    transition: transform 0.3s ease, background 0.3s ease;
}

.hiw-faq__item.is-open .hiw-faq__q i {
    transform: rotate(180deg);
    background: var(--hiw-primary);
    color: #fff;
}

.hiw-faq__a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.hiw-faq__item.is-open .hiw-faq__a {
    max-height: 480px;
}

.hiw-faq__a-inner {
    padding: 0 1.35rem 1.25rem;
    color: var(--hiw-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.hiw-faq__a-inner ul,
.hiw-faq__a-inner ol {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.hiw-faq__a-inner li {
    margin-bottom: 0.35rem;
}

/* ── CTA ── */
.hiw-cta {
    padding: clamp(3rem, 7vw, 4.5rem) 0 clamp(4rem, 9vw, 6rem);
}

.hiw-cta__box {
    position: relative;
    border-radius: 28px;
    padding: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 80% at 20% 50%, rgba(240, 180, 41, 0.15), transparent),
        linear-gradient(135deg, var(--hiw-dark) 0%, #2d0a4e 50%, var(--hiw-primary) 100%);
    color: #fff;
}

.hiw-cta__box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.hiw-cta__inner {
    position: relative;
    z-index: 1;
}

.hiw-cta__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.hiw-cta__sub {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
    max-width: 32rem;
    margin: 0 auto 2rem;
}

.hiw-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* ── Reveal on scroll ── */
.hiw-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .hiw-hero__visual {
        display: none;
    }

    .hiw-bento__item,
    .hiw-bento__item--wide,
    .hiw-bento__item--hero {
        grid-column: span 12;
    }

    .hiw-hero__stats {
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .hiw-timeline::before {
        left: 22px;
    }

    .hiw-step {
        grid-template-columns: 44px 1fr;
        gap: 0.85rem;
    }

    .hiw-step__marker {
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    .hiw-step__body {
        padding: 1.1rem 1.15rem;
    }

    .hiw-role-tabs {
        flex-direction: column;
        border-radius: var(--hiw-radius-sm);
        max-width: 100%;
    }

    .hiw-role-tab {
        border-radius: var(--hiw-radius-sm);
    }

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

@media (prefers-reduced-motion: reduce) {
    .hiw-hero__orb,
    .hiw-flow-card,
    .hiw-reveal {
        animation: none;
        transition: none;
    }
}
