/* =========================================================
   Homepage: "Why us" bento (.ab) + "How it works" (.hw)
   ========================================================= */

/* ---------- Shared head ---------- */
.ab__head,
.hw__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 760px;
    margin-bottom: 40px;
}

.ab__eyebrow,
.hw__eyebrow {
    display: inline-flex;
    padding: 8px 18px;
    margin-bottom: 18px;
    border-radius: 20px;
    color: var(--black);
}

.ab__eyebrow { background: var(--purple-20); }
.hw__eyebrow { background: var(--blue-20); }

/* =========================================================
   ABOUT / WHY US
   ========================================================= */
.ab__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.ab-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid #E6E8EF;
    border-radius: 28px;
    background: var(--white);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.35s;
}

@media (hover: hover) {
    .ab-card:hover {
        transform: translateY(-4px);
        border-color: rgba(204, 102, 255, 0.3);
        box-shadow: 0 24px 48px -28px rgba(90, 40, 140, 0.35);
    }

    .ab-card:hover .ab-card__ico {
        transform: rotate(-6deg) scale(1.06);
    }
}

.ab-card__ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ab-card__ico--blue   { background: var(--blue-20);   color: #4545E0; }
.ab-card__ico--green  { background: var(--green-20);  color: #00A862; }
.ab-card__ico--purple { background: var(--purple-20); color: #A23FD6; }

.ab-card__title {
    margin: 0 0 10px;
    color: var(--black);
}

.ab-card__text {
    margin: 0;
    color: #4a4a5e;
}

/* Hero card */
.ab-card--hero {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: space-between;
    gap: 28px;
    background:
        radial-gradient(110% 90% at 100% 100%, rgba(204, 102, 255, 0.14), transparent 60%),
        radial-gradient(80% 70% at 0% 0%, rgba(102, 102, 255, 0.08), transparent 60%),
        var(--white);
}

.ab-card__top {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

/* Mini order form mockup */
.ab-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px solid #ECEAF5;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 20px 40px -30px rgba(60, 30, 120, 0.4);
    backdrop-filter: blur(6px);
}

.ab-form__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px 4px;
    color: #8a8aa0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 12px;
}

.ab-form__row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 10px 10px 12px;
    border-radius: 16px;
    background: #F6F6FB;
}

.ab-form__n {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    color: #6666FF;
    box-shadow: 0 0 0 1px #E3E3F5;
}

.ab-form__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.ab-form__label {
    color: var(--black);
}

.ab-form__hint {
    font-size: 13px;
    line-height: 1.3;
    color: #8a8aa0;
}

.ab-form__stepper {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 0 0 1px #E6E8EF;
}

.ab-form__stepper i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-style: normal;
    color: #4545E0;
    background: var(--blue-20);
}

.ab-form__stepper b {
    min-width: 36px;
    text-align: center;
    color: var(--black);
}

.ab-form__input {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 0 0 1px #E6E8EF;
    font-size: 13px;
    line-height: 1.2;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ab-form__input svg {
    flex: 0 0 auto;
    color: #9a9aae;
}

.ab-form__value {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--green-20);
    color: #00864F;
    white-space: nowrap;
}

.ab-form__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    padding: 14px 4px 0;
    border-top: 1px dashed #E3E3F0;
}

.ab-form__total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
    row-gap: 2px;
}

.ab-form__total-l,
.ab-form__total-s {
    color: #8a8aa0;
}

.ab-form__total-v {
    color: var(--black);
}

.ab-form__time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: none;
    letter-spacing: 0;
}

.ab-form__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 14px;
    background: var(--blue);
    color: var(--white);
    text-decoration: none;
    pointer-events: none;
    box-shadow: 0 10px 22px -10px rgba(102, 102, 255, 0.8);
}

