/* ============================================
   BEAN MERCHANT MATCHMAKER QUIZ - COMPLETE CSS
   ============================================ */

:root {
    /* Romantic Coffee Palette */
    --match-primary: #2c1810;
    --match-gold: #d4a574;
    --match-rose: #e8b4a7;
    --match-cream: #faf6f0;
    --match-sage: #7a8b7f;
    --match-copper: #b87333;
    
    /* Gradients */
    --romantic-gradient: linear-gradient(135deg, #2c1810 0%, #4a2c1a 50%, #6b3e2a 100%);
    --gold-shimmer: linear-gradient(45deg, #d4a574 0%, #f4e5d3 50%, #d4a574 100%);
}

/* ============================================
   GLOBAL RESET & QUIZ CONTAINER
   ============================================ */
.matchmaker-experience {
    position: relative;
    min-height: 100vh;
    background: var(--match-cream);
    overflow: hidden;
}

.matchmaker-experience * {
    box-sizing: border-box;
}

/* ============================================
   QUIZ SCREENS - FIXED DISPLAY LOGIC
   ============================================ */
.quiz-screen {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Only show active screens */
.quiz-screen.active {
    display: block;
}

/* Intro Screen Special Handling */
#introScreen {
    /* Remove the !important that was causing issues */
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--romantic-gradient);
    color: white;
}

#introScreen.active {
    display: flex;
}

/* Question Screens */
.quiz-screen[data-screen="question"] {
    padding-top: 60px;
    background: var(--match-cream);
    display: none; /* Ensure they start hidden */
}

.quiz-screen[data-screen="question"].active {
    display: block;
}

/* Hide email gate sections by default */
#loginFormSection {
    display: none;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.progress-bar {
    height: 100%;
    background: var(--gold-shimmer);
    background-size: 200% 100%;
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '❤️';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

/* ============================================
   INTRO SCREEN
   ============================================ */
.intro-content {
    max-width: 800px;
    padding: 2rem;
    text-align: center;
    animation: fadeInUp 1.5s ease;
}

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

.matchmaker-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    position: relative;
}

.heart-coffee {
    width: 100%;
    height: 100%;
    background: var(--match-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.intro-headline {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gold-shimmer);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.intro-tagline {
    font-size: 1.5rem;
    color: var(--match-rose);
    font-style: italic;
    margin-bottom: 2rem;
}

.intro-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
}

.btn-start-journey {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: var(--match-gold);
    color: var(--match-primary);
    padding: 1.25rem 3rem;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-start-journey:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(212, 165, 116, 0.4);
}

.trust-signals {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 3rem;
    font-size: 0.9rem;
    opacity: 0.8;
    flex-wrap: wrap;
}

/* ============================================
   EMAIL GATE MODAL
   ============================================ */
.email-gate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.email-gate-overlay.active {
    display: flex;
}

.email-gate-modal {
    background: white;
    border-radius: 25px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.5s ease;
}

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

.close-gate {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-gate:hover {
    background: var(--match-cream);
    color: var(--match-primary);
}

.gate-header {
    text-align: center;
    margin-bottom: 2rem;
}

.gate-header h2 {
    font-size: 2rem;
    color: var(--match-primary);
    margin-bottom: 0.5rem;
}

.gate-subtitle {
    color: var(--match-copper);
    font-size: 1.1rem;
}

.benefits-preview {
    background: var(--match-cream);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--match-primary);
}

.benefit-item:last-child {
    margin-bottom: 0;
}

.benefit-icon {
    font-size: 1.5rem;
}

.quiz-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--match-primary);
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--match-gold);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.btn-submit {
    background: var(--match-gold);
    color: var(--match-primary);
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: var(--match-copper);
    color: white;
    transform: translateY(-2px);
}

.form-toggle {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.form-toggle a {
    color: var(--match-gold);
    text-decoration: none;
    font-weight: 600;
}

.form-toggle a:hover {
    text-decoration: underline;
}

.skip-option {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.skip-option a {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
}

.skip-option a:hover {
    color: var(--match-copper);
    text-decoration: underline;
}

/* ============================================
   QUESTION SCREENS
   ============================================ */
.question-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.question-card {
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
}

.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.question-number {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--match-rose);
    color: var(--match-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.question-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--match-primary);
    margin: 0;
    text-align: center;
    flex: 1;
    padding: 0 1rem;
}

.btn-back {
    background: var(--match-sage);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover:not(:disabled) {
    background: var(--match-copper);
    transform: translateY(-1px);
}

.btn-back:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.question-subtitle {
    font-size: 1rem;
    color: var(--match-copper);
    font-style: italic;
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================================
   ANSWER OPTIONS
   ============================================ */
.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 2;
    flex: 1;
    align-content: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.answer-options.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1000px;
}

.answer-options.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    max-width: 1200px;
}

.answer-options.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
}

.answer-card {
    background: #ffffff;
    border: 3px solid #e8e8e8;
    border-radius: 20px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
}

