/* Base styles and variables */
/* 
 * Font loading optimization:
 * - Removed redundant @import for Inter font (already in HTML)
 * - Fixed Acherus Feral font URL to point to actual font file
 */
@font-face {
    font-family: 'Acherus Feral';
    src: url('https://fonts.cdnfonts.com/s/42944/AcherusFeral-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Colors */
    --primary-color: #FFCC00;
    --primary-hover: #FFB800;
    --primary-light: rgba(255, 204, 0, 0.1);
    --primary-shadow: rgba(255, 204, 0, 0.3);
    
    --secondary-color: #f8f9fa;
    --secondary-hover: #e9ecef;
    
    --tertiary-color: #002FA7;
    --tertiary-hover: #2d3748;
    --tertiary-light: rgba(0, 47, 167, 0.05);
    
    --danger-color: #e53e3e;
    --danger-light: rgba(229, 62, 62, 0.1);
    
    --text-color: #1a202c;
    --text-light: #4a5568;
    
    /* Layout */
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --box-shadow-colored: 0 10px 15px -3px var(--primary-shadow);
    
    /* Typography */
    --font-family: 'Acherus Feral', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Animations - Grouped all keyframes together for better maintainability */
@keyframes quizEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes resultFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    letter-spacing: 0.025em;
}

/* Quiz container */
.quiz-container {
    width: 100%;
    min-height: calc(100vh - 40px);
    background-color: white;
    overflow: hidden;
    /*border: 1px solid rgba(0, 0, 0, 0.1);*/
    position: relative;
    /*box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);*/
    border-radius: var(--border-radius-lg);
}

/* Quiz container entrance animation */
.quiz-entrance {
    animation: quizEntrance 0.8s ease-out forwards;
}

/* Progress bar */
.progress-container {
    margin:10px;
    width: calc(100% - 30px);
    height: 6px;
    background-color: var(--secondary-color);
    position: absolute;
    top:5px;
    left:5px
}

.progress-bar {
    height: 100%;
    background-color: var(--tertiary-color);
    width: 0;
    transition: width 0.4s ease-out;
}

/* Slides container */
.slides-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#slide-0{
    background-color: var(--primary-color);
    border-radius: var(--border-radius-lg);
}

/* Individual slide */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 40px);
    opacity: 0;
    visibility: hidden;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    pointer-events: auto;
    position: relative;
}

/* Slide content animations */
.content-fade-in {
    animation: contentFadeIn 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

/* Slide content */
.slide-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.slide-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--tertiary-color);
    margin-bottom:50px;
}

.slide-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Options styling */
.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 2rem;
}

/* Option styling - Simplified and optimized */
.option {
    background-color: var(--tertiary-light);
    border-radius: 8px;
    padding: 1rem 0.875rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 140px;
    height: 100%;
    border: 5px solid transparent;
}

.option:hover {
    border-color: var(--tertiary-light);
}

.option.selected {
    background-color: var(--primary-color);
    box-shadow: var(--box-shadow-colored);
    border-color: transparent;
}

.option input[type="radio"] {
    display: none;
}

.option label {
    cursor: pointer;
    display: block;
    width: 100%;
    font-weight: 500; /* Medium weight for better readability */
    margin-top: 0; /* No margin needed with flex-start layout */
    padding: 0.5rem 0.25rem 0.75rem; /* Padding all around for better spacing */
    color: var(--tertiary-color); /* Tailwind gray-700 - better contrast */
    font-size: 0.875rem; /* 14px - standard Tailwind text-sm */
    line-height: 1.25; /* Better line height for multi-line labels */
    transition: all 0.2s ease;
    letter-spacing: -0.01em; /* Slightly tighter tracking for professional look */
    flex-grow: 1; /* Take up remaining space */
    display: flex;
    align-items: center;
    justify-content: center; /* Center text vertically and horizontally */
}

.option:hover label {
    color: var(--tertiary-color);
}

.option.selected label {
    color: var(--tertiary-color);
    font-weight: 600; /* Semibold instead of bold - more subtle */
}

/* Add option icons - Yellow circles */
.option .icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 15px;
    background-color: transparent; /* Yellow background */
    border-radius: 50%; /* Circular shape */
    color: var(--tertiary-color);
    transition: all 0.2s ease;
}

.option .icon-container i,
.option .icon-container svg {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

.option:hover .icon-container {
    color: var(--tertiary-color);
}

.option.selected .icon-container {
    background-color: transparent;
    color: var(--tertiary-color);
    border-color: var(--primary-hover);
    box-shadow: none; /* Yellow-tinted shadow */
}


/* Icon classes are now directly in the HTML */

/* Checkbox styling */
.checkbox-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 2rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background-color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.checkbox-option:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow-lg);
}

.checkbox-option.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: var(--box-shadow-colored);
}

.checkbox-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    position: relative;
    background-color: white;
    flex-shrink: 0;
}

