/* Enhanced step styling */
.enhanced-step {
    max-width: 520px;
    margin: 2.5rem auto;
    padding: 2.8rem 2.2rem;
    text-align: center;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.question-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1f2f5d;
    margin-bottom: 1.6rem;
    line-height: 1.4;
}

.thank-you-text {
    margin-bottom: 2rem;
    color: #1f2f5d;
    font-size: 1.05rem;
}

.input-wrapper {
    margin-bottom: 2rem;
}

.question-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid #cdd2e1;
    background: #f7f8fc;
    font-size: 1rem;
    color: #1f2f5d;
}

.button-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.back-btn {
    flex: 1;
    padding: 0.85rem;
    background: #e3e6ef;
    border-radius: 10px;
    font-size: 1rem;
    color: #1f2f5d;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: #d5d9e6;
}

.primary-btn,
.start-btn {
    flex: 1;
    padding: 0.85rem;
    background: #2a4b9b;
    border-radius: 10px;
    font-size: 1rem;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.primary-btn:hover,
.start-btn:hover {
    background: #1f3a7a;
}

/* Step transition animations */
.step-enter {
    opacity: 0;
    transform: translateY(20px);
}

.step-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.step-exit {
    opacity: 1;
    transform: translateY(0);
}

.step-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Progress bar */
.progress-container {
    width: 100%;
    max-width: 520px;
    margin: 2rem auto;
    text-align: center;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: #e6e8ef;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 10px;
    width: 0%;
    background: linear-gradient(90deg, #2a4b9b, #3f63c7);
    border-radius: 6px;
    transition: width 0.45s ease;
}

.progress-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #1f2f5d;
    opacity: 0.85;
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    color: #2a4b9b;
    transition: transform 0.3s ease;
}

.score-display.revealed {
    transform: scale(1.08);
}

/* --- Assessment popout modal styles --- */
.assessment-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.assessment-modal-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* On short/mobile viewports, anchor to the top instead of centering,
   so overflowing content stays reachable via scroll (fixes the
   flexbox "centered overflow gets clipped" bug on mobile) */
@media (max-width: 600px), (max-height: 700px) {
    .assessment-modal-overlay.open {
        align-items: flex-start;
        justify-content: center;
    }
}

.assessment-modal-box {
    background: #fff;
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto 0;
}

@media (max-width: 600px) {
    .assessment-modal-box {
        padding: 20px 16px;
        max-height: none;
        border-radius: 10px;
        margin-top: 12px;
        margin-bottom: 12px;
    }

    .assessment-modal-box .enhanced-step {
        padding: 1.6rem 1rem;
        margin: 0.5rem auto;
    }

    .assessment-modal-box .question-title {
        font-size: 1.15rem;
    }
}

.assessment-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    z-index: 1;
}

.assessment-modal-close:hover {
    color: #000;
}

/* Steps no longer need to be page-fixed; they live inside the modal box */
.question-step {
    margin: 0;
}

/* --- Results / "Assessment Complete" popout modal styles --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px), (max-height: 700px) {
    .modal-overlay.open {
        align-items: flex-start;
        justify-content: center;
    }
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto 0;
}

@media (max-width: 600px) {
    .modal-box {
        padding: 24px 18px;
        margin-top: 12px;
    }
}