/**
 * Ilaria Donato Quiz - Styles
 * Design: White background, Bordeaux CTA (#9E1946), Purple accents (#702A99)
 * Colori: Bordeaux #9E1946 (CTA), Viola #702A99 (accenti), Grigio #484848 (testi), Bianco #ffffff
 * Fonts: Oswald (titles), Roboto (paragraphs)
 */

/* ===========================
   GLOBAL STYLES
   =========================== */

.spq-quiz-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Roboto', sans-serif;
    color: #484848;
    background: #ffffff;
    min-height: 100vh;
}

.spq-quiz-container * {
    box-sizing: border-box;
}

/* ===========================
   SPLASH SCREEN
   =========================== */

.spq-splash-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: #ffffff;
    animation: fadeIn 0.6s ease-in;
}

.spq-splash-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.spq-splash-title {
    font-family: 'Oswald', sans-serif;
    font-size: 80px;
    font-weight: 700;
    color: #702A99;
    margin: 0 0 10px 0;
    letter-spacing: 8px;
    text-transform: uppercase;
    line-height: 1;
}

.spq-splash-subtitle {
    font-family: 'Oswald', sans-serif;
    font-size: 48px;
    font-weight: 600;
    color: #9E1946;
    margin: 0 0 20px 0;
    letter-spacing: 4px;
    text-transform: uppercase;
    line-height: 1;
}

.spq-splash-description {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: #484848;
    margin: 0 0 50px 0;
    letter-spacing: 1px;
}

/* Lead Form */
.spq-lead-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 40px;
}

.spq-form-row {
    width: 100%;
}

.spq-form-row input {
    width: 100%;
    padding: 18px 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #484848;
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.spq-form-row input:focus {
    outline: none;
    border-color: #9E1946;
    background: #ffffff;
}

.spq-form-row input::placeholder {
    color: #999999;
}

/* GDPR Section */
.spq-gdpr-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.spq-gdpr-notice {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #484848;
    line-height: 1.6;
    margin: 0 0 20px 0;
    text-align: left;
}

.spq-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.spq-checkbox-label:hover {
    opacity: 0.9;
}

.spq-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #9E1946;
    flex-shrink: 0;
}

.spq-checkbox-text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #484848;
    line-height: 1.6;
    text-align: left;
}

.spq-quiz-container .spq-cta-button,
.spq-quiz-container button.spq-cta-button,
button.spq-cta-button {
    width: 100% !important;
    padding: 20px 40px !important;
    font-family: 'Oswald', sans-serif !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    color: #ffffff !important;
    background: #9E1946 !important;
    background-color: #9E1946 !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    margin-top: 20px !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.spq-quiz-container .spq-cta-button:hover,
.spq-quiz-container button.spq-cta-button:hover,
button.spq-cta-button:hover {
    background: #7d1337 !important;
    background-color: #7d1337 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(158, 25, 70, 0.4) !important;
}

.spq-quiz-container .spq-cta-button:active,
.spq-quiz-container button.spq-cta-button:active,
button.spq-cta-button:active {
    transform: translateY(0) !important;
    background: #9E1946 !important;
    background-color: #9E1946 !important;
}

.spq-quiz-container .spq-cta-button:focus,
.spq-quiz-container button.spq-cta-button:focus,
button.spq-cta-button:focus {
    outline: none !important;
    color: #ffffff !important;
    background: #9E1946 !important;
    background-color: #9E1946 !important;
}

/* ===========================
   QUIZ SCREEN
   =========================== */

.spq-quiz-screen {
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-in;
}

/* Progress Bar */
.spq-quiz-header {
    margin-bottom: 40px;
}

.spq-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.spq-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #9E1946 0%, #702A99 100%);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 10px;
}

.spq-progress-text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #484848;
    text-align: center;
    margin: 0;
}

/* Multi-Step Question Container */
.spq-question-step {
    min-height: 400px;
    animation: fadeIn 0.4s ease-in;
}

.spq-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #702A99;
    margin: 0 0 40px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    border-bottom: 2px solid #702A99;
    padding-bottom: 15px;
}

/* Question Wrapper */
.spq-question-wrapper {
    padding: 40px;
    background: #f8f8f8;
    border: 2px solid #702A99;
    border-radius: 12px;
    margin-bottom: 40px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.spq-question-text {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #484848;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.spq-question-number {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #702A99;
    margin-right: 10px;
}

.spq-optional-text {
    font-size: 14px;
    color: #999999;
    font-style: italic;
    font-weight: 300;
}

/* Answer Options */
.spq-answers {
    display: flex;
    gap: 20px;
}

.spq-answer-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.spq-answer-option:hover {
    background: #f8f8f8;
    border-color: #9E1946;
}

.spq-answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.spq-radio-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #999999;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.spq-answer-option input[type="radio"]:checked ~ .spq-radio-custom {
    border-color: #9E1946;
    background: #9E1946;
}