.checkbox-option:hover input[type="checkbox"] {
    border-color: var(--primary-hover);
}

.checkbox-option input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-option input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg) scale(0);
    opacity: 0;
}

.checkbox-option input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: translate(-50%, -60%) rotate(45deg) scale(1);
}

.checkbox-option label {
    cursor: pointer;
    font-weight: 500;
    flex-grow: 1;
}

.checkbox-option:hover label {
    color: var(--primary-color);
}

.checkbox-option.selected label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Consent container specific styling */
.consent-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 2rem;
}

.consent-container .checkbox-option {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
}

.consent-container .checkbox-option input[type="checkbox"] {
    margin-top: 2px;
}

/* Form inputs */
.question-group {
    margin-bottom: 2rem;
    position: relative;
}

.question-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.question-group input[type="text"],
.question-group input[type="email"],
.question-group input[type="tel"],
.question-group input[type="url"] {
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 2px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    background-color: rgba(67, 97, 238, 0.03);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) inset;
}

.question-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    background-color: rgba(67, 97, 238, 0.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03) inset;
}

.question-group input:focus + label,
.question-group input:not(:placeholder-shown) + label {
    transform: translateY(-24px) scale(0.85);
    color: var(--primary-color);
}

.question-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.question-group:focus-within::after {
    width: 100%;
}

/* Input styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Common input styles */
.input-group,
.floating-label {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input,
.floating-label input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background-color: white;
    color: var(--text-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    appearance: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.input-group input:focus,
.floating-label input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2);
    background-color: white;
}

.input-group label,
.floating-label label {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    color: var(--text-light);
    font-weight: 500;
    pointer-events: none;
    transform-origin: left top;
    font-size: 0.95rem;
    transition: transform 0.3s ease, color 0.3s ease, font-weight 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.floating-label input:focus ~ label,
.floating-label input:not(:placeholder-shown) ~ label {
    transform: translateY(-1.4rem) scale(0.85);
    color: var(--primary-color);
    font-weight: 600;
    background-color: white;
    padding: 0 0.25rem;
}

/* Error states */
.input-group.error input,
.floating-label.error input,
.question-group.error input {
    border-color: var(--danger-color);
    background-color: var(--danger-light);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--tertiary-color);
    box-shadow: 0 4px 6px -1px rgba(255, 204, 0, 0.3), 0 2px 4px -1px rgba(255, 204, 0, 0.2);
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(255, 204, 0, 0.3), 0 4px 6px -2px rgba(255, 204, 0, 0.2);
}

.btn-secondary {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-tertiary {
    background-color: var(--tertiary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(26, 32, 44, 0.2), 0 2px 4px -1px rgba(26, 32, 44, 0.1);
}

.btn-tertiary:hover {
    background-color: var(--tertiary-hover);
    box-shadow: 0 10px 15px -3px rgba(26, 32, 44, 0.2), 0 4px 6px -2px rgba(26, 32, 44, 0.1);
}

.btn-next::after, 
.btn-submit::after {
    content: '→';
    margin-left: 0.5rem;
    font-size: 1.2em;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* Results screen styling */
.result-content {
    text-align: center;
}

.result-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2.5rem;
}

/* Result elements animation */
.result-fade-in {
    animation: resultFadeIn 0.7s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.result-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--box-shadow-lg);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), #4299e1);
    background-size: 200% 200%;
}

.result-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), #4299e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
}

.result-icon::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background-color: var(--primary-light);
    border-radius: 50%;
    z-index: -1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.result-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--tertiary-color);
}

.result-description {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 90%;
    margin: 0 auto;
}

.result-actions {
    margin-top: 2rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.action-btn {
    text-decoration: none;
    padding: 18px 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
}

.action-btn i {
    font-size: 1.2rem;
}

/* Responsive adjustments - Optimized and organized by component type */
@media (max-width: 768px) {
    /* Layout adjustments */
    .slide {
        padding: 30px 20px;
    }

    .slide-content{
        margin-top:75px;
    }
    
    /* Typography adjustments */
    .slide-title {
        font-size: 3rem;
    }
    
    .slide-description {
        font-size: 1rem;
    }
    
    /* Button and navigation adjustments */
    .navigation-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    /* Grid adjustments */
    .options-container,
    .checkbox-container {
        grid-template-columns: 1fr;
    }
    
    /* Icon adjustments */
    .result-icon::after {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    /* Layout adjustments for smaller screens */
    .slide {
        padding: 20px 15px;
    }
    
    .slide-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .option, 
    .checkbox-option {
        padding: 12px;
    }
    
    /* Button adjustments for smaller screens */
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    /* Form input adjustments for smaller screens */
    .floating-label input,
    .input-group input {
        padding: 14px 16px;
    }
    
    .floating-label label,
    .input-group label {
        top: 14px;
        left: 16px;
    }
}