/**
 * AI Concierge - IRサイト風 診断UI v11.0
 * 金融信頼性デザイン + 補助金図鑑統一
 * 
 * @version 11.0.0
 */

/* 共通スタイルをインポート */
@import url('./grant-common.css');

/* =============================================================================
   診断コンテナ
   ============================================================================= */

.gip-diagnosis {
    max-width: 900px;
    margin: 0 auto;
    font-family: var(--gi-font-sans);
    color: var(--gi-gray-900);
    background: var(--gi-white);
}

/* =============================================================================
   診断ヘッダー
   ============================================================================= */

.gip-diagnosis-header {
    background: var(--gi-white);
    border-bottom: 1px solid var(--gi-gray-200);
    padding: 24px;
}

.gip-diagnosis-title-area {
    text-align: center;
    margin-bottom: 24px;
}

.gip-diagnosis-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--gi-font-serif);
    font-size: 14px;
    color: var(--gi-gray-600);
    margin-bottom: 8px;
}

.gip-diagnosis-logo svg {
    width: 20px;
    height: 20px;
    color: var(--gi-accent);
}

.gip-diagnosis-main-title {
    font-family: var(--gi-font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--gi-gray-900);
    margin: 0;
}

.gip-diagnosis-subtitle {
    font-size: 14px;
    color: var(--gi-gray-500);
    margin-top: 8px;
}

/* =============================================================================
   診断ステップ（白基調）
   ============================================================================= */

.gip-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 0 24px;
}

.gip-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 48px;
    right: 48px;
    height: 2px;
    background: var(--gi-gray-200);
    z-index: 0;
}

.gip-steps::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 48px;
    height: 2px;
    background: var(--gi-accent);
    z-index: 1;
    width: var(--progress-width, 0%);
    max-width: calc(100% - 96px);
    transition: width 0.5s ease;
}

.gip-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 100px;
}

.gip-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gi-white);
    border: 2px solid var(--gi-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--gi-gray-400);
    transition: all 0.3s ease;
}

.gip-step.active .gip-step-circle {
    background: var(--gi-accent);
    border-color: var(--gi-accent);
    color: var(--gi-white);
    box-shadow: 0 0 0 4px rgba(0, 135, 90, 0.15);
}

.gip-step.completed .gip-step-circle {
    background: var(--gi-accent);
    border-color: var(--gi-accent);
    color: var(--gi-white);
}

.gip-step.completed .gip-step-num {
    display: none;
}

.gip-step.completed .gip-step-circle::after {
    content: '✓';
    font-size: 14px;
}

.gip-step-label {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--gi-gray-500);
    text-align: center;
}

.gip-step.active .gip-step-label,
.gip-step.completed .gip-step-label {
    color: var(--gi-gray-900);
    font-weight: 600;
}

/* =============================================================================
   信頼性バナー
   ============================================================================= */

.gip-trust-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 16px;
    background: var(--gi-gray-50);
    border: 1px solid var(--gi-gray-200);
    border-radius: var(--gi-radius);
    margin: 20px 0;
    flex-wrap: wrap;
}

.gip-trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gi-gray-600);
}

.gip-trust-item svg {
    width: 14px;
    height: 14px;
    color: var(--gi-accent);
}

.gip-trust-value {
    font-weight: 700;
    color: var(--gi-gray-900);
}

/* =============================================================================
   チャットエリア
   ============================================================================= */

.gip-chat-area {
    padding: 24px;
    background: var(--gi-white);
}

.gip-message {
    margin-bottom: 20px;
    animation: gipSlideIn 0.3s ease;
}

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

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

.gip-message-bot {
    padding: 20px;
    background: var(--gi-gray-50);
    border-radius: var(--gi-radius);
    border: 1px solid var(--gi-gray-200);
}

.gip-message-bubble {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gi-gray-800);
    white-space: pre-wrap;
}

.gip-message-user {
    display: flex;
    justify-content: flex-end;
}

.gip-message-user .gip-message-bubble {
    display: inline-block;
    padding: 12px 18px;
    background: var(--gi-primary);
    color: var(--gi-white);
    border-radius: var(--gi-radius-lg);
    max-width: 80%;
}

/* =============================================================================
   オプションボタン
   ============================================================================= */

.gip-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.gip-option-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-200);
    border-radius: var(--gi-radius);
    color: var(--gi-gray-800);
    cursor: pointer;
    transition: all var(--gi-transition);
    font-family: inherit;
}

.gip-option-btn:hover {
    background: var(--gi-gray-50);
    border-color: var(--gi-accent);
}

.gip-option-btn:active {
    transform: scale(0.99);
}

.gip-option-btn.selected {
    background: var(--gi-accent);
    border-color: var(--gi-accent);
    color: var(--gi-white);
}