/* Wide cards with badge */
.ab-card--wide {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.ab-card--wide .ab-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

.ab-card__badge {
    flex: 0 0 auto;
    padding: 12px 18px;
    border-radius: 18px;
    white-space: nowrap;
}

.ab-card__badge--green  { background: var(--green-20);  color: #00864F; }
.ab-card__badge--purple { background: var(--purple-20); color: #8A2FBF; }

/* =========================================================
   HOW IT WORKS
   ========================================================= */
.hw__panel {
    position: relative;
    padding: 40px;
    border: 1px solid #E6E8EF;
    border-radius: 32px;
    background:
        radial-gradient(70% 90% at 0% 0%, rgba(102, 102, 255, 0.07), transparent 60%),
        radial-gradient(60% 80% at 100% 100%, rgba(0, 211, 122, 0.08), transparent 60%),
        var(--white);
}

.hw__list {
    --hw-ico: 56px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--hw-cols, 5), minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Track line */
.hw__list::before,
.hw__list::after {
    content: "";
    position: absolute;
    top: calc(var(--hw-ico) / 2 - 2px);
    left: calc(50% / var(--hw-cols, 5) - 8px);
    right: calc(50% / var(--hw-cols, 5) - 8px);
    height: 4px;
    border-radius: 999px;
}

.hw__list::before {
    background: linear-gradient(90deg, var(--blue), #9A6BFF 55%, var(--green));
    opacity: 0.18;
}

.hw__list::after {
    background: linear-gradient(90deg, var(--blue), #9A6BFF 55%, var(--green));
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 2.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.hw__panel.animate .hw__list::after {
    transform: scaleX(1);
}

.hw-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.hw-step__marker {
    position: relative;
    z-index: 1;
    padding: 6px;
    margin: -6px;
    border-radius: 50%;
    background: var(--white);
}

.hw-step__ico {
    display: grid;
    place-items: center;
    width: var(--hw-ico);
    height: var(--hw-ico);
    border-radius: 50%;
    color: var(--white);
    /* Colored from the start; on scroll only a soft "pop" plays. */
    transform: scale(0.85);
    opacity: 0.55;
    transition: opacity 0.5s ease, box-shadow 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(var(--i) * 0.45s);
}

.hw-step--you .hw-step__ico {
    background: linear-gradient(135deg, var(--blue), #8A7BFF);
}

.hw-step--we .hw-step__ico {
    background: linear-gradient(135deg, #00C070, #3BE3A0);
}

.hw__panel.animate .hw-step__ico {
    opacity: 1;
    transform: scale(1.04);
}

.hw__panel.animate .hw-step--you .hw-step__ico {
    box-shadow: 0 10px 24px -10px rgba(102, 102, 255, 0.9);
}

.hw__panel.animate .hw-step--we .hw-step__ico {
    box-shadow: 0 10px 24px -10px rgba(0, 211, 122, 0.9);
}

.hw-step__card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid #ECEDF3;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.35s;
}

@media (hover: hover) {
    .hw-step:hover .hw-step__card {
        transform: translateY(-4px);
        border-color: rgba(102, 102, 255, 0.28);
        box-shadow: 0 22px 40px -28px rgba(40, 40, 140, 0.4);
    }
}

.hw-step__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.hw-step__num {
    color: #a0a0b4;
    letter-spacing: 0.04em;
}

.hw-step__who {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.hw-step--you .hw-step__who { background: var(--blue-20);  color: #6666FF; }
.hw-step--we  .hw-step__who { background: var(--green-20); color: #00864F; }

.hw-step__title {
    margin: 0 0 8px;
    color: var(--black);
}

.hw-step__text {
    margin: 0 0 16px;
    color: #4a4a5e;
}

.hw-step__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.hw-step__chip {
    padding: 5px 10px;
    border-radius: 999px;
    background: #F3F3F9;
    color: #5a5a70;
    font-size: 12px;
}

.hw .timeline__btn.hw-step__view {
    width: auto;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(102, 102, 255, 0.35);
    border-radius: 999px;
    background: var(--white);
    color: #6666FF;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.hw .timeline__btn.hw-step__view:hover,
.hw .timeline__btn.hw-step__view:focus-visible {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

/* Summary bar */
.hw__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
    padding: 20px 20px 20px 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface-soft);
    color: var(--black);
}

.hw__summary-info {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.hw__summary-ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--green-20);
    color: #00864F;
}

.hw__summary-label {
    display: block;
    color: var(--ink-3);
}

.hw__summary-value {
    display: block;
    color: var(--black);
}

.hw__cta {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 16px 32px;
    border-radius: 18px;
    background: var(--blue);
    color: var(--white);
    text-decoration: none;
    box-shadow: 0 10px 22px -10px rgba(102, 102, 255, 0.8);
    transition: transform 0.25s, box-shadow 0.25s;
}

.hw__cta:hover {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -12px rgba(102, 102, 255, 0.9);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1200px) {
    .hw__panel { padding: 28px; }
    .hw-step__card { padding: 16px; }
}

@media (max-width: 1024px) {
    .ab__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ab-card--hero {
        grid-row: auto;
    }

    /* Vertical timeline */
    .hw__list {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Whole-list track is replaced by per-step segments (icon → next icon),
       so nothing sticks out below the last step. */
    .hw__list::before,
    .hw__list::after {
        content: none;
    }

    .hw-step {
        flex-direction: row;
        align-items: flex-start;
        gap: 18px;
    }

    .hw-step:not(:last-child)::before,
    .hw-step:not(:last-child)::after {
        content: "";
        position: absolute;
        top: calc(var(--hw-ico) / 2);
        bottom: calc(-14px - var(--hw-ico) / 2);
        left: calc(var(--hw-ico) / 2 - 2px);
        width: 4px;
        border-radius: 999px;
    }

    .hw-step:not(:last-child)::before {
        background: var(--green);
        opacity: 0.18;
    }

    .hw-step--you:not(:last-child)::before {
        background: var(--blue);
    }

    .hw-step:not(:last-child)::after {
        background: linear-gradient(180deg, #00C070, var(--green));
        transform-origin: center top;
        transform: scaleY(0);
        transition: transform 0.45s ease;
        transition-delay: calc(var(--i) * 0.45s);
    }

    .hw-step--you:not(:last-child)::after {
        background: linear-gradient(180deg, var(--blue), #8A7BFF);
    }

    /* "you" → "we" transition segment */
    .hw-step--you:has(+ .hw-step--we)::after {
        background: linear-gradient(180deg, var(--blue), #9A6BFF 55%, var(--green));
    }

    .hw__panel.animate .hw-step:not(:last-child)::after {
        transform: scaleY(1);
    }

    .hw-step__card {
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .ab__head,
    .hw__head {
        margin-bottom: 28px;
    }

    .ab__grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ab-card--hero,
    .ab-card--wide {
        grid-column: auto;
    }

    .ab-card {
        padding: 22px;
        border-radius: 24px;
    }

    .ab-card__top {
        flex-direction: column;
        gap: 16px;
    }

    .ab-card--wide {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .ab-card--wide .ab-card__body {
        flex-basis: 100%;
    }

    .ab-card__badge {
        order: -1;
        margin-left: auto;
        padding: 8px 14px;
        border-radius: 14px;
    }

    .ab-form {
        padding: 12px;
    }

    .ab-form__row {
        flex-wrap: wrap;
        padding-left: 12px;
    }

    .ab-form__row .ab-form__input {
        flex: 1 1 100%;
        margin-left: 42px;
    }

    .hw__panel {
        padding: 18px;
        border-radius: 24px;
    }

    .hw__list {
        --hw-ico: 44px;
    }

    .hw-step {
        gap: 14px;
    }

    .hw-step__ico svg {
        width: 18px;
        height: 18px;
    }

    .hw__summary {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
    }

    .hw__cta {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .ab-form__foot {
        flex-direction: column;
        align-items: stretch;
    }

    .ab-form__btn {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hw__list::after,
    .hw-step::after,
    .hw-step__ico,
    .ab-card,
    .hw-step__card {
        transition: none !important;
    }
}
