/* ========== Reset & Base ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Meiryo', sans-serif;
    color: #333;
    background: #faf8f5;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Container ========== */
.diagnosis-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    min-height: 100vh;
}

/* ========== Screen Transitions ========== */
.screen {
    animation: fadeIn 0.3s ease;
}

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

[x-cloak] { display: none !important; }

/* ========== Intro Screen ========== */
.intro-screen {
    text-align: center;
    padding: 60px 0 40px;
}

.intro-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 20px;
    line-height: 1.4;
}

.intro-description {
    font-size: 15px;
    color: #555;
    margin-bottom: 24px;
    line-height: 1.8;
}

.intro-note {
    font-size: 13px;
    color: #888;
    margin-bottom: 40px;
}

/* ========== Buttons ========== */
.btn-primary {
    display: inline-block;
    width: 100%;
    max-width: 300px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #6b8f5e;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: #5a7d4e;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== Quiz Screen ========== */
.quiz-screen {
    padding: 20px 0;
}

/* Progress */
.progress-section {
    margin-bottom: 28px;
}

.progress-text {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
    text-align: center;
}

.progress-bar {
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: #6b8f5e;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Question */
.question-text {
    font-size: 18px;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 24px;
    line-height: 1.5;
    text-align: center;
}

/* Choices */
.choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
    min-height: 52px;
    font-family: inherit;
}

.choice-btn:hover {
    border-color: #b8d4a8;
    background: #f8fbf6;
}

.choice-btn:active,
.choice-btn.selected {
    border-color: #6b8f5e;
    background: #eef5ea;
    transform: scale(0.98);
}

.choice-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

/* Quiz Nav (Back Button) */
.quiz-nav {
    margin-top: 20px;
    text-align: center;
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    font-size: 13px;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-back:hover {
    color: #555;
}

.btn-back:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ========== Result Screen ========== */
.result-screen {
    padding: 20px 0;
}

.result-type-badge {
    text-align: center;
    font-size: 13px;
    color: #6b8f5e;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.result-type-name {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8e8e8;
}

/* Result Sections */
.result-section {
    margin-bottom: 24px;
}

.result-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #6b8f5e;
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 3px solid #6b8f5e;
}

.result-text {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

.result-features {
    list-style: none;
    padding: 0;
}

.result-features li {
    font-size: 14px;
    color: #555;
    padding: 6px 0 6px 20px;
    position: relative;
    line-height: 1.6;
}

.result-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    background: #b8d4a8;
    border-radius: 50%;
}

/* Action & Salon boxes */
.result-action-box {
    background: #f0f5ed;
    border-radius: 12px;
    padding: 16px;
}

.result-action-box .result-section-title {
    border-left: none;
    padding-left: 0;
    color: #4a7c3f;
}

.result-salon-box {
    background: #f5f3ef;
    border-radius: 12px;
    padding: 16px;
}

.result-salon-box .result-section-title {
    border-left-color: #9e8b70;
    color: #7a6b55;
}

.salon-bridge-text {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin: 16px 0 32px;
    line-height: 1.7;
}

/* ========== Product Section ========== */
.result-products {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
}

.product-section-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    line-height: 1.7;
}

.product-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
}

.product-image {
    margin-bottom: 12px;
    text-align: center;
}

.product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.product-note {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.product-link {
    display: inline-block;
    font-size: 14px;
    color: #4a7c59;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.product-link:hover {
    color: #3a6347;
}

.product-disclaimer {
    font-size: 12px;
    color: #aaa;
    margin-top: 16px;
    line-height: 1.7;
}

/* ========== Result Actions ========== */
.result-actions {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e8e8e8;
    text-align: center;
}

.btn-restart {
    display: inline-block;
    width: 100%;
    max-width: 300px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #6b8f5e;
    background: #fff;
    border: 2px solid #6b8f5e;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

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

.btn-restart:active {
    transform: scale(0.97);
}

/* Share */
.share-section {
    margin-top: 24px;
}

.share-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-share {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.btn-share-x {
    color: #fff;
    background: #1d9bf0;
}

.btn-share-x:hover {
    background: #1a8cd8;
}

.btn-share-copy {
    color: #555;
    background: #f0f0f0;
}

.btn-share-copy:hover {
    background: #e5e5e5;
}

/* ========== Loading ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 248, 245, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8e8;
    border-top-color: #6b8f5e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== Footer ========== */
.site-footer {
    text-align: center;
    padding: 24px 16px 40px;
    font-size: 11px;
    color: #aaa;
    line-height: 1.8;
    max-width: 480px;
    margin: 0 auto;
}

/* ========== Desktop ========== */
@media (min-width: 768px) {
    .diagnosis-container {
        max-width: 560px;
        padding: 40px 32px 60px;
    }

    .intro-title {
        font-size: 28px;
    }

    .question-text {
        font-size: 20px;
    }

    .product-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .site-footer {
        max-width: 560px;
    }
}