/* =============================================================================
   セレクトボックス
   ============================================================================= */

.gip-select-wrap {
    margin-top: 16px;
}

.gip-select {
    width: 100%;
    padding: 14px 44px 14px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid var(--gi-gray-200);
    border-radius: var(--gi-radius);
    background: var(--gi-white);
    cursor: pointer;
    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='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: all var(--gi-transition);
}

.gip-select:focus {
    outline: none;
    border-color: var(--gi-accent);
    box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.1);
}

/* =============================================================================
   インライン入力
   ============================================================================= */

.gip-input-inline {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.gip-inline-input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--gi-gray-200);
    border-radius: var(--gi-radius);
    font-size: 16px;
    font-family: inherit;
    transition: all var(--gi-transition);
}

.gip-inline-input:focus {
    outline: none;
    border-color: var(--gi-accent);
    box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.1);
}

.gip-inline-submit {
    padding: 14px 24px;
    background: var(--gi-accent);
    color: var(--gi-white);
    border: none;
    border-radius: var(--gi-radius);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--gi-transition);
}

.gip-inline-submit:hover {
    background: var(--gi-accent-light);
}

/* =============================================================================
   ヒント
   ============================================================================= */

.gip-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--gi-gray-500);
}

.gip-hint-important {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 0 var(--gi-radius) var(--gi-radius) 0;
    font-size: 14px;
    font-weight: 500;
    color: #92400e;
}

/* =============================================================================
   タイピングインジケーター
   ============================================================================= */

.gip-typing {
    display: flex;
    gap: 6px;
    padding: 12px 0;
}

.gip-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gi-gray-400);
    border-radius: 50%;
    animation: gipTyping 1.2s infinite;
}

.gip-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.gip-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes gipTyping {

    0%,
    60%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.gip-loading-text {
    font-size: 13px;
    color: var(--gi-gray-600);
    margin-top: 8px;
}

/* =============================================================================
   結果エリア
   ============================================================================= */

.gip-results {
    padding: 24px;
    background: var(--gi-white);
}

.gip-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gi-gray-200);
}

.gip-results-title {
    font-family: var(--gi-font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--gi-gray-900);
    margin: 0;
}

/* =============================================================================
   戻るボタン
   ============================================================================= */

.gip-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin-top: 12px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-300);
    border-radius: var(--gi-radius);
    font-size: 13px;
    color: var(--gi-gray-600);
    cursor: pointer;
    transition: all var(--gi-transition);
}

.gip-back-btn:hover {
    background: var(--gi-gray-50);
    border-color: var(--gi-gray-400);
}

/* =============================================================================
   モバイル対応
   ============================================================================= */

@media (max-width: 768px) {
    .gip-diagnosis-header {
        padding: 16px;
    }

    .gip-diagnosis-main-title {
        font-size: 20px;
    }

    .gip-steps {
        padding: 0 12px;
    }

    .gip-step-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .gip-step-label {
        font-size: 9px;
    }

    .gip-trust-bar {
        flex-direction: column;
        gap: 8px;
    }

    .gip-chat-area {
        padding: 16px;
    }

    .gip-message-bot {
        padding: 16px;
    }

    .gip-input-inline {
        flex-direction: column;
    }

    .gip-select,
    .gip-inline-input {
        font-size: 16px !important;
    }
}

/* =============================================================================
   GIP Chat Completion UI (Diagnosis Result) - Added v7.3.1
   ============================================================================= */
.gip-completion-hero {
    text-align: center;
    padding: 32px;
    margin-bottom: 24px;
    background: #111827 !important; /* Tailwind gray-900 */
    border-radius: 12px;
    color: #fff !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.gip-completion-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.gip-completion-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2); 
    color: #10b981; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 10;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.gip-completion-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 3;
}

.gip-completion-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff !important;
    margin: 0 0 8px 0;
    font-family: inherit;
}

.gip-message-content .gip-completion-title {
    color: #fff !important;
}

.gip-completion-message {
    font-size: 15px;
    color: #9ca3af !important; /* Gray-400 */
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.gip-completion-count {
    font-size: 22px;
    font-weight: 700;
    color: #10b981; /* Green */
    margin: 0 4px;
}

.gip-completion-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.gip-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gip-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff !important;
    line-height: 1;
    margin-bottom: 4px;
    font-family: inherit;
}

.gip-stat-label {
    font-size: 11px;
    color: #9ca3af;
}

.gip-stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
}

.gip-report-action {
    width: 100%;
    margin-bottom: 0;
}

.gip-btn-show-report {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #10b981 !important; /* Emerald 500 */
    color: #fff !important;
    font-weight: 700;
    font-size: 16px;
    padding: 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.gip-btn-show-report:hover {
    background: #059669 !important; /* Emerald 600 */
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}