/* Oshiwaku Contact Form Styles */

/* フォーム全体 */
.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* フォームグループ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-label.required::after {
    content: " *";
    color: #e74c3c;
}

/* 入力フィールド */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-control.error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.form-control.security-warning {
    border-color: #f39c12;
    background-color: #fdf6e3;
}

/* ラジオボタングループ */
.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
}

/* 条件表示フィールド */
.conditional-fields {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
    margin-top: 15px;
}

.conditional-fields.hidden {
    display: none;
}

/* プログレスバー */
.form-progress {
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #28a745;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 文字数カウンター */
.char-counter {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
    margin-top: 4px;
}

.char-counter.warning {
    color: #f39c12;
    font-weight: bold;
}

.char-counter.error {
    color: #e74c3c;
    font-weight: bold;
}

/* エラーメッセージ */
.error-messages {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error-messages h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.error-messages ul {
    margin: 0;
    padding-left: 20px;
}

.error-messages li {
    margin: 5px 0;
}

/* フィールド別エラーメッセージ */
.field-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 6px;
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
    line-height: 1.4;
}

.field-error::before {
    content: '⚠️';
    margin-right: 6px;
    font-size: 12px;
}

/* エラー状態のフィールド */
.wpcf7-not-valid {
    border-color: #e74c3c !important;
    background-color: #fdf2f2 !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.wpcf7-not-valid:focus {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

/* ラジオボタングループのエラー状態 */
.wpcf7-radio.wpcf7-not-valid .wpcf7-list-item label,
.radio-group.wpcf7-not-valid .wpcf7-list-item label,
.radio-group.wpcf7-not-valid label,
.radio-error {
    border-color: #e74c3c !important;
    background-color: #fdf2f2 !important;
}

.wpcf7-radio.wpcf7-not-valid .wpcf7-list-item label:hover,
.radio-group.wpcf7-not-valid .wpcf7-list-item label:hover,
.radio-group.wpcf7-not-valid label:hover,
.radio-error:hover {
    border-color: #c0392b !important;
    background-color: #fbeaea !important;
}

/* セキュリティ警告メッセージ */
.security-warning-message {
    color: #f39c12;
    font-size: 12px;
    margin-top: 4px;
    font-weight: bold;
}

/* 送信ボタングループ */
.form-submit-group {
    text-align: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* ローディングオーバーレイ */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background-color: white;
    padding: 20px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* セキュリティ警告バー */
.security-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .contact-form-wrapper {
        padding: 15px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-control {
        padding: 10px 12px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .contact-form-wrapper {
        padding: 10px;
    }
    
    .conditional-fields {
        padding: 15px;
    }
    
    .char-counter {
        font-size: 11px;
    }
}

/* アクセシビリティ対応 */
.form-control:focus,
.btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 印刷対応 */
@media print {
    .form-progress,
    .char-counter,
    .btn,
    #loading-overlay {
        display: none;
    }
    
    .form-control {
        border: 1px solid #333;
    }
}

/* プログレスバー */
.form-progress {
    width: 100%;
    height: 8px;
    background: rgba(226, 232, 240, 0.6);
    border-radius: 9999px;
    margin-bottom: 40px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9999px;
    position: relative;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 2s infinite;
    border-radius: 9999px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* エラーメッセージ */
.error-messages {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    color: #991b1b;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
    position: relative;
    overflow: hidden;
}

.error-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.3), transparent);
}

.error-messages h4 {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-messages h4::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.error-messages ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.error-messages li {
    margin-bottom: 12px;
    line-height: 1.5;
    padding-left: 24px;
    position: relative;
}

.error-messages li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: bold;
    font-size: 1.2rem;
}

/* フィールドエラー */
.field-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.form-control.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

/* 文字数カウンター */
.char-counter {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.char-counter.warning {
    color: #e67e22;
    font-weight: bold;
}

/* アニメーション効果 */
.conditional-fields {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    transform-origin: top;
}

.conditional-fields.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    transform: scaleY(0);
}

.conditional-fields:not(.hidden) {
    animation: slideInFade 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInFade {
    0% {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.95);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-5px) scaleY(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

/* フォーカス時のエレベーション効果 */
.form-control:focus {
    animation: focusPulse 0.3s ease;
}

@keyframes focusPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ボタンのリップル効果 */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    pointer-events: none;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* フォーカス効果 */
.form-control:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.15);
}

/* ホバー効果 */
.radio-group label:hover {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 8px;
    margin: -8px;
    transition: background-color 0.2s ease;
}

/* 送信ボタンのローディング状態 */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* 成功メッセージ */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 30px;
    color: #155724;
}

