/**
 * カードローン診断ツール スタイル（改修版）
 */

/* コンテナ */
.diagnosis-tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
.diagnosis-header {
    text-align: center;
    margin-bottom: 24px;
}

.diagnosis-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.diagnosis-subtitle {
    font-size: 16px;
    color: #666;
}

/* ================================================
   参照データ統計バナー
   ================================================ */
.reference-stats-banner {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.stats-banner-inner {
    text-align: center;
}

.stats-banner-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
}

.stats-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stats-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stats-label {
    font-size: 13px;
    color: #6b7280;
}

.stats-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
}

.stats-unit {
    font-size: 12px;
    color: #6b7280;
}

.stats-banner-note {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

@media (max-width: 600px) {
    .stats-items {
        gap: 8px;
    }

    .stats-item {
        padding: 6px 12px;
    }

    .stats-value {
        font-size: 16px;
    }

    .stats-label {
        font-size: 11px;
    }
}

/* ================================================
   フォームセクション
   ================================================ */
.diagnosis-form-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

/* ステップ */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c4a6e 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.15);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.step-title {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* オプションカード */
.form-options {
    display: grid;
    gap: 12px;
}

.priority-options {
    grid-template-columns: 1fr;
}

.employment-options,
.income-options,
.amount-options {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 600px) {
    .employment-options,
    .income-options,
    .amount-options {
        grid-template-columns: 1fr;
    }
}

.option-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
}

.option-card:hover .option-content {
    border-color: #93c5fd;
    background: #f8fafc;
}

.option-card input:checked + .option-content {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    color: #2563eb;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.option-desc {
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* コンパクトオプション */
.option-card.compact .option-content {
    padding: 16px 20px;
    flex-direction: row;
    justify-content: center;
}

.option-card.compact .option-title {
    margin-bottom: 0;
}

/* ナビゲーション */
.step-navigation {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
}

.btn-prev,
.btn-next,
.btn-submit {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-prev {
    background: #f3f4f6;
    color: #374151;
}

.btn-prev:hover {
    background: #e5e7eb;
}

.btn-next,
.btn-submit {
    background: #2563eb;
    color: #fff;
}

.btn-next:hover:not(:disabled),
.btn-submit:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-next:disabled,
.btn-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* プログレスバー */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.progress-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.progress-step.active {
    color: #fff;
    background: #2563eb;
}

.progress-step.completed {
    color: #fff;
    background: #10b981;
}

/* ================================================
   ローディング
   ================================================ */
.diagnosis-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ================================================
   結果セクション
   ================================================ */
.diagnosis-results {
    animation: fadeIn 0.4s ease-out;
}

.results-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c4a6e 100%);
    border-radius: 12px;
    color: #fff;
}

.results-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.results-subtitle {
    font-size: 22px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 16px;
}

.results-input-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.results-input-summary .summary-item {
    padding: 6px 14px;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
}

/* 結果用参照データ統計 */
.results-stats-summary {
    text-align: center;
    margin-bottom: 24px;
    padding: 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
}

.results-stats-text {
    font-size: 14px;
    color: #166534;
    margin: 0;
}

.results-stats-highlight {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
}

/* ================================================
   結果カード
   ================================================ */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.result-card[data-rank="1"] {
    border: 3px solid #fbbf24;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.25);
}

.result-card[data-rank="2"] {
    border: 2px solid #9ca3af;
}

.result-card[data-rank="3"] {
    border: 2px solid #d97706;
}

.result-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 20px 12px;
}

.result-card[data-rank="1"] .result-rank {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
}

