/* 
 * Conditional Form Section スタイル（完全自作版）
 * Yes/No条件分岐フォームセクション
 * プラグイン不要、バニラJavaScript + WordPress標準機能で実装
 */

.conditional-form {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

/* セクションヘッダー */
.conditional-form .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.conditional-form .section-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 16px;
    position: relative;
}

.conditional-form .section-title::after {
    content: '';
    position: absolute;
    top: -0.8rem;
    left: 50%;
    transform: translateX(-50%) skew(2deg);
    z-index: -1;
    background: url(../../images/decoration/decoration-line.svg) no-repeat center center / 100% 100%;
    width: 18.75rem;
    height: 7.5rem;
}

.conditional-form .section-title .highlight {
    position: relative;
    z-index: 0;
    font-size: 3rem;
    color: var(--active-color);
}

.conditional-form .section-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 診断フォームコンテナ */
.diagnosis-form-container {
    max-width: 800px;
    margin: 0 auto 80px;
}

.diagnosis-form {
    background: white;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.diagnosis-form::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--main-color), var(--active-color));
    border-radius: 12px;
    z-index: -1;
}

/* 進捗バー */
.progress-container {
    margin-bottom: 40px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--active-color), var(--main-color));
    border-radius: 4px;
    width: 25%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* フォームステップ */
.form-step {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.step-title {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 30px;
    text-align: center;
}

/* フォームグリッド（基本情報用） */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    position: relative;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group label.required::after {
    content: ' *';
    color: #dc3545;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--active-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

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

/* 質問コンテナ */
.question-container {
    text-align: center;
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: 500;
}

/* ラジオボタングループ */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
    position: relative;
}

.radio-option:hover {
    border-color: var(--active-color);
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.1);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--active-color);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

.radio-option input[type="radio"]:checked+.radio-custom {
    border-color: var(--active-color);
}

.radio-option input[type="radio"]:checked+.radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-option input[type="radio"]:checked~.radio-text {
    color: var(--active-color);
    font-weight: 600;
}

.radio-text {
    font-size: 1.1rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* ナビゲーションボタン */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background: var(--active-color);
    color: white;
}

.btn-primary:hover {
    background: var(--main-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 診断結果表示エリア */
.diagnosis-result {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.result-header h3 {
    color: var(--active-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.recommended-plan {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.plan-badge {
    background: var(--active-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-color);
}

.result-content {
    line-height: 1.6;
    color: var(--text-color);
}

.result-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    text-align: center;
    color: #6c757d;
}

.result-benefits,
.result-recommendation,
.result-next-action {
    margin-bottom: 30px;
}

.result-benefits h4,
.result-recommendation h4,
.result-next-action h4 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-left: 3px solid var(--active-color);
    padding-left: 15px;
}

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

.benefits-list li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.benefits-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--active-color);
    font-weight: bold;
}

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

.action-buttons .btn {
    flex: 1;
    max-width: 230px;
}

/* バリデーションエラー用スタイル */
.validation-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    text-align: center;
    animation: fadeInError 0.3s ease;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    .conditional-form {
        padding: 60px 3%;
    }

    .conditional-form .section-title {
        font-size: 2rem;
    }

    .conditional-form .section-title .highlight {
        font-size: 2.5rem;
    }

    .diagnosis-form {
        padding: 30px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .radio-group {
        gap: 15px;
    }

    .radio-option {
        padding: 15px 20px;
    }

    .form-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .conditional-form .section-title {
        font-size: 1.8rem;
    }

    .conditional-form .section-title .highlight {
        font-size: 2.2rem;
    }

    .diagnosis-form {
        padding: 20px 15px;
    }

    .step-title {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .radio-option {
        padding: 12px 15px;
    }

    .radio-text {
        font-size: 1rem;
    }
}