@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Shippori+Mincho:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --primary-color: #0f766e;     /* teal-700 */
    --primary-light: #14b8a6;     /* teal-500 */
    --primary-dark: #115e59;      /* teal-800 */
    --secondary-color: #334155;   /* slate-700 */
    --accent-color: #d97706;      /* amber-600 */
    --bg-color: #f8fafc;          /* slate-50 */
    --card-bg: #ffffff;
    --text-main: #1e293b;         /* slate-800 */
    --text-muted: #64748b;        /* slate-500 */
    --border-color: #e2e8f0;      /* slate-200 */
    
    --font-serif: 'Shippori Mincho', 'Playfair Display', serif;
    --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Base Styles */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* -----------------------------
   Site Icon System (SVG)
   ----------------------------- */
.pt-icon {
    width: 1.2em;
    height: 1.2em;
    display: inline-block;
    vertical-align: -0.2em;
    color: currentColor;
}
.pt-icon :where(path, circle, rect, line, polyline, polygon, ellipse) {
    stroke: currentColor;
    fill: none;
}
.pt-icon :where(path[fill="currentColor"], circle[fill="currentColor"], rect[fill="currentColor"]) {
    fill: currentColor;
    stroke: none;
}
.pt-icon--sm { width: 1em; height: 1em; }
.pt-icon--md { width: 1.25em; height: 1.25em; }
.pt-icon--lg { width: 1.6em; height: 1.6em; }
.pt-icon--xl { width: 2em; height: 2em; }

.pt-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.9rem;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.18);
    color: var(--primary-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    letter-spacing: 0.025em;
}

/* Typography Enhancements */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

/* -----------------------------
   AI Markdown (results page)
   ----------------------------- */
.ai-markdown.markdown-body {
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.8;
    padding: 0;
}

.ai-markdown.markdown-body h1,
.ai-markdown.markdown-body h2,
.ai-markdown.markdown-body h3 {
    font-family: var(--font-serif);
    color: var(--primary-dark);
    border-bottom: 2px solid rgba(20, 184, 166, 0.2);
    padding-bottom: 0.3em;
    margin-top: 1.5em;
    font-weight: 700;
}

.ai-markdown.markdown-body h2 { font-size: 1.5rem; }
.ai-markdown.markdown-body h3 { font-size: 1.25rem; }

.ai-markdown.markdown-body blockquote {
    color: var(--secondary-color);
    border-left: 4px solid var(--primary-light);
    background: rgba(20, 184, 166, 0.05);
    padding: 1rem 1.5rem;
    border-radius: 0 0.75rem 0.75rem 0;
    font-style: italic;
    margin: 1.5rem 0;
}

.ai-markdown.markdown-body strong {
    color: var(--primary-dark);
    font-weight: 700;
}

.ai-markdown.markdown-body ul, .ai-markdown.markdown-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.ai-markdown.markdown-body li {
    margin-bottom: 0.5rem;
}

.ai-markdown.markdown-body code {
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-dark);
    border-radius: 0.4rem;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Question Card Design */
.question-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.question-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
    border-color: rgba(20, 184, 166, 0.3);
}

.question-card.answered {
    border-left: 6px solid var(--primary-color);
    background: linear-gradient(to right bottom, #ffffff, #f0fdfa);
}

/* Question Header */
.question-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.question-number-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 1rem;
    padding: 0.5rem 0;
    width: 60px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    flex-shrink: 0;
}

.question-number {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: block;
    line-height: 1;
}

.question-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 0.2rem;
}

.question-text {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.6;
    flex: 1;
    min-width: 0; /* flex内で極端に潰れたりレイアウト崩れしないように */
    margin: 0;
    padding-top: 0.2rem;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.option-label {
    display: block;
    cursor: pointer;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.option-label:hover {
    border-color: var(--primary-light);
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.option-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
}

.option-emoji {
    font-size: 1.5rem;
    filter: grayscale(0.2);
    transition: transform 0.2s ease;
}

.option-label:hover .option-emoji {
    transform: scale(1.1);
    filter: grayscale(0);
}

.option-text {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
}

.option-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: white;
}

.check-icon {
    width: 14px;
    height: 14px;
    color: white;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Selected State */
.option-input:checked + .option-label {
    border-color: var(--primary-color);
    background: #f0fdfa;
    box-shadow: 0 0 0 1px var(--primary-color), var(--shadow-sm);
}

.option-input:checked + .option-label .option-text {
    color: var(--primary-dark);
    font-weight: 600;
}

.option-input:checked + .option-label .option-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-input:checked + .option-label .check-icon {
    transform: scale(1);
}

/* Answered Indicator */
.answer-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-light);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.answer-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Spinner */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(15, 118, 110, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
    margin-bottom: 2rem;
}

.loading-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

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

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.animate-bounce-in {
    animation: bounceIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

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

/* Scroll Animations */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Interactive Elements */
button {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .question-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .question-header {
        gap: 1rem;
        align-items: center;
        flex-wrap: wrap; /* スマホではバッジ等で本文が潰れないよう折り返す */
    }
    
    .question-number-badge {
        padding: 0.35rem 0;
        width: 50px;
    }
    
    .question-number { font-size: 1.25rem; }
    
    .question-text {
        font-size: 1.15rem;
        flex: 1 1 calc(100% - 60px);
        min-width: 0;
    }

    /* スマホでは「回答済み」バッジを下段に回し、未表示時は幅を取らせない */
    .answer-indicator {
        order: 3;
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        display: none; /* show時だけ表示 */
    }
    .answer-indicator.show {
        display: inline-flex;
    }
    
    .option-content {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .option-emoji { font-size: 1.25rem; }
    
    .option-text { font-size: 1rem; }
}
