/* =========================================================
   ANALYSIS FLOW
   對應 AnalysisFlowSection.tsx
========================================================= */

.analysis-flow {
    position: relative;

    padding-top: 80px;
    padding-bottom: 80px;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #f7f8fa 0%,
            #eef2f6 100%
        );
}

.analysis-flow__container {
    width: 100%;
    max-width: 1280px;

    margin-right: auto;
    margin-left: auto;

    padding-right: 16px;
    padding-left: 16px;
}

/* =========================================================
   區塊標題
========================================================= */

.analysis-flow__header {
    max-width: 760px;

    margin-right: auto;
    margin-left: auto;

    text-align: center;
}

.analysis-flow__title {
    margin: 0;

    color: #07111d;

    font-size: 32px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.analysis-flow__title-accent {
    margin-left: 4px;

    color: transparent;

    background:
        linear-gradient(
            135deg,
            oklch(0.82 0.16 82) 0%,
            oklch(0.72 0.19 55) 100%
        );

    -webkit-background-clip: text;
    background-clip: text;
}

.analysis-flow__subtitle {
    max-width: 680px;

    margin:
        16px
        auto
        0;

    color: #66788a;

    font-size: 14px;
    line-height: 1.75;
}

/* =========================================================
   七步流程外層
========================================================= */

.analysis-flow__steps {
    position: relative;

    display: flex;

    max-width: 980px;

    margin:
        48px
        auto
        0;

    flex-direction: column;
    gap: 16px;
}

/* 桌機中間垂直線 */
.analysis-flow__steps::before {
    position: absolute;

    top: 40px;
    bottom: 40px;
    left: 49px;

    display: block;

    width: 2px;

    content: "";

    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(245, 198, 90, 0.55) 8%,
            rgba(245, 198, 90, 0.55) 92%,
            transparent 100%
        );
}

/* =========================================================
   單一步驟
========================================================= */

.analysis-flow__step {
    position: relative;

    display: grid;

    min-height: 116px;

    padding:
        20px
        20px
        20px
        88px;

    grid-template-columns: 1fr;
    align-items: center;

    border: 1px solid #dfe5eb;
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 18px 45px -28px rgba(7, 17, 29, 0.32);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.analysis-flow__step:hover {
    border-color: rgba(245, 198, 90, 0.55);

    box-shadow:
        0 22px 55px -28px rgba(7, 17, 29, 0.42);

    transform: translateY(-3px);
}

/* =========================================================
   流程編號
========================================================= */

.analysis-flow__number {
    position: absolute;

    top: 50%;
    left: 24px;
    z-index: 3;

    display: grid;

    width: 50px;
    height: 50px;

    place-items: center;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            oklch(0.82 0.16 82) 0%,
            oklch(0.72 0.19 55) 100%
        );

    color: #07111d;

    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;

    box-shadow:
        0 8px 24px rgba(239, 150, 47, 0.30);

    transform: translateY(-50%);
}

/* =========================================================
   圖示
========================================================= */

.analysis-flow__icon {
    display: grid;

    width: 44px;
    height: 44px;

    margin-bottom: 12px;

    place-items: center;

    border: 1px solid rgba(21, 49, 79, 0.10);
    border-radius: 12px;

    background: #102747;

    color: #f5c65a;
}

