/* CSS Variables - Natural Sage Green Palette */
:root {
    --sage-50: #F0F4F1;
    --sage-100: #E8F0EB;
    --sage-200: #DDE7DF;
    --sage-300: #C5D4CA;
    --sage-400: #8DAA9D;
    --sage-500: #7A9A8A;
    --sage-600: #6F8B7B;
    --sage-700: #5A7264;
    --sage-800: #45584D;
    --sage-900: #303E36;
    --terracotta-600: #cc5533;
    --terracotta-700: #b8472a;
    --cream: #FAF7F2;
    --cream-100: #F4EFE9;
    --text-body: #2E2A27;
    --text-muted: #6B5B4D;
    --border-light: #DDE7DF;
}

/* Modern Quiz Styles */
.quiz-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #F0F4F1 0%, #E8F0EB 100%);
    padding: 1rem 0;
}

/* Progress Header */
.quiz-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.progress-section {
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sage-500) 0%, var(--sage-600) 100%);
    border-radius: 3px;
    width: 12.5%;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sage-600);
}

/* Quiz Content */
.quiz-content {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.quiz-card {
    background: white;
    border-radius: 24px;
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 2rem;
    min-height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow-y: visible;
    width: 100%;
    box-sizing: border-box;
}

/* Question Steps */
.question-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.question-step.active {
    display: block;
}

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

/* Question Header */
.question-header {
    text-align: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.question-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--sage-700);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.question-description {
    font-size: 1rem;
    color: var(--sage-600);
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
}

/* Helper Toggle */
.helper-toggle {
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.toggle-btn {
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--sage-600);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--sage-300);
    color: var(--sage-700);
}

.toggle-btn i:first-child {
    color: var(--sage-500);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

/* Helper Guides */
.helper-guide {
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease;
}

.guide-card {
    background: white;
    border: 1px solid var(--sage-200);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(107, 91, 77, 0.06);
}

.guide-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sage-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.guide-title i {
    color: var(--sage-600);
    font-size: 1rem;
}

.guide-text {
    font-size: 0.9rem;
    color: var(--sage-600);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    text-align: center;
}

.guide-options {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    justify-content: space-between;
}

.guide-option {
    background: linear-gradient(135deg, var(--sage-50) 0%, #f8f9fa 100%);
    border: 1px solid var(--sage-200);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

/* Removed hover effects to prevent clickable appearance */

/* Removed bullet points */

.guide-option-content {
    width: 100%;
}

.guide-option strong {
    color: var(--sage-700);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    line-height: 1.2;
}

.guide-option small {
    color: var(--sage-500);
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Guide Link Button */
.guide-image-link {
    margin: 1rem 0;
    text-align: center;
}

.guide-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--sage-500);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid var(--sage-500);
}

.guide-link-btn:hover {
    background: var(--sage-600);
    border-color: var(--sage-600);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 91, 77, 0.3);
}

.guide-link-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(107, 91, 77, 0.3);
}

.guide-link-btn i {
    font-size: 0.8rem;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex: 1;
    padding: 0.5rem;
    margin: 0 -0.5rem 1rem -0.5rem;
}

.checkbox-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Hair type grid - 3 columns, 4 rows for 12 options */
#step1 .options-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

/* Other single-choice questions - 3 columns */
#step2 .options-grid,
#step3 .options-grid,
#step4 .options-grid,
#step6 .options-grid,
#step8 .options-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Checkbox questions - 2 columns */
#step5 .options-grid,
#step7 .options-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Option Cards */
.option-card {
    position: relative;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.option-card:hover {
    border-color: var(--sage-300);
    background: var(--sage-50);
    box-shadow: 0 8px 25px rgba(107, 91, 77, 0.1);
}

.option-card:has(.option-input:checked) {
    border-color: var(--sage-600);
    background: linear-gradient(135deg, var(--sage-50) 0%, var(--cream) 100%);
    box-shadow: 0 4px 15px rgba(107, 91, 77, 0.2);
}

.option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-label {
    display: block;
    cursor: pointer;
    width: 100%;
}

.option-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sage-700);
    margin-bottom: 0.25rem;
}

.option-desc {
    font-size: 0.85rem;
    color: var(--sage-600);
    line-height: 1.3;
}

/* Checkbox Cards */
.checkbox-card {
    border-radius: 10px;
    padding: 0.875rem;
    min-height: 70px;
}

.checkbox-card .option-title {
    font-size: 0.95rem;
}

.checkbox-card .option-desc {
    font-size: 0.8rem;
}

/* Input Section */
.input-section {
    max-width: 500px;
    margin: 0 auto;
}

.input-group {
    position: relative;
}

.location-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    color: var(--text-body);
    transition: all 0.3s ease;
}

.location-input:focus {
    outline: none;
    border-color: var(--sage-500);
    box-shadow: 0 0 0 3px rgba(107, 91, 77, 0.1);
    background: #fafafa;
}

.location-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
    font-style: italic;
}