.spq-answer-option input[type="radio"]:checked ~ .spq-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
}

.spq-answer-option input[type="radio"]:checked ~ .spq-answer-text {
    color: #9E1946;
    font-weight: 600;
}

.spq-answer-text {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #484848;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

/* Navigation Buttons */
.spq-navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.spq-quiz-container .spq-nav-button,
.spq-quiz-container button.spq-nav-button,
button.spq-nav-button,
.spq-quiz-container .spq-next-button,
.spq-quiz-container .spq-submit-button {
    flex: 1;
    padding: 18px 40px !important;
    font-family: 'Oswald', sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    color: #ffffff !important;
    background: #9E1946 !important;
    background-color: #9E1946 !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
}

.spq-quiz-container .spq-nav-button:hover:not(:disabled),
.spq-quiz-container button.spq-nav-button:hover:not(:disabled),
button.spq-nav-button:hover:not(:disabled) {
    background: #7d1337 !important;
    background-color: #7d1337 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(158, 25, 70, 0.4) !important;
}

.spq-quiz-container .spq-nav-button:disabled,
.spq-quiz-container button.spq-nav-button:disabled,
button.spq-nav-button:disabled {
    background: #cccccc !important;
    background-color: #cccccc !important;
    color: #999999 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.spq-quiz-container .spq-prev-button,
.spq-quiz-container button.spq-prev-button,
button.spq-prev-button {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #9E1946 !important;
    border: 2px solid #9E1946 !important;
}

.spq-quiz-container .spq-prev-button:hover,
.spq-quiz-container button.spq-prev-button:hover,
button.spq-prev-button:hover {
    background: #f8f8f8 !important;
    background-color: #f8f8f8 !important;
    border-color: #7d1337 !important;
    color: #7d1337 !important;
}

/* ===========================
   RESULTS SCREEN
   =========================== */

.spq-results-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    animation: fadeIn 0.6s ease-in;
}

.spq-results-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.spq-results-title {
    font-family: 'Oswald', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #702A99;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spq-results-score {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #484848;
    margin: 0 0 30px 0;
}

.spq-results-score span {
    font-size: 48px;
    color: #9E1946;
}

.spq-results-description {
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #484848;
    line-height: 1.8;
    margin: 0 0 50px 0;
}

/* Calendar Section */
.spq-calendar-section {
    background: #f8f8f8;
    border: 2px solid #9E1946;
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    margin-bottom: 40px;
}

/* Next Steps */
.spq-next-steps {
    background: #f8f8f8;
    border: 2px solid #702A99;
    border-radius: 12px;
    padding: 40px;
    margin-top: 40px;
    text-align: left;
}

.spq-next-steps h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #702A99;
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.spq-next-steps ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.spq-next-steps li {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    color: #484848;
    line-height: 2;
    padding-left: 30px;
    position: relative;
    margin-bottom: 15px;
}

.spq-next-steps li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #9E1946;
    font-weight: bold;
    font-size: 20px;
}

/* Answers Summary */
.spq-answers-summary {
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 40px;
    margin-top: 40px;
}

.spq-answers-summary h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #702A99;
    margin: 0 0 30px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.spq-summary-section {
    margin-bottom: 40px;
}

.spq-summary-section:last-child {
    margin-bottom: 0;
}

.spq-summary-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #702A99;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 10px;
    border-bottom: 1px solid #702A99;
}

.spq-summary-questions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.spq-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border-left: 3px solid #e0e0e0;
    transition: all 0.3s ease;
}

.spq-summary-item:hover {
    background: #f8f8f8;
}

.spq-summary-question {
    flex: 1;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #484848;
    line-height: 1.6;
}

.spq-summary-number {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: #702A99;
    margin-right: 8px;
}

.spq-summary-answer {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 20px;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

.spq-summary-answer.answer-yes {
    background: rgba(112, 42, 153, 0.1);
    color: #702A99;
    border: 2px solid #702A99;
}

.spq-summary-answer.answer-no {
    background: rgba(158, 25, 70, 0.1);
    color: #9E1946;
    border: 2px solid #9E1946;
}

/* ===========================
   LOADING OVERLAY
   =========================== */

.spq-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spq-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #9E1946;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spq-loading p {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #484848;
    margin-top: 20px;
}

