/* =====================================================
   「なんとなく不調」の正体診断 (WD8)
   ブランドパレット:
     亜麻白  #F5F0E8 (背景)
     深墨    #2C3E3A (テキスト・主調)
     温朱    #C46B5A (アクセント・体質)
     苔青磁  #7E9B8A (サブ・経路)
     LINE緑  #06C755 (LINE CTAのみ)
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-bg: #F5F0E8;        /* 亜麻白 */
    --brand-ink: #2C3E3A;       /* 深墨 */
    --brand-accent: #C46B5A;    /* 温朱 */
    --brand-sub: #7E9B8A;       /* 苔青磁 */
    --line-green: #06C755;
    --line-green-dark: #05A648;
    --text-dark: #2C3E3A;
    --text-light: #6B7570;
    --bg-card: #FFFFFF;
    --border-color: #E2DCD1;
    --warning-color: #B03A2E;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--brand-bg);
    overflow-x: hidden;
}

/* ===== 画面管理 ===== */
.screen {
    display: none !important;
    position: relative;
    min-height: 100vh;
    padding: 24px 20px 48px;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block !important;
    z-index: 10;
}

.screen:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

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

/* ===== ローディング / エラー ===== */
#loading {
    display: none !important;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--brand-bg);
    z-index: 9999;
}
#loading.active { display: flex !important; }

.loader {
    width: 48px; height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--brand-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading p { margin-top: 20px; color: var(--text-light); }

#error {
    display: none !important;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    justify-content: center;
    align-items: center;
    background: var(--brand-bg);
    z-index: 9999;
}
#error.active { display: flex !important; }

.error-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(44, 62, 58, 0.1);
}
.error-content h2 { color: var(--warning-color); margin-bottom: 15px; }
.error-content button {
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--brand-ink);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* ===== ヘッダー ===== */
.header {
    text-align: center;
    margin-bottom: 28px;
}
.brand-label {
    display: inline-block;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--brand-sub);
    border: 1px solid var(--brand-sub);
    border-radius: 999px;
    padding: 4px 16px;
    margin-bottom: 14px;
}
.header h1 {
    font-size: 26px;
    line-height: 1.5;
    color: var(--brand-ink);
    margin-bottom: 6px;
    font-weight: 700;
}
.header h2 {
    font-size: 16px;
    color: var(--brand-accent);
    font-weight: normal;
    letter-spacing: 0.06em;
}

/* ===== コンテンツ領域 ===== */
.content {
    max-width: 600px;
    margin: 0 auto;
}

/* ===== ボックス ===== */
.intro-box,
.result-box,
.cta-box,
.notice-box {
    background: var(--bg-card);
    padding: 22px;
    border-radius: 14px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(44, 62, 58, 0.06);
}

.intro-text {
    font-size: 16px;
    line-height: 1.9;
    margin-bottom: 20px;
}

.feature-list { list-style: none; }
.feature-list li {
    padding: 7px 0;
    font-size: 15px;
    color: var(--text-dark);
}

/* ===== 注意事項 ===== */
.notice-box {
    border-left: 4px solid var(--warning-color);
}
.notice-box h3, .notice-box h4 {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--warning-color);
}
.notice-text, .notice-box p {
    font-size: 14px;
    line-height: 1.8;
}
.safety-details { margin-top: 14px; cursor: pointer; }
.safety-details summary {
    font-weight: bold;
    color: var(--brand-ink);
    padding: 10px 14px;
    background: var(--brand-bg);
    border-radius: 8px;
    user-select: none;
    font-size: 14px;
}
.safety-content { padding: 15px 5px 5px; font-size: 14px; }
.safety-content ul { margin: 10px 0; padding-left: 20px; }
.safety-content li { margin: 5px 0; }

/* ===== ボタン ===== */
.primary-btn,
.secondary-btn {
    display: block;
    width: 100%;
    padding: 17px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.04em;
}
.primary-btn {
    background: var(--brand-accent);
    color: #fff;
}
.primary-btn:hover {
    background: #B25B4A;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(196, 107, 90, 0.35);
}
.secondary-btn {
    background: var(--bg-card);
    color: var(--brand-ink);
    border: 2px solid var(--brand-ink);
    margin-top: 15px;
}
.secondary-btn:hover { background: var(--brand-bg); }