.analysis-flow__icon svg {
    width: 22px;
    height: 22px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
   文字內容
========================================================= */

.analysis-flow__content {
    min-width: 0;
}

.analysis-flow__heading {
    display: flex;

    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.analysis-flow__step-title {
    margin: 0;

    color: #07111d;

    font-size: 17px;
    font-weight: 900;
    line-height: 1.35;
}

.analysis-flow__step-en {
    color: #8a9bad;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;

    letter-spacing: 0.04em;
}

.analysis-flow__description {
    margin:
        8px
        0
        0;

    color: #66788a;

    font-size: 14px;
    line-height: 1.75;
}

/* 右上 STEP 裝飾字 */
.analysis-flow__step-label {
    position: absolute;

    top: 16px;
    right: 18px;

    color: rgba(7, 17, 29, 0.06);

    font-family: Arial, sans-serif;
    font-size: 26px;
    font-weight: 900;
    line-height: 1;

    letter-spacing: 0.08em;

    pointer-events: none;
}

/* =========================================================
   不同步驟細微變化
========================================================= */

.analysis-flow__step:nth-child(2) .analysis-flow__icon {
    color: #7dd3fc;
}

.analysis-flow__step:nth-child(3) .analysis-flow__icon {
    color: #c4b5fd;
}

.analysis-flow__step:nth-child(4) .analysis-flow__icon {
    color: #6ee7b7;
}

.analysis-flow__step:nth-child(5) .analysis-flow__icon {
    color: #fda4af;
}

.analysis-flow__step:nth-child(6) .analysis-flow__icon {
    color: #f5c65a;
}

.analysis-flow__step:nth-child(7) .analysis-flow__icon {
    color: #7dd3fc;
}

/* =========================================================
   結論
========================================================= */

.analysis-flow__conclusion {
    max-width: 820px;

    margin:
        40px
        auto
        0;

    padding:
        18px
        24px;

    border: 1px solid rgba(245, 198, 90, 0.30);
    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #102747 0%,
            #16385f 100%
        );

    color: rgba(255, 255, 255, 0.88);

    font-size: 15px;
    line-height: 1.7;

    text-align: center;

    box-shadow:
        0 20px 50px -28px rgba(7, 17, 29, 0.50);
}

.analysis-flow__conclusion span {
    color: #f5c65a;

    font-weight: 900;
}

/* =========================================================
   平板
========================================================= */

@media (min-width: 640px) {
    .analysis-flow {
        padding-top: 96px;
        padding-bottom: 96px;
    }

    .analysis-flow__container {
        padding-right: 24px;
        padding-left: 24px;
    }

    .analysis-flow__title {
        font-size: 40px;
    }

    .analysis-flow__subtitle {
        font-size: 16px;
    }

    .analysis-flow__step {
        min-height: 128px;

        padding:
            24px
            24px
            24px
            110px;

        grid-template-columns:
            56px
            minmax(0, 1fr);

        gap: 20px;
    }

    .analysis-flow__steps::before {
        left: 55px;
    }

    .analysis-flow__number {
        left: 28px;

        width: 56px;
        height: 56px;

        font-size: 15px;
    }

    .analysis-flow__icon {
        width: 52px;
        height: 52px;

        margin-bottom: 0;
    }

    .analysis-flow__icon svg {
        width: 26px;
        height: 26px;
    }

    .analysis-flow__step-title {
        font-size: 19px;
    }

    .analysis-flow__step-en {
        font-size: 12px;
    }

    .analysis-flow__description {
        font-size: 15px;
    }

    .analysis-flow__conclusion {
        padding:
            20px
            28px;

        font-size: 17px;
    }
}

/* =========================================================
   桌機
========================================================= */

@media (min-width: 1024px) {
    .analysis-flow__container {
        padding-right: 32px;
        padding-left: 32px;
    }

    .analysis-flow__title {
        font-size: 48px;
    }

    .analysis-flow__steps {
        gap: 20px;
    }

    .analysis-flow__step {
        min-height: 132px;

        padding:
            26px
            32px
            26px
            126px;

        grid-template-columns:
            60px
            minmax(0, 1fr);

        gap: 24px;

        border-radius: 20px;
    }

    .analysis-flow__steps::before {
        left: 63px;
    }

    .analysis-flow__number {
        left: 34px;

        width: 58px;
        height: 58px;
    }

    .analysis-flow__icon {
        width: 56px;
        height: 56px;

        border-radius: 14px;
    }

    .analysis-flow__icon svg {
        width: 28px;
        height: 28px;
    }

    .analysis-flow__step-title {
        font-size: 21px;
    }

    .analysis-flow__description {
        max-width: 700px;
    }

    .analysis-flow__step-label {
        top: 20px;
        right: 24px;

        font-size: 32px;
    }
}

/* =========================================================
   小手機
========================================================= */

@media (max-width: 420px) {
    .analysis-flow {
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .analysis-flow__container {
        padding-right: 14px;
        padding-left: 14px;
    }

    .analysis-flow__title {
        font-size: 28px;
    }

    .analysis-flow__subtitle {
        font-size: 14px;
    }

    .analysis-flow__steps {
        margin-top: 36px;
        gap: 14px;
    }

    .analysis-flow__steps::before {
        left: 38px;
    }

    .analysis-flow__step {
        min-height: 108px;

        padding:
            16px
            14px
            16px
            72px;

        border-radius: 16px;
    }

    .analysis-flow__number {
        left: 14px;

        width: 48px;
        height: 48px;

        font-size: 13px;
    }

    .analysis-flow__icon {
        width: 40px;
        height: 40px;

        margin-bottom: 10px;
    }

    .analysis-flow__icon svg {
        width: 20px;
        height: 20px;
    }

    .analysis-flow__step-title {
        font-size: 15px;
    }

    .analysis-flow__step-en {
        display: block;

        width: 100%;

        font-size: 10px;
    }

    .analysis-flow__description {
        margin-top: 6px;

        font-size: 12px;
        line-height: 1.65;
    }

    .analysis-flow__step-label {
        display: none;
    }

    .analysis-flow__conclusion {
        margin-top: 32px;

        padding:
            16px
            14px;

        font-size: 14px;
    }
}

/* =========================================================
   減少動畫偏好
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .analysis-flow__step {
        transition: none;
    }

    .analysis-flow__step:hover {
        transform: none;
    }
}

/* =========================================================
   瀏覽器備援
========================================================= */

@supports not (color: oklch(0.82 0.16 82)) {
    .analysis-flow__title-accent,
    .analysis-flow__number {
        background:
            linear-gradient(
                135deg,
                #f5c65a 0%,
                #ef962f 100%
            );
    }
}