/**
 * Contact Form 7 カスタムスタイル
 */

/* フォーム全体のコンパクト化 */
.wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 8px !important;
}

.wpcf7-form > p,
.wpcf7-form > div {
    margin: 0 !important;
    padding: 0 !important;
}

/* ラベル（入力タイトル）のスタイル */
.wpcf7-form label {
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 2px !important;
    display: block !important;
    color: #374151 !important;
}

/* 入力ボックス全般 */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="date"],
.wpcf7-form select,
.wpcf7-form textarea {
    font-size: 13px !important;
    padding: 8px 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 日付入力と時間選択 */
.wpcf7-form input[type="date"],
.wpcf7-form select {
    font-size: 12px !important;
    padding: 6px 8px !important;
}

/* テキストエリア */
.wpcf7-form textarea {
    min-height: 60px !important;
    resize: vertical !important;
}

/* 送信ボタン */
.wpcf7-form input[type="submit"] {
    padding: 10px 20px !important;
    font-size: 14px !important;
    margin-top: 8px !important;
}

/* チェックボックスコンテナ - 2x2グリッド */
.wpcf7-form span.wpcf7-form-control.wpcf7-checkbox {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

/* チェックボックスアイテム */
.wpcf7-form .wpcf7-checkbox .wpcf7-list-item {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

/* チェックボックスのラベルスタイル */
.wpcf7-form .wpcf7-checkbox .wpcf7-list-item label {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 12px 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    height: 44px !important;
    background: #fff !important;
}

.wpcf7-form .wpcf7-checkbox .wpcf7-list-item label:hover {
    background-color: #f9fafb !important;
}

/* チェックボックスの入力 */
.wpcf7-form .wpcf7-checkbox input[type="checkbox"] {
    flex-shrink: 0 !important;
    margin-right: 6px !important;
    width: 16px !important;
    height: 16px !important;
}

/* チェックボックスのテキスト */
.wpcf7-form .wpcf7-checkbox .wpcf7-list-item-label {
    font-size: 12px !important;
    color: #374151 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* モバイルでは1列に */
@media (max-width: 480px) {
    .wpcf7-form span.wpcf7-form-control.wpcf7-checkbox {
        grid-template-columns: 1fr !important;
    }
    
    .wpcf7-form .wpcf7-checkbox .wpcf7-list-item-label {
        white-space: normal !important;
    }
}

/* Contact Form 7のレスポンスメッセージをモーダル内でも目立たせる */
#property-form-modal .wpcf7-response-output,
#rental-form-modal .wpcf7-response-output {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
}

#property-form-modal .wpcf7-mail-sent-ok,
#rental-form-modal .wpcf7-mail-sent-ok {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

#property-form-modal .wpcf7-validation-errors,
#rental-form-modal .wpcf7-validation-errors {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
