/* ============================================================
   Enneagram Test — polza.com/money-test/
   ============================================================ */

@font-face {
    font-family: 'Gilroy';
    src: url('/resources/fonts/Gilroy-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('/resources/fonts/Gilroy-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('/resources/fonts/Gilroy-Semibold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('/resources/fonts/Gilroy-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

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

body {
    font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #212121;
    background: #f6f6f6;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ---- Container ---- */
.test-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* ---- Card ---- */
.card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 32px 28px;
    margin-bottom: 20px;
}

/* ---- Section visibility ---- */
.section { display: none; }
.section.active { display: block; }

/* ============================================================
   INTRO
   ============================================================ */
.intro-logo {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
}

.intro-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.2;
}

.intro-subtitle {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.5;
}

.intro-badge {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    margin-top: 16px;
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

.intro-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

.intro-stat {
    text-align: center;
}

.intro-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #00BFA5;
}

.intro-stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 2px;
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress-wrap {
    margin-bottom: 24px;
    text-align: center;
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.progress-step {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #00BFA5;
    width: 40px;
}

.progress-step.done {
    background: #00BFA5;
}

.progress-info {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

#progress-answered {
    color: #00BFA5;
    font-weight: 700;
}

/* ============================================================
   QUESTION BLOCK
   ============================================================ */
.question-block { display: none; }
.question-block.active { display: block; }

.question-card.highlight {
    background: #FFF9EC;
    border-radius: 12px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    transition: background 0.3s ease;
}

.question-card {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.question-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.question-number {
    font-weight: 700;
    color: #00BFA5;
}

.question-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 14px;
    color: #212121;
}

.question-answers {
    display: flex;
    gap: 10px;
}

.answer-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    font-family: 'Gilroy', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.answer-btn:hover {
    border-color: #bbb;
    background: #fafafa;
}

.answer-btn.selected-yes {
    border-color: #00BFA5;
    background: #E8FAF6;
    color: #00896B;
}

.answer-btn.selected-no {
    border-color: #E57373;
    background: #FFF5F5;
    color: #C62828;
}

.question-card.answered .question-text {
    color: #888;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Gilroy', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #263238;
    color: #fff;
}

.btn-primary:hover {
    background: #37474F;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #bbb;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #263238;
    color: #fff;
    border: none;
}

.btn-secondary:hover {
    background: #37474F;
    transform: translateY(-1px);
}

.nav-divider {
    height: 1px;
    background: #f0f0f0;
    margin-top: 24px;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.nav-buttons .btn {
    flex: 1;
}

.btn-back {
    background: transparent;
    color: #999;
    border: 2px solid #e0e0e0;
}

.btn-back:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* ============================================================
   RESULTS
   ============================================================ */
.results-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

/* Result header */
.result-header {
    text-align: center;
    padding: 32px 24px;
    margin-bottom: 16px;
    background: #263238;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
}

.result-name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Result content block */
.result-block {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0px 0px 1px rgba(12, 26, 75, 0.24), 0px 3px 8px -1px rgba(50, 50, 71, 0.05);
}

.result-block p {
    font-size: 15px;
    color: #364153;
    line-height: 1.7;
    margin-bottom: 12px;
}

.result-block p:last-child {
    margin-bottom: 0;
}

/* Strengths & Weaknesses grid */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.result-col {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0px 0px 1px rgba(12, 26, 75, 0.24), 0px 3px 8px -1px rgba(50, 50, 71, 0.05);
}

.result-col-strengths {
    border: 1px solid #00BFA5;
}

.result-col-weaknesses {
    border: 1px solid #E57373;
}

.result-col-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #263238;
}

.result-col-weaknesses .result-list-item::before {
    background: #E57373;
}

.result-list-item {
    font-size: 14px;
    color: #364153;
    line-height: 1.5;
    padding: 5px 0 5px 18px;
    position: relative;
}

.result-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 13px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00BFA5;
}

/* Advice block */
.result-advice {
    background: #FFF9EC;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border-left: 3px solid #FFB300;
    box-shadow: 0px 0px 1px rgba(12, 26, 75, 0.24), 0px 3px 8px -1px rgba(50, 50, 71, 0.05);
}

.result-advice-title {
    font-size: 14px;
    font-weight: 600;
    color: #263238;
    margin-bottom: 10px;
}

.result-advice-text {
    font-size: 15px;
    color: #364153;
    line-height: 1.7;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: #C62828;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #00BFA5;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.loading-text {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

.fade-in {
    animation: fadeIn 0.4s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .test-container {
        padding: 12px 8px 60px;
    }

    .card {
        padding: 24px 18px;
        border-radius: 16px;
    }

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

    .intro-stats {
        gap: 20px;
    }

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

    .results-title {
        font-size: 20px;
    }

    .result-name {
        font-size: 24px;
    }


    .result-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-block,
    .result-col,
    .result-advice {
        padding: 20px 16px;
    }
}