.answer-card:hover {
    border-color: var(--match-gold);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 165, 116, 0.3);
    background: #fefefe;
}

.answer-card.selected {
    background: var(--match-gold);
    color: var(--match-primary);
    border-color: var(--match-gold);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.4);
    transform: scale(1.02);
}

.answer-card.selected .answer-text,
.answer-card.selected .answer-description,
.answer-card.selected .answer-icon {
    color: var(--match-primary) !important;
}

.answer-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.answer-text {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--match-primary);
}

.answer-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* Compact cards for Question 8 */
.answer-options[data-question="grind-type-selection"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 800px;
}

.answer-card.compact {
    padding: 1rem 1.5rem;
    min-width: 150px;
    max-width: 200px;
    min-height: 80px;
}

.answer-card.compact .answer-text {
    margin-bottom: 0.25rem;
}

.answer-card.compact .answer-description {
    font-size: 0.8rem;
}

/* ============================================
   ANSWER GROUPS
   ============================================ */
.answer-group {
    margin: 2rem 0;
}

.group-title {
    font-size: 1.2rem;
    color: var(--match-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   COFFEE AMOUNT SELECTOR
   ============================================ */
.coffee-amount-selector {
    background: var(--match-cream);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.amount-display {
    margin-bottom: 1.5rem;
}

.cups-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--match-gold);
    display: block;
}

.cups-label {
    font-size: 1.1rem;
    color: var(--match-copper);
}

#coffeeAmount {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    margin: 1.5rem 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#coffeeAmount::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--match-gold);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#coffeeAmount::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#coffeeAmount::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--match-gold);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: none;
}

.amount-labels {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.9rem;
}

#pack-size-display {
    margin-top: 1rem;
}

/* ============================================
   NAVIGATION
   ============================================ */
.question-navigation {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
}

.btn-nav {
    background: var(--match-gold);
    color: var(--match-primary);
    padding: 1rem 2.5rem;
    border-radius: 25px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-nav:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-nav:not(:disabled):hover {
    background: var(--match-copper);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(184, 115, 51, 0.3);
}

/* Submit button - consistent with other buttons */
#submitBtn {
    background: var(--match-gold);
    color: var(--match-primary);
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

#submitBtn:not(:disabled):hover {
    background: var(--match-copper);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(184, 115, 51, 0.3);
}

/* Loading states for submit button */
#submitBtn.loading {
    background: #666;
    color: white;
    cursor: not-allowed;
    pointer-events: none;
}

#submitBtn.loading .loading-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#submitBtn.loading .loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced loading animation */
#submitBtn.loading {
    background: #4a4a4a !important;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
}

#submitBtn.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.loading-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}
/* ============================================
   SPARKLE EFFECT
   ============================================ */
.sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

@keyframes sparkleFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .answer-options.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .question-card {
        padding: 1.5rem;
        min-height: calc(100vh - 80px);
    }
    
    .question-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .question-title {
        font-size: 1.25rem;
    }
    
    .btn-back {
        order: -1;
        align-self: flex-start;
    }
    
    .answer-options,
    .answer-options.grid-2,
    .answer-options.grid-3,
    .answer-options.grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .answer-card {
        padding: 1.25rem;
    }
    
    .intro-headline {
        font-size: 2rem;
    }
    
    .trust-signals {
        flex-direction: column;
        gap: 1rem;
    }
    
    .email-gate-modal {
        padding: 2rem;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .question-container {
        padding: 1rem;
    }
    
    .answer-card {
        min-height: 120px;
    }
    
    .answer-icon {
        font-size: 2rem;
    }
    
    .cups-number {
        font-size: 2.5rem;
    }
    
    .btn-nav {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   SCREEN TRANSITION ANIMATIONS
   ============================================ */
.quiz-screen {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-screen.active {
    opacity: 1;
}

/* Ensure only one screen is visible at a time */
.matchmaker-experience > .quiz-screen:not(.active) {
    position: absolute;
    top: -9999px;
    left: -9999px;
}

/* Intro Registration Form Styles */
.intro-registration-form {
    max-width: 400px;
    margin: 30px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.intro-registration-form .form-header {
    margin-bottom: 25px;
    text-align: center;
}

.intro-registration-form .form-header h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
}

.intro-registration-form .form-header p {
    font-size: 14px;
    color: #666;
}

.intro-form .form-group {
    margin-bottom: 15px;
}

.intro-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

.intro-form input:focus {
    outline: none;
    border-color: #D4A574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.intro-registration-form .btn-start-journey {
    width: 100%;
    margin-top: 20px;
}

.form-options {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.form-options p {
    margin: 8px 0;
}

.form-options a {
    color: #D4A574;
    text-decoration: none;
}

.form-options a:hover {
    text-decoration: underline;
}

.skip-option {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.skip-option a {
    color: #999;
    font-size: 13px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .intro-registration-form {
        padding: 20px;
        margin: 20px 10px;
    }
}