/* ツールチップ */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.85rem;
    z-index: 1000;
}

.tooltip::before {
    content: "";
    position: absolute;
    bottom: 118%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 印刷時のスタイル */
@media print {
    .contact-form-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        display: none;
    }
    
    .form-progress {
        display: none;
    }
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 2px;
    }
    
    .btn-primary {
        background: #0056b3;
        border: 2px solid #0056b3;
    }
    
    .progress-bar {
        background: #0056b3;
    }
}

/* 縮小モーション対応 */
@media (prefers-reduced-motion: reduce) {
    .conditional-fields,
    .form-control,
    .btn,
    .progress-bar {
        transition: none;
    }
    
    .conditional-fields:not(.hidden) {
        animation: none;
    }
}

/* アクセシビリティ改善 */
.form-group {
    position: relative;
}

.form-control:focus + .form-help {
    display: block;
}

.form-help {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    padding: 10px;
    font-size: 0.9rem;
    color: #666;
    z-index: 10;
}

/* スクリーンリーダー用の隠しテキスト */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* フォームの状態表示 */
.form-status {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.form-status.saving {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.form-status.saved {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/**
 * Oshiwaku Contact Form CSS (統合版)
 * Contact Form 7対応 + ページレイアウトスタイル
 */

/* === PAGE STYLES === */
/* お問い合わせページ系統共通スタイル */

.contact-page,
.contact-confirm-page, 
.contact-completed-page {
    min-height: 100vh;
    padding: 60px 0;
    position: relative;
}

.contact-page {
    background: url('/wp-content/themes/oshiwaku/images/background/form-background.png') center/cover no-repeat;
    background-attachment: fixed;
}

.contact-confirm-page {
    padding: 40px 0;
    background-color: #f8f9fa;
    min-height: 80vh;
}

.contact-completed-page {
    background: url('/wp-content/themes/oshiwaku/images/background/form-background.png') center/cover no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
}

.contact-page::before,
.contact-confirm-page::before {
    display: none;
}

.contact-completed-page::before {
    display: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.page-title {
    text-align: center;
    margin-bottom: 48px;
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    letter-spacing: -0.02em;
}

/* === WRAPPERS === */
.contact-form-wrapper,
.confirm-wrapper,
.completed-wrapper {
    background: rgba(255, 252, 254, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 
        0 25px 50px -12px rgba(251, 113, 133, 0.15),
        0 8px 25px rgba(236, 72, 153, 0.1),
        0 0 0 1px rgba(251, 207, 232, 0.3);
    position: relative;
    overflow: hidden;
}

/* === FORM STYLES === */
.oshiwaku-contact-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* 確認画面のスタイル */
.contact-confirm-page .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-confirm-page .page-title {
    text-align: center;
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
}

.confirm-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 30px;
}

.confirm-message {
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #e7f3ff;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

/* 確認画面の項目表示 */
.confirm-content {
    margin-bottom: 40px;
}

.confirm-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #007bff;
}

.confirm-label {
    font-weight: 600;
    color: #333;
    min-width: 150px;
    margin-right: 20px;
    flex-shrink: 0;
}

.confirm-value {
    color: #555;
    line-height: 1.6;
    flex: 1;
    word-wrap: break-word;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.confirm-back-button,
.confirm-submit-button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.confirm-back-button {
    background-color: #6c757d;
    color: white;
}

.confirm-back-button:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.confirm-submit-button {
    background-color: #007bff;
    color: white;
}

.confirm-submit-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.confirm-back-button:disabled,
.confirm-submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* === COMPLETED PAGE STYLES === */
.success-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.success-icon {
    text-align: center;
    margin: 0;
}

.success-icon .checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    animation: successPulse 2s ease-in-out infinite;
}

.success-icon svg {
    animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.main-message {
    text-align: left;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

.sub-message {
    text-align: center;
    color: #64748b;
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.notice {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #007cba;
    text-align: left;
    max-width: 500px;
    margin: 0 auto 40px;
}

.notice h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.notice ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notice li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.notice li:before {
    content: "•";
    color: #007cba;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.notice li:last-child {
    margin-bottom: 0;
}

.completed-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.completed-actions .btn {
    border: 2px solid #3498db !important;
}

.completed-actions .btn-primary {
    background-color: #3498db;
    color: white;
    border: 2px solid #3498db !important;
}

.completed-actions .btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ローディング表示 */
.loading-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1.1rem;
}

/* エラーメッセージ */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 20px;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* 成功メッセージ */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 20px;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* Contact Form 7基本スタイルのリセット */
.wpcf7 {
    margin: 0;
    padding: 0;
}

.wpcf7 form {
    margin: 0;
    padding: 0;
}

/* フォームラッパー */
.oshiwaku-contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* フォームグループ */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* ラベル */
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-label.required::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
}

/* 入力フィールド共通スタイル */
.form-control,
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="url"],
.wpcf7 textarea,
.wpcf7 select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.form-control:focus,
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

/* ラジオボタングループ */
/* ラジオボタングループの改良版 */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-top: 8px;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    line-height: 1.4;
    min-height: 20px;
    position: relative;
}

.radio-group input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 10px 0 0 !important;
    padding: 0 !important;
    border: 2px solid #ddd;
    border-radius: 50%;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    top: 1px;
}

.radio-group input[type="radio"]:checked {
    border-color: #3498db;
    background-color: #3498db;
}

.radio-group input[type="radio"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-group input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.radio-group input[type="radio"]:hover {
    border-color: #3498db;
}

/* 条件付きフィールド */
.conditional-fields {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.conditional-fields.hidden {
    display: none;
    opacity: 0;
    max-height: 0;
}

/* 送信ボタン */
.form-submit-group {
    text-align: center;
    margin-top: 32px;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.btn-primary,
.wpcf7 input[type="submit"] {
    background-color: #3498db;
    color: white;
    border: 2px solid #3498db;
}

.btn-primary:hover,
.wpcf7 input[type="submit"]:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary:active,
.wpcf7 input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
}

/* 進行状況バー */
.form-progress {
    width: 100%;
    height: 4px;
    background-color: #f0f0f0;
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

/* メッセージスタイル */
.oshiwaku-success-message,
.oshiwaku-error-message {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 6px;
    font-weight: 500;
}

.oshiwaku-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.oshiwaku-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Contact Form 7のメッセージスタイル */
.wpcf7-response-output {
    margin: 20px 0;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpcf7-mail-sent-ok {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
}

.wpcf7-mail-sent-ok::before {
    content: '✅';
    margin-right: 8px;
    font-size: 16px;
}

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

.wpcf7-validation-errors::before,
.wpcf7-mail-sent-ng::before {
    content: '❌';
    margin-right: 8px;
    font-size: 16px;
}

.wpcf7-spam-blocked {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
}

.wpcf7-spam-blocked::before {
    content: '🚫';
    margin-right: 8px;
    font-size: 16px;
}

/* Contact Form 7のフィールドエラー（.wpcf7-not-valid-tip） */
.wpcf7-not-valid-tip {
    color: #e74c3c !important;
    font-size: 14px !important;
    margin-top: 6px !important;
    margin-bottom: 8px !important;
    display: block !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

.wpcf7-not-valid-tip::before {
    content: '⚠️' !important;
    margin-right: 6px !important;
    font-size: 12px !important;
}

/* バリデーションエラーフィールド */
.wpcf7-not-valid {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.wpcf7-not-valid-tip {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

/* Contact Form 7 標準ラジオボタンの対応 - ボタンスタイル */
.wpcf7 .wpcf7-radio {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 20px;
    margin: 8px 0;
}

/* Contact Form 7のspanタグ（ラジオボタンコンテナ）のスタイル */
.radio-group .wpcf7-form-control-wrap {
    width: 100%;
    display: block;
    margin: 0 auto;
}

.radio-group .wpcf7-radio {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 20px;
}

.radio-group .wpcf7-list-item {
    width: auto;
    max-width: none;
    min-width: 180px;
    margin: 0 !important;
    display: inline-block;
    flex: 0 0 auto;
}

.radio-group .wpcf7-list-item input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.radio-group .wpcf7-list-item label {
    width: 100%;
    display: block;
    margin: 0;
    padding: 20px 32px;
    font-size: 17px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #2c3e50;
    border-radius: 12px;
    background-color: #ffffff;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: auto;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.radio-group .wpcf7-list-item label:hover {
    background-color: #ecf0f1;
    border-color: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.radio-group .wpcf7-list-item input[type="radio"]:checked + .wpcf7-list-item-label {
    background-color: #3498db;
    border-color: #3498db;
    color: #ffffff;
    font-weight: 600;
}

.radio-group .wpcf7-list-item input[type="radio"]:checked ~ * {
    background-color: #3498db !important;
    border-color: #3498db !important;
    color: #ffffff !important;
}

.radio-group .wpcf7-list-item:has(input[type="radio"]:checked) label {
    background-color: #3498db;
    border-color: #3498db;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.wpcf7 .wpcf7-list-item {
    display: inline-block !important;
    margin: 0 !important;
    line-height: 1.4;
    vertical-align: top;
    position: relative;
}

/* ラジオボタンを隠す */
.wpcf7 .wpcf7-list-item input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

/* ラベルをボタンスタイルに */
.wpcf7 .wpcf7-list-item label {
    display: inline-block;
    padding: 18px 36px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #2c3e50;
    border-radius: 12px;
    background-color: #ffffff;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    line-height: 1.4;
    min-width: 160px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    user-select: none;
    white-space: nowrap;
}

/* ホバー時のスタイル */
.wpcf7 .wpcf7-list-item label:hover {
    background-color: #ecf0f1;
    border-color: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 選択時のスタイル */
.wpcf7 .wpcf7-list-item input[type="radio"]:checked + label {
    background-color: #3498db;
    border-color: #3498db;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* フォーカス時のスタイル */
.wpcf7 .wpcf7-list-item input[type="radio"]:focus + label {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* アクティブ時のスタイル */
.wpcf7 .wpcf7-list-item label:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 旧スタイルのラジオボタンも同様に対応 */
.radio-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
    align-items: flex-start;
    margin-top: 8px;
}

/* radio-group内のspanタグのスタイル */
.radio-group span {
    width: 90%;
    max-width: 320px;
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

.radio-group label {
    display: inline-block;
    padding: 18px 36px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: 1px solid #2c3e50;
    border-radius: 12px;
    background-color: #ffffff;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    line-height: 1.4;
    min-width: 160px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.radio-group input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.radio-group label:hover {
    background-color: #ecf0f1;
    border-color: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.radio-group input[type="radio"]:checked + label,
.radio-group label:has(input[type="radio"]:checked) {
    background-color: #3498db;
    border-color: #3498db;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.radio-group input[type="radio"]:focus + label {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.radio-group label:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ラジオボタンのアニメーション効果 */
.wpcf7 .wpcf7-list-item label,
.radio-group label {
    position: relative;
    overflow: hidden;
}

.wpcf7 .wpcf7-list-item label::before,
.radio-group label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

.wpcf7 .wpcf7-list-item label:active::before,
.radio-group label:active::before {
    width: 120px;
    height: 120px;
}

/* 選択されたボタンの特別なスタイル */
.wpcf7 .wpcf7-list-item input[type="radio"]:checked + label::after,
.radio-group input[type="radio"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .wpcf7 .wpcf7-list-item label,
    .radio-group label {
        border-width: 2px;
    }
    
    .wpcf7 .wpcf7-list-item input[type="radio"]:checked + label,
    .radio-group input[type="radio"]:checked + label {
        border-color: #000;
        background-color: #000;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .wpcf7 .wpcf7-list-item label,
    .radio-group label {
        background-color: #2c3e50;
        color: #ecf0f1;
        border-color: #34495e;
    }
    
    .wpcf7 .wpcf7-list-item label:hover,
    .radio-group label:hover {
        background-color: #34495e;
        border-color: #5a6c7d;
    }
    
    .wpcf7 .wpcf7-list-item input[type="radio"]:checked + label,
    .radio-group input[type="radio"]:checked + label {
        background-color: #3498db;
        border-color: #3498db;
        color: #ffffff;
    }
}

/* チェックボックスの対応も追加 */
.wpcf7 .wpcf7-list-item input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 10px 0 0 !important;
    padding: 0 !important;
    border: 2px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    top: 1px;
}

.wpcf7 .wpcf7-list-item input[type="checkbox"]:checked {
    border-color: #3498db;
    background-color: #3498db;
}

.wpcf7 .wpcf7-list-item input[type="checkbox"]:checked::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wpcf7 .wpcf7-list-item input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.wpcf7 .wpcf7-list-item input[type="checkbox"]:hover {
    border-color: #3498db;
}

/* レスポンシブデザイン */
/* 中間サイズでのラジオボタン調整 */
@media (max-width: 900px) and (min-width: 769px) {
    .radio-group .wpcf7-list-item {
        min-width: 140px;
    }
    
    .radio-group .wpcf7-list-item label,
    .radio-group label,
    .wpcf7 .wpcf7-list-item label {
        padding: 16px 28px;
        font-size: 15px;
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .oshiwaku-contact-form-wrapper {
        padding: 16px;
        margin: 0 auto;
        width: 100%;
        max-width: calc(100% - 32px);
    }
    
    .radio-group {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        width: 100%;
        margin: 0 auto;
    }
    
    .radio-group .wpcf7-radio {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .radio-group .wpcf7-list-item {
        width: 90%;
        max-width: 320px;
        margin: 0 auto !important;
    }
    
    .radio-group .wpcf7-list-item label {
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .radio-group label {
        width: 90%;
        max-width: 320px;
        min-width: auto;
        text-align: center;
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 10px;
        margin: 0 auto;
        display: block;
    }
    
    .wpcf7 .wpcf7-radio {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        width: 100%;
        margin: 0 auto;
    }
    
    .wpcf7 .wpcf7-radio span {
        width: 90%;
        max-width: 320px;
        display: block;
        margin: 0 auto;
    }
    
    .wpcf7 .wpcf7-list-item {
        margin: 0 auto !important;
        width: 90%;
        max-width: 320px;
        display: block;
    }
    
    .wpcf7 .wpcf7-list-item label {
        width: 100%;
        min-width: auto;
        text-align: center;
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 10px;
        margin: 0 auto;
        display: block;
    }
    
    .form-control,
    .wpcf7 input[type="text"],
    .wpcf7 input[type="email"],
    .wpcf7 input[type="url"],
    .wpcf7 textarea {
        font-size: 16px; /* iOS Safari のズーム防止 */
    }
    
    .btn {
        width: 100%;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .form-control,
    .wpcf7 input[type="text"],
    .wpcf7 input[type="email"],
    .wpcf7 input[type="url"],
    .wpcf7 textarea {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    /* より小さい画面でのラジオボタン調整 */
    .radio-group label,
    .wpcf7 .wpcf7-list-item label {
        width: 95%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .radio-group,
    .wpcf7 .wpcf7-radio {
        padding: 0 5%;
    }
    
    .radio-group .wpcf7-list-item {
        width: 95%;
    }
    
    .radio-group .wpcf7-list-item label {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .wpcf7 .wpcf7-list-item {
        width: 95%;
    }
    
    .wpcf7 .wpcf7-radio span {
        width: 95%;
        padding: 0;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conditional-fields:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

/* フォーカス時のアクセシビリティ */
.form-control:focus,
.wpcf7 input:focus,
.wpcf7 textarea:focus,
.btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .form-control,
    .wpcf7 input,
    .wpcf7 textarea {
        border-width: 3px;
    }
    
    .btn-primary,
    .wpcf7 input[type="submit"] {
        border-width: 3px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .oshiwaku-contact-form-wrapper {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .form-label {
        color: #ecf0f1;
    }
    
    .form-control,
    .wpcf7 input,
    .wpcf7 textarea {
        background-color: #34495e;
        border-color: #5a6c7d;
        color: #ecf0f1;
    }
    
    .form-control:focus,
    .wpcf7 input:focus,
    .wpcf7 textarea:focus {
        border-color: #3498db;
        background-color: #3b4c63;
    }
} 