/* ==========================================================================
   QUIZ MODULE — Swedish Paleo
   Flerstegs-quiz med svarskort, progress bar och resultat-sida.
   ========================================================================== */


/* === 1. WRAPPER & LAYOUT === */

.sp-quiz-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}


/* === 2. PROGRESS BAR === */

.sp-quiz-progress {
    margin-bottom: 40px;
    text-align: center;
}

.sp-quiz-progress-bar {
    height: 6px;
    background: #d5d8d8;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sp-quiz-progress-fill {
    height: 100%;
    background: #3D5F42;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sp-quiz-progress-text {
    font-size: 13px;
    color: #8a8580;
    font-weight: 500;
    letter-spacing: 0.02em;
}


/* === 3. STEG (FRÅGOR) === */

.sp-quiz-step {
    animation: spQuizFadeIn 0.35s ease-out;
}

.sp-quiz-step--hidden {
    display: none !important;
}

.sp-quiz-question {
    font-size: 24px;
    font-weight: 700;
    color: #2c2c2c;
    text-align: center;
    margin: 0 0 32px;
    line-height: 1.35;
}

.sp-quiz-hint {
    font-size: 14px;
    color: #8a8580;
    text-align: center;
    margin: -20px 0 28px;
    font-weight: 500;
}

.sp-quiz-continue-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #3D5F42;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.15s, opacity 0.25s;
}

.sp-quiz-continue-btn:hover {
    background: #345338;
    transform: translateY(-1px);
}

.sp-quiz-continue-btn:active {
    transform: translateY(0);
}

.sp-quiz-continue-btn--hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 600px) {
    .sp-quiz-question {
        font-size: 20px;
        margin-bottom: 24px;
    }

    .sp-quiz-hint {
        margin: -14px 0 20px;
        font-size: 13px;
    }
}


/* === 4. SVARSKORT === */

.sp-quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-quiz-answer-card {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 22px 28px;
    background: #fff;
    border: 2px solid #dddfe0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    color: #2c2c2c;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    -webkit-appearance: none;
    appearance: none;
}

@media (hover: hover) {
    .sp-quiz-answer-card:hover {
        border-color: #3D5F42;
        background: #f8f7f5;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(61, 95, 66, 0.08);
    }
    .sp-quiz-answer-card:hover .sp-quiz-answer-icon {
        background: #3D5F42;
        color: #fff;
    }
}

.sp-quiz-answer-card:active {
    transform: translateY(0);
}

.sp-quiz-answer-card.is-selected {
    border-color: #3D5F42;
    background: #f0f5f1;
    box-shadow: 0 0 0 3px rgba(61, 95, 66, 0.12);
}

.sp-quiz-answer-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f1ed;
    border-radius: 12px;
    color: #3D5F42;
    transition: background 0.2s, color 0.2s;
}

.sp-quiz-answer-card.is-selected .sp-quiz-answer-icon {
    background: #3D5F42;
    color: #fff;
}

.sp-quiz-answer-icon .sp-quiz-icon {
    width: 22px;
    height: 22px;
}

.sp-quiz-answer-icon .sp-quiz-icon svg {
    width: 22px;
    height: 22px;
}

.sp-quiz-answer-label {
    font-weight: 500;
}

.sp-quiz-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sp-quiz-icon svg {
    width: 100%;
    height: 100%;
}


/* === 5. LADDNINGS-VY === */

.sp-quiz-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.sp-quiz-loading.sp-quiz-step--hidden {
    display: none !important;
}

.sp-quiz-loader {
    text-align: center;
}

.sp-quiz-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8e5e0;
    border-top-color: #3D5F42;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spQuizSpin 0.8s linear infinite;
}

.sp-quiz-loader-text {
    font-size: 16px;
    color: #8a8580;
    font-weight: 500;
    margin: 0;
}

@keyframes spQuizSpin {
    to { transform: rotate(360deg); }
}


/* === 6. RESULTAT-SIDA === */

.sp-quiz-result-wrap {
    animation: spQuizFadeIn 0.5s ease-out;
}

