/* ========================================
   Contact Form 7 - テーマデザイン統合スタイル
   Alpha Plan カスタムテーマ用
   ======================================== */

/* --- CF7 デフォルトスタイルのリセット --- */
.cf7-styled-form .wpcf7 {
    margin: 0;
    padding: 0;
}

.cf7-styled-form .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* --- ラベル（<label> 直接 & .cf7-label カスタムクラス） --- */
.cf7-styled-form label,
.cf7-styled-form .cf7-label {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-white);
    margin-bottom: 0;
}

.cf7-styled-form label i,
.cf7-styled-form .cf7-label i {
    color: var(--color-cyan);
}

.cf7-styled-form .required {
    color: #f44336;
    font-size: 13px;
}

/* --- フォームフィールドグループ --- */
.cf7-styled-form .cf7-field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- 2カラムレイアウト --- */
.cf7-styled-form .cf7-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .cf7-styled-form .cf7-row {
        grid-template-columns: 1fr;
    }
}

/* --- テキスト入力 / テキストエリア / セレクト --- */
.cf7-styled-form .wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-checkbox):not(.wpcf7-radio):not(.wpcf7-acceptance) {
    width: 100%;
    padding: 15px 20px;
    background: rgba(26, 43, 69, 0.6);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 10px;
    color: var(--color-white);
    font-size: 15px;
    font-family: var(--font-primary);
    transition: var(--transition-smooth);
    box-sizing: border-box;
}

.cf7-styled-form .wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-checkbox):not(.wpcf7-radio):not(.wpcf7-acceptance):focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

/* プレースホルダー */
.cf7-styled-form .wpcf7-form-control::placeholder {
    color: var(--color-gray);
    opacity: 0.7;
}

/* テキストエリア */
.cf7-styled-form textarea.wpcf7-form-control {
    min-height: 140px;
    resize: vertical;
}

/* セレクト */
.cf7-styled-form select.wpcf7-form-control {
    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='%2300d9ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* --- チェックボックス / ラジオボタン --- */
.cf7-styled-form .wpcf7-checkbox,
.cf7-styled-form .wpcf7-radio {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cf7-styled-form .wpcf7-checkbox .wpcf7-list-item,
.cf7-styled-form .wpcf7-radio .wpcf7-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-white);
    margin: 0;
}

.cf7-styled-form .wpcf7-checkbox .wpcf7-list-item-label,
.cf7-styled-form .wpcf7-radio .wpcf7-list-item-label {
    cursor: pointer;
}

.cf7-styled-form .wpcf7-checkbox input[type="checkbox"],
.cf7-styled-form .wpcf7-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-cyan);
    cursor: pointer;
    flex-shrink: 0;
}

/* チェックボックスを横並びにしたい場合（オプション） */
.cf7-styled-form .cf7-checkbox-inline .wpcf7-checkbox,
.cf7-styled-form .cf7-checkbox-inline .wpcf7-radio {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 24px;
}

/* --- 同意チェックボックス (acceptance) --- */
.cf7-styled-form .wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cf7-styled-form .wpcf7-acceptance input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-cyan);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.cf7-styled-form .wpcf7-acceptance .wpcf7-list-item-label {
    font-size: 13px;
    color: var(--color-gray-light);
    line-height: 1.6;
}

/* --- 送信ボタン --- */
.cf7-styled-form .wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: 50px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--gradient-primary);
    color: var(--color-dark-navy);
    box-shadow: var(--glow-cyan);
    transition: var(--transition-smooth);
    margin-top: 15px;
}

.cf7-styled-form .wpcf7-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.5);
}

.cf7-styled-form .wpcf7-submit:disabled,
.cf7-styled-form .wpcf7-submit[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- 送信中スピナー --- */
.cf7-styled-form .wpcf7-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 217, 255, 0.3);
    border-top-color: var(--color-cyan);
    border-radius: 50%;
    animation: cf7-spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
    background: none;
}

@keyframes cf7-spin {
    to { transform: rotate(360deg); }
}

/* --- バリデーションエラー --- */
.cf7-styled-form .wpcf7-not-valid-tip {
    color: #f44336;
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cf7-styled-form .wpcf7-not-valid-tip::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
}

.cf7-styled-form .wpcf7-not-valid {
    border-color: #f44336 !important;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3) !important;
}

/* --- 送信レスポンスメッセージ --- */
.cf7-styled-form .wpcf7-response-output {
    border-radius: 12px !important;
    padding: 16px 24px !important;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 0 0 !important;
    border: none !important;
}

/* 送信成功 */
.cf7-styled-form .wpcf7-mail-sent-ok,
.cf7-styled-form .wpcf7 form.sent .wpcf7-response-output {
    background: rgba(0, 229, 204, 0.15) !important;
    border: 1px solid var(--color-emerald) !important;
    color: var(--color-emerald) !important;
}

/* 送信失敗 */
.cf7-styled-form .wpcf7-mail-sent-ng,
.cf7-styled-form .wpcf7 form.failed .wpcf7-response-output,
.cf7-styled-form .wpcf7 form.aborted .wpcf7-response-output {
    background: rgba(244, 67, 54, 0.15) !important;
    border: 1px solid #f44336 !important;
    color: #f44336 !important;
}

/* バリデーションエラー全体 */
.cf7-styled-form .wpcf7-validation-errors,
.cf7-styled-form .wpcf7 form.invalid .wpcf7-response-output,
.cf7-styled-form .wpcf7 form.unaccepted .wpcf7-response-output {
    background: rgba(255, 152, 0, 0.15) !important;
    border: 1px solid #ff9800 !important;
    color: #ff9800 !important;
}

/* 送信中 */
.cf7-styled-form .wpcf7 form.submitting .wpcf7-response-output {
    background: rgba(0, 217, 255, 0.1) !important;
    border: 1px solid var(--color-cyan) !important;
    color: var(--color-cyan) !important;
}

/* --- ファイルアップロード（使用する場合） --- */
.cf7-styled-form .wpcf7-file {
    padding: 12px 16px;
    background: rgba(26, 43, 69, 0.6);
    border: 1px dashed rgba(0, 217, 255, 0.3);
    border-radius: 10px;
    color: var(--color-white);
    width: 100%;
    cursor: pointer;
}

.cf7-styled-form .wpcf7-file:hover {
    border-color: var(--color-cyan);
}

/* --- CF7 p タグのリセット --- */
.cf7-styled-form .wpcf7-form > p {
    margin: 0;
}

/* --- ブラウザ自動入力 --- */
.cf7-styled-form .wpcf7-form-control:-webkit-autofill,
.cf7-styled-form .wpcf7-form-control:-webkit-autofill:hover,
.cf7-styled-form .wpcf7-form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-white);
    -webkit-box-shadow: 0 0 0 1000px rgba(26, 43, 69, 0.8) inset;
    transition: background-color 5000s ease-in-out 0s;
    border-color: rgba(0, 217, 255, 0.5);
}
