/* ==========================================================================
                    問い合わせフォームが入るページの共通スタイル
   ========================================================================== */

/* ステップ部分のスタイル
   ========================================================================== */
.contact-section__step__list {
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 45rem;
    padding: 0 0.75rem;
    margin-inline: auto;

    li {
        background-color: var(--white-color);
        color: var(--primary-color);
        aspect-ratio: 1;
        padding-top: clamp(1.25rem, calc(0.189rem + 2.83vw), 2rem);
        /* min: 20px, max: 32px */
        border-radius: 100vw;
        max-width: min(10rem, 100%);
        flex: 1;
        font-size: clamp(0.75rem, calc(0.219rem + 1.415vw), 1.125rem);
        /* min: 12px, max: 18px */
        font-weight: 600;
        text-align: center;
        letter-spacing: 0.1em;
        position: relative;
        z-index: 1;
        counter-increment: step-number;

        &::before {
            content: "0" counter(step-number);
            display: block;
        }
    }

    li.active {
        background-color: #146EC8;
        color: var(--white-color);
    }

    &::before {
        content: '';
        display: block;
        height: 1px;
        background-color: var(--white-color);
        position: absolute;
        left: 1rem;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 0;
    }

}

.contact-section__step__message {
    margin-top: clamp(2.5rem, calc(-1.038rem + 9.434vw), 5rem);
    /* min: 40px, max: 80px */
    text-align: center;
    color: white;

    br {
        display: none;

        @media screen and (width <=600px) {
            display: inline;
        }
    }
}



/* フォーム部分のスタイル
   ========================================================================== */
.contact-form {
    margin: 0 auto;
    margin-top: clamp(2.5rem, calc(-1.038rem + 9.434vw), 5rem);
    padding: 6.25rem 3rem;
    border-radius: 2rem;
    background-color: var(--bg-color);

    .form-row {
        margin-inline: auto;
        max-width: min(55rem, 100%);
    }

    .form-row+.form-row {
        margin-top: 2.5rem;
    }


    .form-label {
        display: flex;
        align-items: baseline;
        gap: 1rem;

        font-size: clamp(1rem, calc(0.823rem + 0.472vw), 1.125rem);
        /* min: 16px, max: 18px */
        font-weight: 500;
        letter-spacing: 0.1em;

        label {
            display: flex;
            align-items: center;
        }
    }

    .form-label .required {
        display: inline-block;
        margin-left: 0.5rem;
        padding: 0.125rem 1rem;
        background-color: #C20000;
        color: white;
        font-size: clamp(0.625rem, calc(0.448rem + 0.472vw), 0.75rem);
        /* min: 10px, max: 12px */
        line-height: 1.5;
        border-radius: 6px;
        font-weight: normal;
    }

    .form-note {
        color: #7B7B7B;
        font-size: clamp(0.625rem, calc(0.448rem + 0.472vw), 0.75rem);
        font-weight: 400;
    }

    .form-note__mail {
        color: var(--primary-color);
        margin-top: 1rem;
    }

    .form-input {
        margin-top: 0.75rem;
    }

    .form-input input[type="text"],
    .form-input input[type="email"],
    .form-input input[type="tel"],
    .form-input textarea {
        width: 50%;
        padding: 0.875rem 1rem;
        border: none;
        border-radius: 4px;
        transition: border-color 0.3s;
    }

    .form-input input:focus,
    .form-input textarea:focus {
        outline: none;
        border-color: #0066cc;
    }

    .form-input input.error {
        border-color: #dc3545;
    }

    .form-input textarea {
        width: 100%;
        resize: vertical;
    }

    .form-input textarea[name="message"] {
        height: 12.5rem;
    }

    .form-input__delivery-date {
        display: flex;
        align-items: center;
        gap: 1rem;

        input[type="text"] {
            width: auto;
        }

        .calendar-btn {
            border: none;
            line-height: 1;

            &::before {
                content: url(../assets/images/quotation-date-button.svg);
                display: inline-block;

            }
        }
    }

    /* 郵便番号検索 */
    .postal-code-group {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 1rem;
    }

    .postal-code-group .postal-code__input-wrapper {
        font-size: 1.125rem;
        color: #7B7B7B;
        background-color: #fff;
        padding-left: 1rem;
    }

    .postal-code-group input {
        width: 9.375rem !important;
    }

    .address-search-btn {
        padding: 0.5rem 1.375rem;
        background-color: #7B7B7B;
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.75rem;
        transition: background-color 0.3s;
    }

    .address-search-btn:hover {
        background-color: #5a6268;
    }

    /* エラーメッセージ */
    .error-message {
        display: block;
        margin-top: 0.5rem;
        color: #dc3545;
        font-size: 14px;
    }

    .response__container {
        max-width: min(55rem, 100%);
        margin-inline: auto;
    }

    .wpcf7-response-output {
        background-color: var(--accent-color);
        border-radius: 1rem;
        color: var(--white-color);
        font-weight: 600;
        height: 3rem;
        align-content: center;
        text-align: center;
    }

    @media screen and (width <=600px) {
        padding: 5rem 0.75rem;

        .form-row+.form-row {
            margin-top: 1.5rem;
        }

        .form-label .required {
            margin-left: 0.5rem;
            padding: 0.125rem 0.75rem;
            font-weight: 500;
        }

        .form-input {
            margin-top: 0.5rem;
        }

        .form-input input[type="text"],
        .form-input input[type="email"],
        .form-input input[type="tel"],
        .form-input textarea {
            width: 100%;
            padding: 0.5rem 0.75rem;
        }

        .wpcf7-radio .wpcf7-list-item {
            display: block;
            margin-left: 0;

            label {
                font-size: 1rem;
            }

            &+.wpcf7-list-item {
                margin-top: 0.5rem;
            }
        }
    }
}

