/**
 * Contact Form 7 - 粋の平屋LP用フォームスタイル
 * 
 * 【WordPressテーマへの読み込み方法】
 * page-sui-hiraya.php内で以下のように読み込む：
 * <link rel="stylesheet" type="text/css" href="<?php echo $lp_assets; ?>/css/contact-form.css">
 */

/* ========================================
   フォームセクション全体
======================================== */
.contact-section {
    background: #f5f3ee;
    padding: 60px 0 80px;
    font-family: 'Yu Gothic', 'YuGothic', 'メイリオ', Meiryo, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', sans-serif;
}

.contact-section__inner {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.contact-section__title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.contact-section__subtitle {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
}

/* ========================================
   フォームレイアウト
======================================== */
.contact-form {
    background: #fff;
    padding: 40px 30px;
    border-radius: 8px;
}

.contact-form__group {
    margin-bottom: 25px;
}

.contact-form__label {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.contact-form__label--required::after {
    content: "必須";
    display: inline-block;
    background: #c94a4a;
    color: #fff;
    font-size: 11px;
    font-weight: normal;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.contact-form__label--optional::after {
    content: "任意";
    display: inline-block;
    background: #999;
    color: #fff;
    font-size: 11px;
    font-weight: normal;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* 入力フィールド共通 */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form input[type="date"],
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    font-family: 'Yu Gothic', 'YuGothic', 'メイリオ', Meiryo, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form input[type="date"]:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #48769d;
}

/* セレクトボックス */
.contact-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: #fff !important;
}

/* CF7のセレクトボックス（wpcf7-form-control）を明示的に指定 */
.contact-form .wpcf7-form-control-wrap select,
.contact-form__datetime select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    box-sizing: border-box;
    height: 50px;
}

/* 日時フィールドの高さを統一 */
.contact-form__datetime input[type="date"] {
    height: 50px;
    padding: 0 16px;
    font-size: 16px;
    line-height: 50px;
    box-sizing: border-box;
}

.contact-form__datetime select {
    height: 50px;
    padding: 12px 40px 12px 16px;
    font-size: 16px;
    line-height: 1.4;
    box-sizing: border-box;
}

/* ========================================
   日時選択グループ
======================================== */
.contact-form__datetime {
    background: #fafafa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.contact-form__datetime-title {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 12px;
}

.contact-form__datetime-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.contact-form__datetime-date {
    flex: 1;
}

.contact-form__datetime-time {
    flex: 1;
}

@media screen and (max-width: 480px) {
    .contact-form__datetime-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .contact-form__datetime-date,
    .contact-form__datetime-time {
        width: 100%;
    }
}

/* ========================================
   エラー表示
======================================== */
.wpcf7-not-valid-tip {
    color: #c94a4a;
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

.wpcf7-not-valid {
    border-color: #c94a4a !important;
}

.wpcf7-response-output {
    margin: 20px 0 0 !important;
    padding: 15px !important;
    border-radius: 4px !important;
}

.wpcf7-mail-sent-ok {
    border-color: #46a049 !important;
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
}

.wpcf7-validation-errors,
.wpcf7-spam-blocked {
    border-color: #c94a4a !important;
    background: #fdecea !important;
    color: #c94a4a !important;
}

/* ========================================
   送信ボタン
======================================== */
.contact-form__submit-wrap {
    margin-top: 10px;
    text-align: center;
}

.contact-form__confirm-btn {
    display: inline-block;
    width: 100%;
    max-width: 300px;
    padding: 18px 40px;
    font-size: 17px;
    font-weight: bold;
    color: #fff;
    background: #48769d;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Yu Gothic', 'YuGothic', 'メイリオ', Meiryo, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', sans-serif;
}

.contact-form__confirm-btn:hover {
    opacity: 0.8;
}

.contact-form__confirm-btn:active {
    transform: translateY(0);
}

/* CF7の送信ボタン（非表示） */
.contact-form__hidden-submit {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   確認モーダル
======================================== */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    font-family: 'Yu Gothic', 'YuGothic', 'メイリオ', Meiryo, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', sans-serif;
}

.confirm-modal.is-active {
    display: block;
}

.confirm-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.confirm-modal__container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.confirm-modal__header {
    background: #48769d;
    color: #fff;
    padding: 20px 25px;
    text-align: center;
}

.confirm-modal__title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.confirm-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.confirm-modal__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.confirm-modal__item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.confirm-modal__item:last-child {
    border-bottom: none;
}

.confirm-modal__item-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 5px;
}

.confirm-modal__item-value {
    font-size: 15px;
    color: #333;
    word-break: break-all;
}

.confirm-modal__item-value:empty::before {
    content: "（未入力）";
    color: #aaa;
}

.confirm-modal__footer {
    padding: 20px 25px;
    background: #f9f9f9;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-modal__btn {
    flex: 1;
    max-width: 180px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Yu Gothic', 'YuGothic', 'メイリオ', Meiryo, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', sans-serif;
}

.confirm-modal__btn--back {
    background: #fff;
    color: #666;
    border: 2px solid #ddd;
}

.confirm-modal__btn--back:hover {
    opacity: 0.8;
}

.confirm-modal__btn--submit {
    background: #48769d;
    color: #fff;
}

.confirm-modal__btn--submit:hover {
    opacity: 0.8;
}

.confirm-modal__btn--submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   背景スクロール無効化
======================================== */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ========================================
   送信完了メッセージ
======================================== */
.contact-form__complete {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.contact-form__complete.is-visible {
    display: block;
}

.contact-form__complete-icon {
    font-size: 50px;
    color: #48769d;
    margin-bottom: 20px;
}

.contact-form__complete-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.contact-form__complete-text {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
}

/* ========================================
   レスポンシブ
======================================== */
@media screen and (max-width: 599px) {
    .contact-section {
        padding: 40px 0 60px;
    }
    
    .contact-section__title {
        font-size: 20px;
    }
    
    .contact-form {
        padding: 30px 20px;
    }
    
    .contact-form__label {
        font-size: 14px;
    }
    
    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form input[type="tel"],
    .contact-form input[type="date"],
    .contact-form select {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .confirm-modal__container {
        width: 95%;
        max-height: 90vh;
    }
    
    .confirm-modal__header {
        padding: 15px 20px;
    }
    
    .confirm-modal__body {
        padding: 20px;
    }
    
    .confirm-modal__footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .confirm-modal__btn {
        max-width: 100%;
    }
}
