/* ==================== 共通スタイル ==================== */
:root {
    --arc9-primary: #4F46E5;
    --arc9-primary-dark: #4338CA;
    --arc9-secondary: #9333EA;
    --arc9-success: #10B981;
    --arc9-warning: #F59E0B;
    --arc9-danger: #EF4444;
    --arc9-gray: #6B7280;
    --arc9-light: #F9FAFB;
}

/* ==================== タイマー ==================== */
.arc9-timer {
    font-family: 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.arc9-timer.warning {
    animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ==================== プログレスバー ==================== */
.arc9-progress {
    transition: width 0.3s ease-in-out;
}

.arc9-progress-complete {
    background: linear-gradient(90deg, #10B981 0%, #059669 100%);
}

/* ==================== 質問カード ==================== */
.arc9-question {
    scroll-margin-top: 100px;
}

.arc9-question.answered {
    border-left: 4px solid var(--arc9-success);
}

.arc9-question.unanswered {
    border-left: 4px solid var(--arc9-gray);
}

/* ==================== ラジオボタン（7段階評価） ==================== */
.arc9-radio-group {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.arc9-radio-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    border: 2px solid #D1D5DB;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.arc9-radio-label:hover {
    border-color: var(--arc9-primary);
    background-color: #EEF2FF;
}

.arc9-radio-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.arc9-radio-input:checked + .arc9-radio-label {
    border-color: var(--arc9-primary);
    background-color: #EEF2FF;
    font-weight: 700;
    transform: scale(1.05);
}

.arc9-radio-input:focus + .arc9-radio-label {
    outline: 2px solid var(--arc9-primary);
    outline-offset: 2px;
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
    .arc9-radio-group {
        gap: 0.25rem;
    }

    .arc9-radio-label {
        height: 2.5rem;
        font-size: 0.875rem;
    }
}

/* ==================== タイプバッジ ==================== */
.arc9-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--arc9-primary) 0%, var(--arc9-secondary) 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ==================== スコアサークル ==================== */
.arc9-score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
            var(--arc9-primary) 0deg,
            var(--arc9-primary) calc(var(--score) * 3.6deg),
            #E5E7EB calc(var(--score) * 3.6deg),
            #E5E7EB 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.arc9-score-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
}

.arc9-score-value {
    position: relative;
    font-size: 2rem;
    font-weight: 700;
    color: var(--arc9-primary);
}

/* ==================== マッチング企業カード ==================== */
.arc9-company-card {
    transition: all 0.3s;
}

.arc9-company-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ==================== 強み・弱みリスト ==================== */
.arc9-strength-item {
    position: relative;
    padding-left: 1.5rem;
}

.arc9-strength-item::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--arc9-success);
    font-weight: 700;
}

.arc9-weakness-item {
    position: relative;
    padding-left: 1.5rem;
}

.arc9-weakness-item::before {
    content: '!';
    position: absolute;
    left: 0;
    color: var(--arc9-warning);
    font-weight: 700;
}

/* ==================== モーダル ==================== */
.arc9-modal {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.arc9-modal-content {
    animation: slideUp 0.3s ease-in-out;
}

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

/* ==================== ローディングスピナー ==================== */
.arc9-spinner {
    border: 3px solid rgba(79, 70, 229, 0.1);
    border-top-color: var(--arc9-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 診断完了アニメーション ==================== */
.arc9-complete-animation {
    animation: scaleIn 0.5s ease-in-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== ツールチップ ==================== */
.arc9-tooltip {
    position: relative;
}

.arc9-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.arc9-tooltip:hover::after {
    opacity: 1;
}

/* ==================== プリント用スタイル ==================== */
@media print {
    .arc9-no-print {
        display: none !important;
    }

    .arc9-print-break {
        page-break-after: always;
    }
}

/* ==================== ダークモード対応（オプション） ==================== */
@media (prefers-color-scheme: dark) {
    .arc9-dark-mode {
        --arc9-light: #1F2937;
        --arc9-gray: #9CA3AF;
    }
}

/* ==================== アクセシビリティ ==================== */
.arc9-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* フォーカス可視化 */
.arc9-focus-visible:focus-visible {
    outline: 2px solid var(--arc9-primary);
    outline-offset: 2px;
}

/* ==================== スムーススクロール ==================== */
html {
    scroll-behavior: smooth;
}

/* ==================== カスタムスクロールバー ==================== */
.arc9-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.arc9-scrollbar::-webkit-scrollbar-track {
    background: var(--arc9-light);
}

.arc9-scrollbar::-webkit-scrollbar-thumb {
    background: var(--arc9-gray);
    border-radius: 4px;
}

.arc9-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--arc9-primary);
}