.location-input:focus::placeholder {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.email-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    color: var(--text-body);
    transition: all 0.3s ease;
}

.email-input:focus {
    outline: none;
    border-color: var(--sage-500);
    box-shadow: 0 0 0 3px rgba(107, 91, 77, 0.1);
    background: #fafafa;
}

.email-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
    font-style: italic;
}

.email-input:focus::placeholder {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

/* Disable browser validation styling */
.email-input:invalid {
    box-shadow: none;
    border-color: #e9ecef;
}

.email-input:invalid:focus {
    border-color: var(--sage-500);
    box-shadow: 0 0 0 3px rgba(107, 91, 77, 0.1);
}

/* Privacy Note */
.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(122, 154, 138, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(122, 154, 138, 0.15);
    font-size: 0.85rem;
    color: var(--sage-600);
    font-weight: 500;
    text-align: center;
}

.privacy-note i {
    color: var(--sage-500);
    font-size: 0.9rem;
}

.privacy-note span {
    line-height: 1.3;
}

/* Email Benefits */
.email-benefits {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(122, 154, 138, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(122, 154, 138, 0.1);
}

.benefit-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-body);
}

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

.benefit-item i {
    color: var(--sage-600);
    margin-right: 0.75rem;
    font-size: 1rem;
}

.benefit-item span {
    font-weight: 500;
}

.input-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--sage-500);
    margin-top: 0.75rem;
}

/* Navigation */
.quiz-navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    gap: 1rem;
}

.quiz-navigation:has(.back-btn) {
    justify-content: space-between;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.back-btn:hover {
    background: var(--sage-50);
    border-color: var(--sage-300);
    color: var(--sage-600);
}

.next-btn, .submit-btn {
    background: linear-gradient(135deg, #6F8B7B 0%, #5A7264 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(111, 139, 123, 0.2);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

.next-btn:hover, .submit-btn:hover {
    box-shadow: 0 6px 25px rgba(111, 139, 123, 0.3);
    color: white !important;
}

.next-btn:focus, .submit-btn:focus {
    color: white !important;
}

.submit-btn.loading {
    opacity: 0.8;
    pointer-events: none;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

/* Ring Loading Spinner */
.ring-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: ringSpin 1s linear infinite !important;
    margin-right: 8px;
    display: inline-block;
}

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

.loading-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.submit-btn {
    background: linear-gradient(135deg, var(--terracotta-600) 0%, var(--terracotta-700) 100%);
    box-shadow: 0 4px 20px rgba(204, 85, 51, 0.2);
}

.submit-btn:hover {
    box-shadow: 0 6px 25px rgba(204, 85, 51, 0.3);
}

/* Error Messages - High Specificity to Override Bootstrap */
.quiz-container .error-message,
.question-step .error-message,
.question-header .error-message {
    background: linear-gradient(135deg, #fef7f0 0%, #fdf2e9 100%) !important;
    color: var(--sage-700) !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 12px !important;
    border: 1px solid var(--sage-200) !important;
    margin-top: 1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    animation: gentleSlideDown 0.4s ease !important;
    box-shadow: 0 4px 12px rgba(107, 91, 77, 0.12) !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    position: relative !important;
    overflow: hidden !important;
    z-index: 10 !important;
}

.quiz-container .error-message::before,
.question-step .error-message::before,
.question-header .error-message::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 4px !important;
    background: linear-gradient(180deg, var(--sage-500) 0%, var(--sage-600) 100%) !important;
    border-radius: 2px 0 0 2px !important;
}

.quiz-container .error-message i,
.question-step .error-message i,
.question-header .error-message i {
    color: var(--sage-600) !important;
    font-size: 1.1rem !important;
    margin-left: 0.5rem !important;
    flex-shrink: 0 !important;
}

.quiz-container .error-message span,
.question-step .error-message span,
.question-header .error-message span {
    flex: 1 !important;
    line-height: 1.4 !important;
}

@keyframes gentleSlideDown {
    from { 
        opacity: 0; 
        transform: translateY(-8px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem 0;
    }
    
    .quiz-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
        min-height: auto;
        max-height: none;
        overflow-y: visible;
    }
    
    .question-title {
        font-size: 1.4rem;
    }
    
    .question-description {
        font-size: 0.95rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }
    
    .option-card {
        padding: 0.875rem;
        min-height: 60px;
    }
    
    .quiz-navigation {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .progress-section {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .quiz-card {
        padding: 1rem 0.75rem;
        overflow-y: visible;
    }
    
    .question-title {
        font-size: 1.3rem;
    }
    
    .option-card {
        padding: 0.75rem;
        min-height: 55px;
    }
    
    .nav-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Accessibility */
.option-card:focus-within {
    outline: 2px solid var(--sage-500);
    outline-offset: 2px;
}

.nav-btn:focus {
    outline: 2px solid var(--sage-500);
    outline-offset: 2px;
}

/* Loading States */
.nav-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Smooth Transitions */
* {
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