.sp-quiz-result-header {
    text-align: center;
    margin-bottom: 32px;
}

.sp-quiz-result-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3D5F42;
    background: #e8f2ea;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.sp-quiz-result-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0 0 8px;
    line-height: 1.3;
}

.sp-quiz-result-subtitle {
    font-size: 16px;
    color: #6b6560;
    margin: 0;
    line-height: 1.5;
}

/* Program-kort */
.sp-quiz-program-card {
    background: #fff;
    border: 2px solid #e8e5e0;
    border-radius: 16px;
    padding: 32px 28px;
    margin-bottom: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sp-quiz-program-card:hover {
    border-color: #d5d0cb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.sp-quiz-program-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    margin-bottom: 16px;
    color: #fff;
}

.sp-quiz-program-card--green  .sp-quiz-program-icon { background: #3D5F42; }
.sp-quiz-program-card--blue   .sp-quiz-program-icon { background: #3b6fa0; }
.sp-quiz-program-card--purple .sp-quiz-program-icon { background: #6b4fa0; }
.sp-quiz-program-card--warm   .sp-quiz-program-icon { background: #a07040; }
.sp-quiz-program-card--teal   .sp-quiz-program-icon { background: #2d8a7d; }

.sp-quiz-program-icon svg {
    width: 26px;
    height: 26px;
}

.sp-quiz-program-name {
    font-size: 22px;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0 0 8px;
}

.sp-quiz-program-desc {
    font-size: 15px;
    color: #5a5550;
    line-height: 1.6;
    margin: 0 0 16px;
}

.sp-quiz-program-reason {
    font-size: 14px;
    color: #3D5F42;
    background: #f0f5f1;
    border-radius: 10px;
    padding: 12px 16px;
    line-height: 1.5;
    font-style: italic;
}

/* CTA-knappar */
.sp-quiz-cta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.sp-quiz-cta-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #3D5F42;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.15s;
}

.sp-quiz-cta-primary:hover {
    background: #345338;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.sp-quiz-cta-primary:active {
    transform: translateY(0);
}

.sp-quiz-cta-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: #3D5F42;
    background: transparent;
    border: 2px solid #3D5F42;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.sp-quiz-cta-secondary:hover {
    background: #f0f5f1;
    color: #3D5F42;
    text-decoration: none;
}

/* Lead capture */
.sp-quiz-lead-capture {
    background: #f8f7f5;
    border: 2px solid #e8e5e0;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.sp-quiz-lead-capture h3 {
    font-size: 17px;
    font-weight: 600;
    color: #2c2c2c;
    margin: 0 0 6px;
}

.sp-quiz-lead-capture p {
    font-size: 14px;
    color: #6b6560;
    margin: 0 0 16px;
}

.sp-quiz-lead-form {
    display: flex;
    gap: 8px;
    max-width: 420px;
    margin: 0 auto;
}

.sp-quiz-lead-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid #e8e5e0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}

.sp-quiz-lead-input:focus {
    border-color: #3D5F42;
}

.sp-quiz-lead-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #3D5F42;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.sp-quiz-lead-btn:hover {
    background: #345338;
}

.sp-quiz-lead-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sp-quiz-lead-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #3D5F42;
    padding: 10px;
}

.sp-quiz-lead-success svg {
    width: 18px;
    height: 18px;
}

/* Ta om */
.sp-quiz-retake {
    text-align: center;
    margin-top: 8px;
}

.sp-quiz-retake-btn {
    font-size: 14px;
    color: #8a8580;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    transition: color 0.2s;
    padding: 8px 0;
}

.sp-quiz-retake-btn:hover {
    color: #5a5550;
}

@media (max-width: 600px) {
    .sp-quiz-wrap {
        padding: 16px 12px 48px;
    }

    .sp-quiz-result-title {
        font-size: 24px;
    }

    .sp-quiz-program-card {
        padding: 24px 20px;
    }

    .sp-quiz-lead-form {
        flex-direction: column;
    }

    .sp-quiz-lead-btn {
        width: 100%;
    }

    .sp-quiz-answer-card {
        padding: 16px 20px;
        gap: 14px;
        font-size: 15px;
    }

    .sp-quiz-answer-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .sp-quiz-answer-icon .sp-quiz-icon,
    .sp-quiz-answer-icon .sp-quiz-icon svg {
        width: 20px;
        height: 20px;
    }
}


/* === 7. FELVY === */

.sp-quiz-error {
    text-align: center;
    padding: 48px 20px;
    animation: spQuizFadeIn 0.35s ease-out;
}

.sp-quiz-error-text {
    font-size: 16px;
    color: #5a5550;
    margin: 0 0 20px;
    line-height: 1.5;
}

.sp-quiz-error-btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #3D5F42;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.sp-quiz-error-btn:hover {
    background: #345338;
}


/* === 8. ANIMATIONER === */

@keyframes spQuizFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sp-quiz-step--entering {
    animation: spQuizFadeIn 0.35s ease-out;
}


/* === 9. SIDBAKGRUND & ELEMENTOR-LAYOUT === */

body.sp-quiz-page .entry-content {
    background: #f7f8f7 !important;
}

body.sp-quiz-page .entry-content > .elementor {
    background: transparent !important;
}

body.sp-quiz-page .elementor-section > .elementor-container {
    max-width: 960px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

body.sp-quiz-page .elementor-inner-section > .elementor-container {
    max-width: 100% !important;
}

.elementor-widget-shortcode .sp-quiz-wrap {
    padding-left: 0;
    padding-right: 0;
}


/* === 10. CTA-KNAPP: OUTLINED GRÖN (klass: sp-cta-outline) === */

.sp-cta-outline .elementor-button {
    font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #3D5F42 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 10px 22px !important;
    border: 1px solid #dce8de !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transition: all 0.25s ease !important;
}

.sp-cta-outline .elementor-button:hover {
    background: #f4f9f5 !important;
    border-color: #3D5F42 !important;
    color: #2e4a32 !important;
    box-shadow: 0 2px 8px rgba(61, 95, 66, 0.12) !important;
}


/* === 11. QUIZ PREVIEW [sp_quiz_preview] === */

.sp-qp {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .04);
    padding: 28px 24px 24px;
    max-width: 360px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

.sp-qp-inner {
    position: relative;
}

.sp-qp-bar-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sp-qp-bar {
    flex: 1;
    height: 6px;
    background: #e8e5e0;
    border-radius: 3px;
    overflow: hidden;
    margin-right: 12px;
}

.sp-qp-bar-fill {
    width: 20%;
    height: 100%;
    background: #3D5F42;
    border-radius: 3px;
    transition: width .6s ease;
}

.sp-qp-bar-label {
    font-size: 11px;
    color: #9a9590;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: .02em;
}

.sp-qp-question {
    font-size: 16px;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0 0 16px;
    line-height: 1.35;
}

.sp-qp-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-qp-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fafaf9;
    border: 1.5px solid #eae8e4;
    border-radius: 10px;
    transition: all .2s;
}

.sp-qp-opt--active {
    background: #f0f7f1;
    border-color: #3D5F42;
    box-shadow: 0 0 0 2px rgba(61, 95, 66, .12);
}

.sp-qp-opt-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-qp-opt-icon svg {
    width: 16px;
    height: 16px;
}

.sp-qp-opt-icon--green { background: linear-gradient(135deg, #e2f0e4, #d4e8d6); color: #3D5F42; }
.sp-qp-opt-icon--blue  { background: linear-gradient(135deg, #e0eef6, #d2e4f0); color: #3a6b8a; }
.sp-qp-opt-icon--rose  { background: linear-gradient(135deg, #f5e6e6, #eedad9); color: #8a4a4a; }

.sp-qp-opt-text {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    flex: 1;
    line-height: 1.3;
}

.sp-qp-opt--active .sp-qp-opt-text {
    color: #2c2c2c;
}

.sp-qp-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: #3D5F42;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-qp-check svg {
    width: 16px;
    height: 16px;
}