/* ===== 進捗バー ===== */
.progress-bar {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 28px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-sub), var(--brand-accent));
    transition: width 0.3s ease;
    width: 0%;
}

/* ===== クイズ画面 ===== */
.quiz-header {
    text-align: center;
    margin-bottom: 20px;
}
.question-number {
    display: inline-block;
    padding: 7px 18px;
    background: var(--brand-ink);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.08em;
}
.question-content {
    max-width: 600px;
    margin: 0 auto;
}
.question-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 22px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(44, 62, 58, 0.06);
    line-height: 1.6;
    color: var(--brand-ink);
}

/* ===== 選択肢 ===== */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.option-btn {
    padding: 17px 18px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.6;
    color: var(--text-dark);
}
.option-btn:hover {
    border-color: var(--brand-accent);
    background: #FBF6F0;
    transform: translateX(4px);
}
.option-btn:active { transform: scale(0.98); }
.option-label {
    display: inline-block;
    width: 28px; height: 28px;
    line-height: 28px;
    text-align: center;
    background: var(--brand-sub);
    color: #fff;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: bold;
    font-size: 13px;
}

/* ===== 結果画面 ===== */
.result-box h3 {
    font-size: 17px;
    margin-bottom: 15px;
    color: var(--brand-ink);
    border-bottom: 2px solid var(--brand-accent);
    padding-bottom: 8px;
}

.constitution-types {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.constitution-tag {
    display: inline-block;
    padding: 13px 20px;
    background: var(--brand-accent);
    color: #fff;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    line-height: 1.5;
}
.constitution-tag.sub {
    background: var(--brand-sub);
    font-size: 14px;
}

.reasoning-list,
.selfcare-list {
    list-style: none;
    padding-left: 0;
}
.reasoning-list li,
.selfcare-list li {
    padding: 11px 0 11px 25px;
    position: relative;
    line-height: 1.8;
    border-bottom: 1px solid var(--brand-bg);
    font-size: 14.5px;
}
.reasoning-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--brand-accent);
    font-weight: bold;
}
.selfcare-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--brand-sub);
    font-weight: bold;
}
.selfcare-list li.selfcare-warning { color: var(--warning-color); }
.selfcare-list li.selfcare-warning:before { content: ""; }

/* ===== LINE CTA(メインコンバージョン) ===== */
.cta-box {
    background: linear-gradient(135deg, #F0F7F1, #EAF4EC);
    border: 2px solid var(--line-green);
}
.cta-box h3 {
    color: var(--line-green-dark);
    border-bottom: none;
    font-size: 17px;
    margin-bottom: 12px;
}
.cta-details { margin: 12px 0 18px; }
.cta-details p {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--brand-ink);
}
.cta-details ul { list-style: none; padding-left: 0; }
.cta-details li {
    padding: 4px 0 4px 18px;
    position: relative;
    font-size: 14px;
}
.cta-details li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--line-green);
    font-weight: bold;
}
.line-cta-btn {
    display: block;
    width: 100%;
    padding: 18px;
    font-size: 17px;
    font-weight: bold;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    background: var(--line-green);
    color: #fff;
    transition: all 0.25s ease;
    letter-spacing: 0.04em;
    box-shadow: 0 3px 10px rgba(6, 199, 85, 0.3);
}
.line-cta-btn:hover {
    background: var(--line-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(6, 199, 85, 0.4);
}
.cta-note {
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ===== ハイライトボックス ===== */
.highlight {
    background: #FBF6EC;
    border-left: 4px solid var(--brand-accent);
}
.highlight p {
    font-size: 14.5px;
    line-height: 1.8;
    margin-bottom: 8px;
}

/* ===== フッター ===== */
.footer-message {
    text-align: center;
    margin: 28px 0 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 14px;
}
.footer-message p {
    margin: 8px 0 14px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
}
.signature {
    display: inline-block;
    font-weight: bold;
    color: var(--brand-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--brand-accent);
    padding-bottom: 2px;
}
.signature:hover { color: var(--brand-accent); }

.result-legal {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-light);
    line-height: 1.7;
    padding: 10px 6px 0;
}

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
    .screen { padding: 18px 15px 40px; }
    .header h1 { font-size: 22px; }
    .header h2 { font-size: 14px; }
    .question-text { font-size: 16px; padding: 16px; }
    .option-btn { font-size: 14px; padding: 15px; }
    .intro-box, .result-box, .cta-box, .notice-box { padding: 17px; }
}
