/* ==========================================
   5ステッププロセス：シェブロン型デザイン
   色面の矢印帯 ＋ 白い説明ボックスの二段構造
   ========================================== */

/* ========== セクション全体 ========== */
.steps--5 {
    background: var(--bg-light, #F6FAFF);
    padding: 80px 0;
}

.steps__head {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 56px;
    padding: 0 20px;
}

.steps__head h2 {
    font-size: 36px;
    font-weight: 700;
    color: #07193B;
    margin: 0 0 16px;
    line-height: 1.3;
}

.steps__head p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
}

/* ========== ステップグリッド（5カラム） ========== */
.steps__grid--5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* ========== 各ステップカード ========== */
.step-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* 旧スタイルをリセット */
.card__step-marker {
    display: none;
}

.loop-marker {
    display: none;
}

/* ========== 上段：色面ステップ帯（シェブロン形状） ========== */
.card__head {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 120px;
    padding: 20px 24px;
    margin: 0;
    overflow: visible;
    clip-path: polygon(
        0 0,           /* 左上 */
        calc(100% - 20px) 0,  /* 右上（矢印前） */
        100% 50%,      /* 右端の尖り */
        calc(100% - 20px) 100%, /* 右下（矢印後） */
        0 100%         /* 左下 */
    );
}

/* 最初のステップは左端を直線に */
.step-card:first-child .card__head {
    clip-path: polygon(
        0 0,
        calc(100% - 20px) 0,
        100% 50%,
        calc(100% - 20px) 100%,
        0 100%
    );
}

/* 最後のステップは右端も直線に（尖りを残す） */
.step-card:last-child .card__head {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%
    );
}

/* 2番目以降のステップ：左側に切り欠き */
.step-card:not(:first-child) .card__head {
    clip-path: polygon(
        20px 0,        /* 左上（切り欠き後） */
        calc(100% - 20px) 0,
        100% 50%,
        calc(100% - 20px) 100%,
        20px 100%,     /* 左下（切り欠き後） */
        0 50%          /* 左端の凹み */
    );
    margin-left: -20px;
}

/* 最後のステップの右端処理 */
.step-card:last-child .card__head {
    clip-path: polygon(
        20px 0,
        100% 0,
        100% 100%,
        20px 100%,
        0 50%
    );
}

/* ========== ステップごとの背景色 ========== */
/* STEP 01 - 青 */
.step-card[data-step="1"] .card__head {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* STEP 02 - 水色 */
.step-card[data-step="2"] .card__head {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* STEP 03 - オレンジ */
.step-card[data-step="3"] .card__head {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

/* STEP 04 - 緑 */
.step-card[data-step="4"] .card__head {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* STEP 05 - 紫 */
.step-card[data-step="5"] .card__head {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* ========== バッジ（上段内） ========== */
.badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.badge__icon {
    font-size: 24px;
    flex-shrink: 0;
}

.badge__step {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== タイトル（上段内） ========== */
.card__title {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ループアイコン（STEP 05のみ） */
.loop-badge {
    display: inline-block;
    margin-left: 4px;
}

.loop-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    opacity: 0.9;
}

/* ========== 下段：白い説明ボックス ========== */
.card__sub {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #FFFFFF;
    border: 1px solid rgba(203, 213, 225, 0.5);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 24px 20px;
    height: 130px;
    min-height: 130px;
    max-height: 130px;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* STEP 05の強調スタイル */
.card--accent .card__sub {
    background: linear-gradient(135deg, #FEFEFF 0%, #F5F3FF 100%);
    border-color: rgba(139, 92, 246, 0.2);
}

/* ========== 下部メッセージ ========== */
.steps__note {
    text-align: center;
    margin-top: 48px;
    padding: 20px 32px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF5D9 100%);
    border: 2px solid #FFE3A0;
    border-radius: 12px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.12);
}

/* ========================================== 
   レスポンシブデザイン
   ========================================== */

/* タブレット（1024px以下） */
@media (max-width: 1024px) {
    .steps__grid--5 {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px 0;
    }

    .step-card:not(:first-child) .card__head {
        margin-left: 0;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .card__head {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%) !important;
        height: 100px;
        border-radius: 8px 8px 0 0;
    }

    .card__sub {
        height: 110px;
        min-height: 110px;
        max-height: 110px;
        font-size: 12px;
        padding: 20px 16px;
    }

    .steps__head h2 {
        font-size: 30px;
    }
}

/* モバイル（768px以下） */
@media (max-width: 768px) {
    .steps--5 {
        padding: 60px 0;
    }

    .steps__grid--5 {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px;
    }

    .card__head {
        height: 90px;
        padding: 16px 20px;
        border-radius: 8px 8px 0 0;
    }

    .card__title {
        font-size: 15px;
    }

    .badge__icon {
        font-size: 20px;
    }

    .badge__step {
        font-size: 10px;
    }

    .card__sub {
        height: 100px;
        min-height: 100px;
        max-height: 100px;
        font-size: 12px;
        padding: 16px;
    }

    .steps__head {
        margin-bottom: 40px;
    }

    .steps__head h2 {
        font-size: 26px;
    }

    .steps__head p {
        font-size: 14px;
    }

    .steps__note {
        margin-top: 32px;
        padding: 16px 24px;
        font-size: 13px;
    }
}

/* 小型モバイル（480px以下） */
@media (max-width: 480px) {
    .steps__head h2 {
        font-size: 22px;
    }

    .card__head {
        height: 80px;
        padding: 12px 16px;
    }

    .card__title {
        font-size: 14px;
    }

    .card__sub {
        height: 90px;
        min-height: 90px;
        max-height: 90px;
        font-size: 11px;
        padding: 12px;
    }
}