/* 確認画面のみに適用したいフォームのスタイル
   ========================================================================== */
.contact-form.confirm-form {
    .form-input {
        margin-top: 1rem;
        padding-left: 2rem;
    }

    @media screen and (width <=600px) {
        .form-row+.form-row {
            margin-top: 2rem;
        }

        .form-input {
            margin-top: 0.5rem;
            padding-left: 0;
            font-size: 1rem;
        }
    }
}



/* ボタン部分のスタイル
   ========================================================================== */
.wpcf7-submit {
    border: none;
}

.button__container {
    margin-top: clamp(5rem, calc(3.231rem + 4.717vw), 6.25rem);
    /* min: 80px, max: 100px */
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 2.5rem;
    row-gap: 1.5rem;
}

/* 確認・送信ボタン(div部分) */
.form-submit,
.form-back {
    text-align: center;
    position: relative;
    width: fit-content;

    &::after {
        content: '→';
        color: var(--primary-color);
        position: absolute;
        top: 50%;
        right: 3rem;
        transform: translateY(-50%);
    }
}

.form-back {
    &::after {
        content: '←';
        color: var(--primary-color);
        position: absolute;
        top: 50%;
        right: auto;
        left: 3rem;
        transform: translateY(-50%);
    }
}

/* 確認・送信ボタン中身のスタイル(input部分) */
.form-button {
    --button-icon-size: 2rem;
    width: fit-content;
    min-width: 18.8rem;
    padding: 1.3rem 3.75rem;
    background-color: var(--white-color);
    color: var(--primary-color);
    font-size: clamp(1rem, calc(0.823rem + 0.472vw), 1.125rem);
    /* min: 16px, max: 18px */
    font-weight: 500;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 1.3rem;
    text-align: center;
    transition: background-color 0.3s;

    @media screen and (width <=600px) {
        min-width: 260px;
    }
}

.form-back .form-button {
    background-color: #ccc;
}

/* CF7送信ボタン スピナー部分のスタイル */
.wpcf7-spinner {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 1rem;
    margin: 0;
    background-color: var(--primary-color);
}



/* デフォルトスタイル上書き部分
   ========================================================================== */
.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 14px;
    margin-top: 0.5rem;
    display: none;
    /* デフォルトで非表示 */
    position: absolute;
    /* レイアウト崩れ防止 */
}

.wpcf7 form .wpcf7-response-output {
    /* margin: 0; */
    border: none;
}


/* 送信エラー時のみ表示 */
.wpcf7-form.invalid .wpcf7-not-valid-tip {
    display: block;
    position: static;
    /* エラー時は通常表示 */
}

.wpcf7-validation-errors,
.wpcf7-mail-sent-ng {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}