/* ===========================
   TEXT ANSWER & SCALE STYLES
   =========================== */

/* Textarea for text answers */
.spq-text-answer {
    width: 100%;
}

.spq-text-answer textarea {
    width: 100%;
    padding: 15px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #484848;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    transition: all 0.3s ease;
}

.spq-text-answer textarea:focus {
    outline: none;
    border-color: #9E1946;
}

.spq-text-answer textarea::placeholder {
    color: #999999;
}

/* Scale answers (1-10) */
.spq-scale-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.spq-scale-option {
    flex: 0 0 auto;
    min-width: 60px;
    justify-content: center;
}

.spq-scale-option .spq-answer-text {
    font-size: 20px;
    font-weight: 600;
}

/* Multiple choice with longer text */
.spq-multiple-answers {
    flex-direction: column;
    gap: 15px;
}

.spq-multiple-option {
    width: 100%;
}

.spq-multiple-option .spq-answer-text {
    text-transform: none;
    font-size: 16px;
    white-space: normal;
    text-align: left;
}

/* ===========================
   ANIMATIONS
   =========================== */

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Tablet */
@media (max-width: 768px) {
    .spq-splash-title {
        font-size: 60px;
        letter-spacing: 6px;
    }

    .spq-splash-subtitle {
        font-size: 36px;
        letter-spacing: 3px;
    }

    .spq-splash-description {
        font-size: 14px;
    }

    .spq-section-title {
        font-size: 24px;
    }

    .spq-question-text {
        font-size: 16px;
    }

    .spq-results-title {
        font-size: 28px;
    }

    .spq-results-score {
        font-size: 24px;
    }

    .spq-results-score span {
        font-size: 40px;
    }

    .spq-results-description {
        font-size: 18px;
    }

    .spq-next-steps {
        padding: 30px;
    }

    .spq-next-steps h3 {
        font-size: 24px;
    }

    .spq-next-steps li {
        font-size: 16px;
    }

    .spq-question-wrapper {
        padding: 30px;
    }

    .spq-navigation-buttons {
        flex-direction: row;
    }

    .spq-nav-button {
        font-size: 16px;
        padding: 16px 30px;
    }

    .spq-answers-summary {
        padding: 30px;
    }

    .spq-summary-section-title {
        font-size: 18px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .spq-splash-title {
        font-size: 48px;
        letter-spacing: 4px;
    }

    .spq-splash-subtitle {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .spq-splash-description {
        font-size: 13px;
        margin-bottom: 30px;
    }

    .spq-cta-button,
    .spq-nav-button {
        font-size: 16px;
        padding: 16px 25px;
    }

    .spq-quiz-screen {
        padding: 30px 15px;
    }

    .spq-section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .spq-question-wrapper {
        padding: 25px;
        min-height: 200px;
    }

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

    .spq-answers {
        flex-direction: column;
        gap: 15px;
    }

    .spq-answer-option {
        justify-content: center;
    }

    .spq-navigation-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .spq-nav-button {
        width: 100%;
    }

    .spq-prev-button {
        order: 2;
    }

    .spq-next-button,
    .spq-submit-button {
        order: 1;
    }

    .spq-results-title {
        font-size: 24px;
    }

    .spq-results-score {
        font-size: 20px;
    }

    .spq-results-score span {
        font-size: 36px;
    }

    .spq-results-description {
        font-size: 16px;
    }

    .spq-next-steps {
        padding: 20px;
    }

    .spq-next-steps h3 {
        font-size: 20px;
    }

    .spq-next-steps li {
        font-size: 15px;
        padding-left: 25px;
    }

    .spq-form-row input {
        font-size: 15px;
        padding: 16px 18px;
    }

    .spq-answers-summary {
        padding: 20px;
    }

    .spq-answers-summary h3 {
        font-size: 22px;
    }

    .spq-summary-section-title {
        font-size: 16px;
    }

    .spq-summary-item {
        flex-direction: column;
        gap: 10px;
    }

    .spq-summary-question {
        font-size: 14px;
    }

    .spq-summary-answer {
        align-self: flex-start;
        font-size: 14px;
        padding: 6px 16px;
    }
}

/* Extra small mobile */
@media (max-width: 360px) {
    .spq-splash-title {
        font-size: 40px;
        letter-spacing: 3px;
    }

    .spq-splash-subtitle {
        font-size: 24px;
    }

    .spq-question-text {
        font-size: 14px;
    }

    .spq-answer-text {
        font-size: 16px;
    }
}