.result-card[data-rank="2"] .result-rank {
    background: linear-gradient(135deg, #f3f4f6, #d1d5db);
}

.result-card[data-rank="3"] .result-rank {
    background: linear-gradient(135deg, #fef3c7, #f59e0b);
}

.rank-number {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.result-card[data-rank="1"] .rank-number {
    color: #b45309;
}

.result-card[data-rank="2"] .rank-number {
    color: #4b5563;
}

.result-card[data-rank="3"] .rank-number {
    color: #92400e;
}

.rank-label {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.result-card[data-rank="1"] .rank-label {
    color: #b45309;
}

.result-card[data-rank="2"] .rank-label {
    color: #4b5563;
}

.result-card[data-rank="3"] .rank-label {
    color: #92400e;
}

.result-content {
    flex: 1;
    padding: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.result-logo {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

.result-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.result-info {
    flex: 1;
}

.result-product-name {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.result-company-name {
    font-size: 13px;
    color: #666;
}

/* ================================================
   おすすめポイント（新デザイン）
   ================================================ */
.result-recommendation {
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.recommendation-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

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

.recommendation-point {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.recommendation-point:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recommendation-point:first-child {
    padding-top: 0;
}

.point-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.point-type-review .point-icon {
    background: #dbeafe;
    color: #2563eb;
}

.point-type-experience .point-icon {
    background: #dcfce7;
    color: #16a34a;
}

.point-type-interest .point-icon {
    background: #fef3c7;
    color: #d97706;
}

.point-type-spec .point-icon {
    background: #f3f4f6;
    color: #6b7280;
}

.point-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.point-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

/* ================================================
   データ根拠サマリー
   ================================================ */
.result-data-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f1f5f9;
    border-radius: 6px;
}

.data-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
}

.data-icon {
    display: flex;
    align-items: center;
    color: #94a3b8;
}

/* ================================================
   統計情報
   ================================================ */
.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .result-stats {
        grid-template-columns: 1fr;
    }
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.rating-stars {
    color: #fbbf24;
}

.rating-stars .star {
    font-size: 14px;
}

.rating-stars .star.filled {
    color: #fbbf24;
}

.rating-stars .star.half {
    color: #d1d5db;
}

.rating-number,
.approval-rate,
.interest-rate {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ================================================
   アクションボタン
   ================================================ */
.result-actions {
    display: flex;
    gap: 12px;
}

.btn-detail,
.btn-official {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-detail {
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #2563eb;
}

.btn-detail:hover {
    background: #dbeafe;
}

.btn-official {
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    font-size: 15px;
    padding: 14px 24px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-official:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}

/* ================================================
   参考口コミセクション
   ================================================ */
.sample-reviews-section {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.sample-reviews-title {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.sample-reviews-slider {
    position: relative;
    min-height: 60px;
}

.sample-review-item {
    display: none;
}

.sample-review-item.active {
    display: block;
}

.sample-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sample-review-user {
    font-size: 11px;
    color: #374151;
    font-weight: 500;
}

.sample-review-rating {
    font-size: 11px;
    color: #6b7280;
}

.sample-review-rating .stars-small {
    color: #fbbf24;
    margin-right: 4px;
}

.sample-review-comment {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
}

.sample-review-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.sample-review-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: background 0.2s;
}

.sample-review-dots .dot.active {
    background: #2563eb;
}

.sample-review-dots .dot:hover {
    background: #9ca3af;
}

/* ================================================
   YMYL免責文言
   ================================================ */
.ymyl-disclaimer {
    margin-top: 30px;
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
}

.ymyl-disclaimer p {
    font-size: 13px;
    color: #92400e;
    line-height: 1.6;
    margin: 0;
}

/* ================================================
   やり直しボタン
   ================================================ */
.results-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-restart {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-restart:hover {
    background: #e5e7eb;
}

/* ================================================
   エラー表示
   ================================================ */
.diagnosis-error {
    text-align: center;
    padding: 60px 20px;
}

.error-content {
    max-width: 400px;
    margin: 0 auto;
}

.error-text {
    font-size: 18px;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 8px;
}

.error-subtext {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* 結果なし */
.no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.no-results p {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
}

/* ================================================
   SP対応
   ================================================ */
@media (max-width: 600px) {
    .diagnosis-tool-container {
        padding: 16px;
    }

    .diagnosis-title {
        font-size: 22px;
    }

    .diagnosis-form-section {
        padding: 20px 16px;
    }

    .step-title {
        font-size: 15px;
        padding: 12px 14px;
    }

    .step-number {
        min-width: 40px;
        font-size: 16px;
        padding: 10px;
    }

    .option-content {
        padding: 16px;
    }

    .option-icon {
        width: 44px;
        height: 44px;
    }

    .option-icon svg {
        width: 24px;
        height: 24px;
    }

    .option-title {
        font-size: 14px;
    }

    .option-desc {
        font-size: 12px;
    }

    .btn-prev,
    .btn-next,
    .btn-submit {
        padding: 12px 24px;
        font-size: 14px;
    }

    .result-card {
        flex-direction: column;
    }

    .result-rank {
        flex-direction: row;
        min-width: auto;
        padding: 12px 20px;
        gap: 4px;
    }

    .rank-number {
        font-size: 22px;
    }

    .result-content {
        padding: 16px;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }

    .result-logo {
        width: 64px;
        height: 64px;
    }

    .result-product-name {
        font-size: 16px;
    }

    .result-actions {
        flex-direction: column;
    }

    .recommendation-point {
        flex-wrap: wrap;
    }

    .point-text {
        flex-basis: 100%;
        padding-left: 32px;
    }

    .result-data-summary {
        justify-content: center;
    }
}
