/* ============================================
   PRODUCT QUIZ - "Find Your Perfect Box"
   ============================================
   
   FreshBox Design System Principles:
   - Consistent with Barlow font family
   - Primary green: #4A7C59
   - Accent yellow: #fbbf24
   - Clean, modern aesthetic
   - Mobile-first responsive design
   - WCAG AA accessibility compliance
   
   ============================================ */

/* ============================================
   MODAL OVERLAY & CONTAINER
   ============================================ */

.quiz-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.quiz-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.quiz-modal-overlay.active .quiz-modal {
    transform: scale(1);
}

/* ============================================
   MODAL HEADER
   ============================================ */

.quiz-modal-header {
    padding: 40px 40px 20px;
    text-align: center;
    position: relative;
}

.quiz-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.quiz-close-btn:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.quiz-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.quiz-modal-title {
    font-family: 'Barlow', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.2;
}

.quiz-modal-subtitle {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #6b7280;
    margin: 0;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.quiz-progress-container {
    padding: 0 40px 20px;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A7C59 0%, #5a9c6b 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

.quiz-progress-text {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    margin-top: 8px;
}

/* ============================================
   QUIZ CONTENT AREA
   ============================================ */

.quiz-content {
    padding: 20px 40px 40px;
}

.quiz-screen {
    display: none;
    animation: fadeInSlide 0.4s ease;
}

.quiz-screen.active {
    display: block;
}

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

/* ============================================
   QUESTION SCREEN
   ============================================ */

.quiz-question-title {
    font-family: 'Barlow', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 32px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.quiz-option-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quiz-option-card:hover {
    border-color: #4A7C59;
    background: #f8fdf9;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(74, 124, 89, 0.15);
}

.quiz-option-card.selected {
    border-color: #4A7C59;
    border-width: 3px;
    background: #f0fdf4;
    box-shadow: 0 8px 24px rgba(74, 124, 89, 0.25);
}

.quiz-option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #4A7C59;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.quiz-option-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.quiz-option-title {
    font-family: 'Barlow', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.quiz-option-description {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    margin: 0 0 8px;
    line-height: 1.4;
}

.quiz-option-badge {
    display: inline-block;
    background: #fbbf24;
    color: #000000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.quiz-btn {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quiz-btn-back {
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.quiz-btn-back:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #1a1a1a;
}

.quiz-btn-next {
    background: #4A7C59;
    color: white;
    margin-left: auto;
}

.quiz-btn-next:hover {
    background: #3d6548;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.quiz-btn-next:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.quiz-results {
    text-align: center;
}

.quiz-results-title {
    font-family: 'Barlow', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 32px;
}

.quiz-recommendation-card {
    background: linear-gradient(135deg, #f8fdf9 0%, #f0fdf4 100%);
    border: 3px solid #4A7C59;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
}

.quiz-box-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.quiz-box-name {
    font-family: 'Barlow', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.quiz-box-price {
    font-family: 'Barlow', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #4A7C59;
    margin: 0 0 24px;
}

.quiz-box-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quiz-box-detail {
    text-align: center;
}

.quiz-box-detail-label {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
}

.quiz-box-detail-value {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* ============================================
   PERSONALIZED PICKS
   ============================================ */

.quiz-picks-section {
    text-align: left;
    margin-bottom: 32px;
}

.quiz-picks-title {
    font-family: 'Barlow', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-picks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quiz-pick-item {
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.quiz-pick-item:last-child {
    border-bottom: none;
}

.quiz-pick-icon {
    color: #4A7C59;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.quiz-pick-name {
    font-weight: 600;
    display: block;
}

.quiz-pick-description {
    font-weight: 400;
    color: #6b7280;
    font-size: 14px;
    margin-top: 4px;
}

/* ============================================
   SAVINGS & SOCIAL PROOF
   ============================================ */

.quiz-highlight-box {
    background: #fef3c7;
    border-left: 4px solid #fbbf24;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: left;
}

.quiz-highlight-box.green {
    background: #d1fae5;
    border-left-color: #10b981;
}

.quiz-highlight-title {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-highlight-text {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.quiz-social-proof {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ============================================
   RESULTS CTA BUTTONS
   ============================================ */

.quiz-results-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.quiz-cta-primary {
    background: #000000;
    color: white;
    font-family: 'Barlow', sans-serif;
    font-size: 18px;
    font-weight: 700;
    padding: 18px 32px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.quiz-cta-primary:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.quiz-cta-secondary {
    background: white;
    color: #4A7C59;
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 50px;
    border: 2px solid #4A7C59;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.quiz-cta-secondary:hover {
    background: #f8fdf9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.2);
}

.quiz-restart-link {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.quiz-restart-link:hover {
    color: #4A7C59;
}

/* ============================================
   EMAIL CAPTURE FORM
   ============================================ */

.quiz-email-form {
    text-align: left;
}

.quiz-email-title {
    font-family: 'Barlow', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.quiz-email-subtitle {
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px;
}

.quiz-recommendation-summary {
    background: #f8fdf9;
    border: 2px solid #4A7C59;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.quiz-recommendation-summary-text {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.quiz-form-group {
    margin-bottom: 16px;
}

.quiz-form-label {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    display: block;
}

.quiz-form-label .required {
    color: #dc2626;
}

.quiz-form-input {
    width: 100%;
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.quiz-form-input:focus {
    outline: none;
    border-color: #4A7C59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.quiz-form-help {
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 6px 0 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.quiz-form-submit {
    width: 100%;
    background: #4A7C59;
    color: white;
    font-family: 'Barlow', sans-serif;
    font-size: 18px;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.quiz-form-submit:hover {
    background: #3d6548;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.quiz-form-back {
    width: 100%;
    background: transparent;
    color: #6b7280;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-top: 8px;
}

.quiz-form-back:hover {
    color: #1a1a1a;
}

/* ============================================
   OPENING SCREEN
   ============================================ */

.quiz-opening {
    text-align: center;
    padding: 40px 20px;
}

.quiz-opening-icon {
    font-size: 72px;
    margin-bottom: 24px;
}

.quiz-opening-title {
    font-family: 'Barlow', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
}

.quiz-opening-description {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 32px;
    line-height: 1.6;
}

.quiz-opening-cta {
    background: #4A7C59;
    color: white;
    font-family: 'Barlow', sans-serif;
    font-size: 18px;
    font-weight: 700;
    padding: 18px 48px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.quiz-opening-cta:hover {
    background: #3d6548;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.3);
}

.quiz-opening-note {
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    color: #9ca3af;
    margin-top: 16px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .quiz-modal {
        border-radius: 0;
        max-height: 100vh;
        width: 100%;
        margin: 0;
    }

    .quiz-modal-header {
        padding: 30px 24px 16px;
    }

    .quiz-modal-title {
        font-size: 24px;
    }

    .quiz-modal-subtitle {
        font-size: 14px;
    }

    .quiz-progress-container {
        padding: 0 24px 16px;
    }

    .quiz-content {
        padding: 16px 24px 32px;
    }

    .quiz-question-title {
        font-size: 20px;
        margin-bottom: 24px;
    }

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

    .quiz-option-card {
        padding: 20px 16px;
        min-height: 120px;
    }

    .quiz-option-icon {
        font-size: 40px;
    }

    .quiz-option-title {
        font-size: 16px;
    }

    .quiz-navigation {
        flex-direction: column;
    }

    .quiz-btn-back {
        order: 2;
        width: 100%;
    }

    .quiz-btn-next {
        order: 1;
        width: 100%;
        margin-left: 0;
    }

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

    .quiz-recommendation-card {
        padding: 24px;
    }

    .quiz-box-name {
        font-size: 24px;
    }

    .quiz-box-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quiz-results-actions {
        width: 100%;
    }

    .quiz-cta-primary,
    .quiz-cta-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quiz-modal-overlay {
        padding: 0;
    }

    .quiz-modal-header {
        padding: 24px 20px 12px;
    }

    .quiz-modal-title {
        font-size: 22px;
    }

    .quiz-close-btn {
        top: 16px;
        right: 16px;
    }

    .quiz-progress-container {
        padding: 0 20px 12px;
    }

    .quiz-content {
        padding: 12px 20px 24px;
    }

    .quiz-opening {
        padding: 32px 16px;
    }

    .quiz-opening-title {
        font-size: 24px;
    }

    .quiz-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Keyboard focus states */
.quiz-option-card:focus,
.quiz-btn:focus,
.quiz-cta-primary:focus,
.quiz-cta-secondary:focus,
.quiz-form-input:focus {
    outline: 3px solid #4A7C59;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .quiz-modal-overlay,
    .quiz-modal,
    .quiz-screen,
    .quiz-option-card,
    .quiz-btn,
    .quiz-cta-primary,
    .quiz-cta-secondary {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .quiz-option-card {
        border-width: 3px;
    }

    .quiz-option-card.selected {
        border-width: 4px;
    }
}

/* ============================================
   SUCCESS SCREEN (After Email Submission)
   ============================================ */

.quiz-success {
    text-align: center;
    padding: 20px 0;
}

.quiz-success-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.quiz-success-title {
    font-family: 'Barlow', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px;
}

.quiz-success-message {
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 32px;
}

.quiz-success-highlight {
    display: inline-block;
    background: #fef3c7;
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 8px;
}

.quiz-success-next-steps {
    background: #f8fdf9;
    border: 2px solid #4A7C59;
    border-radius: 16px;
    padding: 32px 24px;
    margin-bottom: 24px;
}

.quiz-next-steps-title {
    font-family: 'Barlow', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 24px;
}

.quiz-cta-large {
    width: 100%;
    padding: 20px 32px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.quiz-cta-subtitle {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
}

.quiz-success-note {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: #6b7280;
    background: #fef3c7;
    border-left: 4px solid #fbbf24;
    padding: 16px;
    border-radius: 8px;
    text-align: left;
    margin-top: 24px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .quiz-modal-overlay {
        display: none;
    }
}
