/* Viewport Optimization - Compact Header Design */

/* Smaller, more compact quiz header */
.aqs-quiz-header {
    text-align: center;
    margin-bottom: 20px; /* Reduced from 40px */
    padding: 15px 20px 10px; /* Reduced from 30px 20px 20px */
    border-bottom: 1px solid #e9ecef; /* Thinner border */
}

.aqs-quiz-title {
    font-size: 1.4em; /* Reduced from 2.2em */
    color: #2c3e50;
    margin-bottom: 8px; /* Reduced from 15px */
    font-weight: 600;
    line-height: 1.1; /* Tighter line height */
}

/* Make description collapsible/hidden by default on small screens */
.aqs-quiz-description {
    font-size: 0.95em; /* Reduced from 1.1em */
    color: #6c757d;
    line-height: 1.4; /* Reduced from 1.6 */
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* Tooltip-style expandable description */
.aqs-quiz-description-compact {
    display: none; /* Hidden by default, shown via tooltip */
}

.aqs-quiz-description-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #007cba;
    font-size: 0.9em;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.aqs-quiz-description-toggle:hover {
    background: rgba(0, 124, 186, 0.1);
}

.aqs-quiz-description-toggle::after {
    content: " ℹ️";
    margin-left: 4px;
}

/* Compact progress bar */
.aqs-progress-container {
    margin: 15px 0; /* Reduced from 30px */
    padding: 0 10px;
}

.aqs-progress-bar {
    height: 8px; /* Reduced from 10px */
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px; /* Reduced from 12px */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.aqs-progress-text {
    font-size: 0.9em; /* Reduced from 1em */
    margin-top: 6px; /* Reduced from 8px */
}

/* Compact step content */
.aqs-step-content {
    background: #fff;
    border-radius: 12px;
    padding: 25px 30px; /* Reduced from 40px */
    border: 1px solid #e9ecef;
    position: relative;
    min-height: 350px; /* Reduced from 400px */
}

/* Optimize question layout for viewport */
.aqs-question {
    margin-bottom: 20px; /* Reduced from 30px */
}

.aqs-question-title {
    font-size: 1.2em; /* Slightly reduced from 1.4em */
    margin-bottom: 20px; /* Reduced from 25px */
    line-height: 1.2;
}

/* Tooltip System for Instructions and Keyboard Shortcuts */

/* Base tooltip styles */
.aqs-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.aqs-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    margin-left: 6px;
    cursor: help;
    transition: all 0.2s ease;
}

.aqs-tooltip-trigger:hover {
    background: #005a87;
    transform: scale(1.1);
}

.aqs-tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    pointer-events: none;
}

.aqs-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
}

.aqs-tooltip:hover .aqs-tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Keyboard shortcut tooltips for answer options */
.aqs-answer-option .aqs-keyboard-tooltip {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: monospace;
}

.aqs-answer-option:hover .aqs-keyboard-tooltip,
.aqs-answer-option:focus-within .aqs-keyboard-tooltip {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Instruction tooltips */
.aqs-instruction-tooltip {
    background: #ffc107;
    color: #212529;
}

.aqs-instruction-tooltip .aqs-tooltip-trigger {
    background: #ffc107;
    color: #212529;
}

.aqs-instruction-tooltip .aqs-tooltip-trigger:hover {
    background: #e0a800;
}

.aqs-instruction-tooltip .aqs-tooltip-content {
    background: #212529;
    color: #ffc107;
    border: 1px solid #ffc107;
}

.aqs-instruction-tooltip .aqs-tooltip-content::after {
    border-top-color: #212529;
}

/* Viewport optimization for different screen sizes */
@media (min-width: 768px) {
    /* Larger screens can have slightly more spacing */
    .aqs-quiz-header {
        margin-bottom: 25px;
        padding: 15px 20px 15px;
    }
    
    .aqs-step-content {
        padding: 35px 50px;
        min-height: 400px;
    }
    
    .aqs-quiz-title {
        font-size: 1.4em;
        margin-bottom: 10px;
    }
    
    .aqs-quiz-description {
        font-size: 1em;
    }
    
    /* Show keyboard tooltips more prominently on larger screens */
    .aqs-answer-option .aqs-keyboard-tooltip {
        opacity: 0.6;
    }
}

@media (max-width: 767px) {
    /* Mobile: Ultra-compact for maximum viewport usage */
    .aqs-quiz-header {
        margin-bottom: 15px;
        padding: 10px 15px 8px;
    }
    
    .aqs-quiz-title {
        font-size: 1.6em;
        margin-bottom: 6px;
    }
    
    .aqs-quiz-description {
        font-size: 0.9em;
        line-height: 1.3;
    }
    
    .aqs-step-content {
        padding: 20px 15px;
        min-height: 300px;
    }
    
    .aqs-progress-container {
        margin: 10px 0;
    }
    
    .aqs-progress-bar {
        height: 6px;
    }
    
    /* Hide keyboard tooltips on mobile */
    .aqs-answer-option .aqs-keyboard-tooltip {
        display: none;
    }
    
    /* Compact tooltips for mobile */
    .aqs-tooltip-content {
        max-width: 250px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Specific height optimization for common screen sizes */
@media (min-height: 600px) and (max-height: 768px) {
    /* Tablets in landscape, small laptops */
    .aqs-quiz-container {
        margin: 20px auto;
    }
    
    .aqs-step-content {
        min-height: 350px;
    }
}

@media (min-height: 769px) {
    /* Larger screens can afford more space */
    .aqs-quiz-container {
        margin: 30px auto;
    }
    
    .aqs-step-content {
        min-height: 450px;
    }
}

/* Animation for smooth tooltip appearance */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
}

.aqs-tooltip:hover .aqs-tooltip-content {
    animation: tooltipFadeIn 0.3s ease-out;
}

/* Collapsible description for mobile */
.aqs-description-collapsed {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.aqs-description-expanded {
    max-height: 200px;
    transition: max-height 0.3s ease;
}

/* Focus management for tooltips */
.aqs-tooltip-trigger:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.aqs-tooltip-trigger:focus + .aqs-tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .aqs-tooltip-content {
        background: #000;
        border: 2px solid #fff;
    }
    
    .aqs-tooltip-trigger {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .aqs-tooltip-content,
    .aqs-tooltip-trigger,
    .aqs-keyboard-tooltip {
        transition: none;
        animation: none;
    }
    
    .aqs-tooltip:hover .aqs-tooltip-content {
        transform: translateX(-50%);
    }
}
/* Advanced Quiz System Styles - Enhanced Two-Column Layout */

/* Quiz Container - Centered and Optimized */
.aqs-quiz-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Center on page with proper spacing */
    display: block;
    box-sizing: border-box;
    
    /* Subtle shadow for better definition */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #fff;
}

/* Quiz Header */
.aqs-quiz-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px 20px;
    border-bottom: 2px solid #e9ecef;
}

.aqs-quiz-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.aqs-quiz-description {
    font-size: 1.1em;
    color: #6c757d;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Progress Bar - Enhanced */
.aqs-progress-container {
    margin: 30px 0;
    padding: 0 10px;
}

.aqs-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aqs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 5px;
    transition: width 0.4s ease;
    position: relative;
}

.aqs-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.aqs-progress-text {
    text-align: center;
    font-size: 1em;
    color: #2c3e50;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.aqs-progress-percentage {
    font-size: 1.1em;
    color: #007cba;
    transition: all 0.3s ease;
}

.aqs-progress-percentage.aqs-progress-medium {
    color: #ffc107;
    transform: scale(1.05);
}

.aqs-progress-percentage.aqs-progress-high {
    color: #28a745;
    transform: scale(1.1);
    text-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Step System - Improved Transitions */
.aqs-step {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 400px; /* Prevent layout jumping */
}

.aqs-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.aqs-step.prev {
    transform: translateX(-20px);
}

.aqs-step-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    border: 1px solid #e9ecef;
    position: relative;
}

/* Enhanced Form Elements */
.aqs-form-row {
    margin-bottom: 25px;
}

.aqs-form-row-half {
    display: inline-block;
    width: calc(50% - 10px);
    margin-right: 20px;
    vertical-align: top;
}

.aqs-form-row-half:last-child {
    margin-right: 0;
}

.aqs-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
}

.aqs-form-row input[type="text"],
.aqs-form-row input[type="email"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fff;
}

.aqs-form-row input[type="text"]:focus,
.aqs-form-row input[type="email"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
    transform: translateY(-1px);
}

.required {
    color: #dc3545;
}

/* Question Styles - Enhanced for Two-Column Layout */
.aqs-question {
    margin-bottom: 30px;
}

.aqs-question-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 25px;
    line-height: 1.2;
    font-weight: 600;
}

.aqs-question-number {
    color: #007cba;
    font-weight: 700;
    margin-right: 10px;
    display: inline-block;
    min-width: 30px;
}

.aqs-question-instruction {
    font-style: italic;
    color: #6c757d;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
    font-size: 0.95em;
}

/* Answer Options - Enhanced Two-Column Layout */
.aqs-answers {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aqs-answer-option {
    display: block;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.aqs-answer-option:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.15);
}

.aqs-answer-option:active {
    transform: translateY(0);
}

.aqs-answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.aqs-answer-option input[type="radio"]:checked + .aqs-answer-label {
    color: #007cba;
    font-weight: 600;
}

.aqs-answer-option:has(input:checked) {
    background: #e7f3ff;
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

.aqs-answer-label {
    display: flex;
    align-items: center;
    font-size: 1.05em;
    line-height: 1.5;
    color: #2c3e50;
    transition: color 0.3s ease;
    width: 100%;
}

.aqs-answer-letter,
.aqs-answer-number {
    display: inline-block;
    min-width: 35px;
    font-weight: 700;
    color: #6c757d;
    margin-right: 15px;
    font-size: 1.1em;
}

/* Two-Column Layout for Tablets and Larger Screens */
@media (min-width: 768px) {
    /* Enhanced container for larger screens */
    .aqs-quiz-container {
        max-width: 900px;
        margin: 50px auto;
        padding: 30px;
    }
    
    /* Two-column layout when there are 4+ answers - Row-first direction */
    .aqs-answers:has(.aqs-answer-option:nth-child(4)) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(auto-fit, minmax(60px, auto));
        gap: 15px 25px; /* row gap, column gap */
        margin-bottom: 0;
    }
    
    /* Force the row-first order manually for 4 answers */
    .aqs-answers:has(.aqs-answer-option:nth-child(4)):not(:has(.aqs-answer-option:nth-child(5))) .aqs-answer-option:nth-child(1) { grid-area: 1 / 1; } /* A - Row 1, Col 1 */
    .aqs-answers:has(.aqs-answer-option:nth-child(4)):not(:has(.aqs-answer-option:nth-child(5))) .aqs-answer-option:nth-child(2) { grid-area: 1 / 2; } /* B - Row 1, Col 2 */
    .aqs-answers:has(.aqs-answer-option:nth-child(4)):not(:has(.aqs-answer-option:nth-child(5))) .aqs-answer-option:nth-child(3) { grid-area: 2 / 1; } /* C - Row 2, Col 1 */
    .aqs-answers:has(.aqs-answer-option:nth-child(4)):not(:has(.aqs-answer-option:nth-child(5))) .aqs-answer-option:nth-child(4) { grid-area: 2 / 2; } /* D - Row 2, Col 2 */
    
    /* Remove bottom margin since grid gap handles spacing */
    .aqs-answers .aqs-answer-option {
        margin-bottom: 0;
    }
    
    /* Handle odd number of answers elegantly */
    .aqs-answers:has(.aqs-answer-option:nth-child(5):last-child) .aqs-answer-option:last-child {
        grid-column: 1 / -1; /* Span full width for last odd answer */
        max-width: calc(50% - 12.5px); /* Keep same width as other answers */
        justify-self: center; /* Center the last answer */
    }
    
    /* Manual positioning for 5 answers - A,B in left column, C,D,E in right */
    .aqs-answers:has(.aqs-answer-option:nth-child(5)):not(:has(.aqs-answer-option:nth-child(6))) .aqs-answer-option:nth-child(1) { grid-area: 1 / 1; } /* A */
    .aqs-answers:has(.aqs-answer-option:nth-child(5)):not(:has(.aqs-answer-option:nth-child(6))) .aqs-answer-option:nth-child(2) { grid-area: 2 / 1; } /* B */
    .aqs-answers:has(.aqs-answer-option:nth-child(5)):not(:has(.aqs-answer-option:nth-child(6))) .aqs-answer-option:nth-child(3) { grid-area: 1 / 2; } /* C */
    .aqs-answers:has(.aqs-answer-option:nth-child(5)):not(:has(.aqs-answer-option:nth-child(6))) .aqs-answer-option:nth-child(4) { grid-area: 2 / 2; } /* D */
    .aqs-answers:has(.aqs-answer-option:nth-child(5)):not(:has(.aqs-answer-option:nth-child(6))) .aqs-answer-option:nth-child(5) { grid-area: 3 / 1 / 3 / 3; } /* E - Span both columns */
    
    /* Enhanced question layout for larger screens */
    .aqs-question {
        margin-bottom: 40px;
    }
    
    .aqs-question-title {
        font-size: 1.2em;
        margin-bottom: 30px;
        text-align: center;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .aqs-question-instruction {
        margin-bottom: 30px;
        text-align: center;
        max-width: 80%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .aqs-step-content {
        padding: 50px 60px;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .aqs-form-actions {
        margin-top: 50px;
        justify-content: center;
        gap: 25px;
    }
    
    /* Enhanced hover effects for larger screens */
    .aqs-answer-option:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 124, 186, 0.2);
    }
    
    .aqs-answer-option:has(input:checked) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 124, 186, 0.3);
    }
    
    /* Progress bar improvements */
    .aqs-progress-container {
        max-width: 600px;
        margin: 30px auto;
    }
    
    .aqs-progress-bar {
        height: 12px;
    }
    
    /* Typography improvements */
    .aqs-quiz-title {
        font-size: 1.6em;
    }
    
    .aqs-quiz-description {
        font-size: 1.2em;
    }
    
    .aqs-answer-label {
        font-size: 1.1em;
    }
}

/* Likert Scale Specific Improvements - Keep Vertical */
@media (min-width: 768px) {
    .aqs-answers-likert_scale {
        /* Keep Likert scales in single column for better readability */
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        grid-template-columns: none; /* Override grid for Likert scales */
        grid-template-rows: none;
    }
    
    .aqs-answers-likert_scale .aqs-answer-option {
        margin-bottom: 0;
        padding: 18px 24px;
        min-height: 65px;
        width: 100% !important; /* Force full width */
        max-width: none !important; /* Override any max-width restrictions */
        display: flex !important; /* Ensure flex display */
        align-items: center;
        grid-column: unset !important; /* Remove any grid positioning */
        grid-row: unset !important; /* Remove any grid positioning */
        justify-self: unset !important; /* Remove any grid justification */
    }
    
    .aqs-answers-likert_scale .aqs-answer-label {
        font-size: 1.05em;
        justify-content: flex-start;
        width: 100%;
        display: flex;
        align-items: center;
    }
    
    .aqs-answers-likert_scale .aqs-answer-number {
        margin-right: 15px;
        font-size: 1.2em;
        min-width: 35px;
        flex-shrink: 0;
    }
    
    /* Specifically override any 5th answer positioning for Likert scales */
    .aqs-answers-likert_scale .aqs-answer-option:nth-child(5) {
        width: 100% !important;
        max-width: none !important;
        grid-column: unset !important;
        grid-area: unset !important;
        justify-self: unset !important;
    }
}

/* Three-Column Layout for Very Large Screens (Optional) */
@media (min-width: 1200px) {
    .aqs-quiz-container {
        max-width: 1000px;
    }
    
    /* Three columns for 6+ answers on very large screens */
    .aqs-answers:has(.aqs-answer-option:nth-child(6)) {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 15px 20px;
    }
    
    /* Handle remainders for 3-column layout */
    .aqs-answers:has(.aqs-answer-option:nth-child(7):last-child) .aqs-answer-option:last-child {
        grid-column: 2 / 3; /* Center the last answer in middle column */
        justify-self: center;
    }
    
    .aqs-answers:has(.aqs-answer-option:nth-child(8):last-child) .aqs-answer-option:nth-last-child(2),
    .aqs-answers:has(.aqs-answer-option:nth-child(8):last-child) .aqs-answer-option:last-child {
        grid-column: span 1; /* Keep last two answers in separate columns */
    }
}

/* Enhanced Keyboard Navigation Hints */
.aqs-answer-option::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    font-family: monospace;
}

/* Show keyboard hints on larger screens */
@media (min-width: 768px) {
    .aqs-answer-option::after {
        opacity: 0.6;
    }
    
    .aqs-answer-option:hover::after {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Keyboard hint content for multiple choice */
.aqs-answers-multiple_choice .aqs-answer-option:nth-child(1)::after { content: 'A'; }
.aqs-answers-multiple_choice .aqs-answer-option:nth-child(2)::after { content: 'B'; }
.aqs-answers-multiple_choice .aqs-answer-option:nth-child(3)::after { content: 'C'; }
.aqs-answers-multiple_choice .aqs-answer-option:nth-child(4)::after { content: 'D'; }
.aqs-answers-multiple_choice .aqs-answer-option:nth-child(5)::after { content: 'E'; }

/* Keyboard hint content for Likert scale */
.aqs-answers-likert_scale .aqs-answer-option:nth-child(1)::after { content: '1'; }
.aqs-answers-likert_scale .aqs-answer-option:nth-child(2)::after { content: '2'; }
.aqs-answers-likert_scale .aqs-answer-option:nth-child(3)::after { content: '3'; }
.aqs-answers-likert_scale .aqs-answer-option:nth-child(4)::after { content: '4'; }
.aqs-answers-likert_scale .aqs-answer-option:nth-child(5)::after { content: '5'; }

/* Button Styles - Enhanced */
.aqs-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
    gap: 15px;
}

.aqs-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    text-align: center;
}

.aqs-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.aqs-btn-primary {
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.aqs-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87, #004066);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
    transform: translateY(-2px);
}

.aqs-btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.aqs-btn-secondary:hover:not(:disabled) {
    background: #545b62;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    transform: translateY(-2px);
}

/* Loading States */
.aqs-loading {
    text-align: center;
    padding: 80px 20px;
}

.aqs-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.aqs-results-content {
    padding: 30px 0;
}

.aqs-result-header {
    text-align: center;
    margin-bottom: 40px;
}

.aqs-result-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.aqs-result-subtitle {
    font-size: 1.3em;
    color: #007cba;
    font-weight: 600;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .aqs-quiz-container {
        margin: 20px auto;
        padding: 15px;
        border-radius: 8px;
    }
    
    .aqs-step-content {
        padding: 25px 20px;
    }
    
    .aqs-quiz-title {
        font-size: 1.6em;
    }
    
    .aqs-question-title {
        font-size: 1.1em;
        margin-bottom: 20px;
        text-align: left;
    }
    
    .aqs-form-row-half {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .aqs-form-actions {
        flex-direction: column-reverse;
        gap: 15px;
    }
    
    .aqs-btn {
        width: 100%;
        padding: 18px 20px;
        font-size: 1.1em;
    }
    
    .aqs-answer-option {
        padding: 15px 20px;
        min-height: 65px;
    }
    
    .aqs-answer-label {
        font-size: 1.05em;
    }
    
    .aqs-answer-letter,
    .aqs-answer-number {
        min-width: 30px;
        margin-right: 12px;
    }
    
    .aqs-result-title {
        font-size: 2em;
    }
    
    .aqs-result-subtitle {
        font-size: 1.2em;
    }
    
    /* Hide keyboard hints on mobile */
    .aqs-answer-option::after {
        display: none;
    }
    
    /* Better spacing on mobile */
    .aqs-quiz-header {
        padding: 20px 15px 15px;
        margin-bottom: 30px;
    }
    
    .aqs-question-instruction {
        padding: 15px;
        margin-bottom: 20px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .aqs-quiz-container {
        margin: 10px auto;
        padding: 10px;
    }
    
    .aqs-step-content {
        padding: 20px 15px;
    }
    
    .aqs-quiz-title {
        font-size: 1.6em;
        line-height: 1.3;
    }
    
    .aqs-question-title {
        font-size: 1.2em;
    }
    
    .aqs-result-title {
        font-size: 1.8em;
    }
    
    .aqs-answer-option {
        padding: 15px 18px;
    }
    
    .aqs-btn {
        padding: 16px 20px;
    }
}

/* Focus Styles for Accessibility */
.aqs-answer-option:focus-within {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.aqs-btn:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

/* Custom Radio Button Styling */
.aqs-answer-option input[type="radio"] + .aqs-answer-label::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #007cba;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    background: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.aqs-answer-option input[type="radio"]:checked + .aqs-answer-label::before {
    background: #007cba;
    box-shadow: inset 0 0 0 4px white;
}

/* Enhanced keyboard selection feedback */
.aqs-answer-option.aqs-keyboard-selected {
    background: #007cba !important;
    color: white !important;
    border-color: #005a87 !important;
    transform: scale(1.02);
    animation: keyboardSelection 0.8s ease-out;
}

.aqs-answer-option.aqs-keyboard-selected .aqs-answer-label {
    color: white !important;
}

.aqs-answer-option.aqs-keyboard-selected .aqs-answer-letter,
.aqs-answer-option.aqs-keyboard-selected .aqs-answer-number {
    color: #e7f3ff !important;
}

@keyframes keyboardSelection {
    0% { 
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0.7);
        transform: scale(1);
    }
    30% { 
        box-shadow: 0 0 0 10px rgba(0, 124, 186, 0.3);
        transform: scale(1.03);
    }
    70% { 
        box-shadow: 0 0 0 20px rgba(0, 124, 186, 0);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(0, 124, 186, 0);
        transform: scale(1.02);
    }
}

/* Print Styles */
@media print {
    .aqs-quiz-container {
        box-shadow: none;
        margin: 0;
        padding: 20px;
    }
    
    .aqs-answers {
        display: block !important;
    }
    
    .aqs-answer-option {
        break-inside: avoid;
        margin-bottom: 10px;
        display: block !important;
    }
    
    .aqs-answer-option::after {
        display: none;
    }
    
    .aqs-form-actions {
        display: none;
    }
}

/* Animation Classes */
.aqs-fade-in {
    animation: fadeIn 0.5s ease-in;
}

.aqs-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.aqs-slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
/* Enhanced Form Validation Styles */

/* Base form field styles */
.aqs-form-row input[type="text"],
.aqs-form-row input[type="email"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fff;
    position: relative;
}

/* Focused state */
.aqs-form-row input[type="text"]:focus,
.aqs-form-row input[type="email"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
    transform: translateY(-1px);
}

/* Valid state (green) */
.aqs-form-row input.aqs-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%2328a745' d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 45px;
}

/* Error state (red) */
.aqs-form-row input.aqs-error {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23dc3545' d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 45px;
    animation: gentlePulse 0.6s ease-in-out;
}

/* Warning state (yellow) */
.aqs-form-row input.aqs-warning {
    border-color: #ffc107;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23ffc107' d='M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-2.008 0L.127 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z'/%3e%3cpath fill='%23ffc107' d='M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 45px;
}

/* Pulse animation for errors */
@keyframes gentlePulse {
    0%, 100% { 
        transform: scale(1);
        border-color: #dc3545;
    }
    50% { 
        transform: scale(1.01);
        border-color: #ff6b7a;
    }
}

/* Enhanced error messages */
.aqs-field-error {
    display: block;
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 6px;
    margin-left: 4px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.aqs-field-warning {
    display: block;
    color: #856404;
    font-size: 0.9em;
    margin-top: 6px;
    margin-left: 4px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.aqs-field-success {
    display: block;
    color: #155724;
    font-size: 0.9em;
    margin-top: 6px;
    margin-left: 4px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

/* Real-time validation indicators */
.aqs-validation-indicator {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aqs-validation-indicator.show {
    opacity: 1;
}

/* Labels with required indicators */
.aqs-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
    position: relative;
}

.aqs-form-row label .required {
    color: #dc3545;
    margin-left: 3px;
    font-weight: 700;
}

/* Floating label effect (optional) */
.aqs-form-row.floating {
    position: relative;
}

.aqs-form-row.floating label {
    position: absolute;
    left: 20px;
    top: 18px;
    background: white;
    padding: 0 8px;
    color: #6c757d;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.aqs-form-row.floating input:focus + label,
.aqs-form-row.floating input:not(:placeholder-shown) + label,
.aqs-form-row.floating input.has-value + label {
    top: -8px;
    left: 16px;
    font-size: 0.85em;
    color: #007cba;
    font-weight: 600;
}

/* Form validation summary */
.aqs-validation-summary {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: none;
}

.aqs-validation-summary.show {
    display: block;
    animation: slideInDown 0.4s ease-out;
}

.aqs-validation-summary h4 {
    color: #721c24;
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.aqs-validation-summary ul {
    margin: 0;
    padding-left: 20px;
    color: #721c24;
}

.aqs-validation-summary li {
    margin-bottom: 5px;
}

/* Success state for entire form */
.aqs-user-info-section.aqs-form-valid {
    border-left: 4px solid #28a745;
    background: rgba(40, 167, 69, 0.05);
}

/* Enhanced button states */
.aqs-start-quiz:disabled {
    background: #6c757d !important;
    cursor: not-allowed;
    transform: none !important;
}

.aqs-start-quiz.ready {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
    animation: readyPulse 2s infinite;
}

@keyframes readyPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4); }
    50% { box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6); }
}

/* Accessibility improvements */
.aqs-form-row input[aria-invalid="true"] {
    border-color: #dc3545;
}

.aqs-form-row input[aria-invalid="false"] {
    border-color: #28a745;
}

/* Loading states */
.aqs-form-row.validating input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%236c757d' d='M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z'/%3e%3cpath fill='%236c757d' d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 45px;
}

/* Mobile optimizations */
@media (max-width: 767px) {
    .aqs-form-row input[type="text"],
    .aqs-form-row input[type="email"] {
        padding: 14px 18px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .aqs-field-error,
    .aqs-field-warning,
    .aqs-field-success {
        font-size: 0.85em;
    }
    
    .aqs-validation-summary {
        padding: 12px;
        margin-bottom: 15px;
    }
}

/* Dark mode support
@media (prefers-color-scheme: dark) {
    .aqs-form-row input[type="text"],
    .aqs-form-row input[type="email"] {
        background: #2c3338;
        color: #e0e0e0;
        border-color: #50575e;
    }
    
    .aqs-form-row input[type="text"]:focus,
    .aqs-form-row input[type="email"]:focus {
        border-color: #8fd6ff;
        box-shadow: 0 0 0 4px rgba(143, 214, 255, 0.1);
    }
    
    .aqs-validation-summary {
        background: #432d32;
        border-color: #58424a;
        color: #f8d7da;
    }
} */
 /* Form Validation States */
.aqs-form-row {
    position: relative;
    transition: all 0.3s ease;
}

.aqs-form-row.validating {
    opacity: 0.8;
}

.aqs-form-row.validating::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Input Validation States */
input.aqs-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%2328a745' d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 45px;
}

input.aqs-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
    animation: shake 0.5s ease-in-out;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23dc3545' d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 45px;
}

input.aqs-warning {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23ffc107' d='M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-2.008 0L.127 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z'/%3e%3cpath fill='%23ffc107' d='M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 45px;
}

/* Field Error, Warning, and Success Messages */
.aqs-field-error {
    display: block;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 5px;
    margin-left: 4px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.aqs-field-warning {
    display: block;
    color: #856404;
    font-size: 0.875em;
    margin-top: 5px;
    margin-left: 4px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.aqs-field-success {
    display: block;
    color: #155724;
    font-size: 0.875em;
    margin-top: 5px;
    margin-left: 4px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

/* Validation Summary */
.aqs-validation-summary {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: none;
    animation: slideInDown 0.3s ease-out;
}

.aqs-validation-summary.show {
    display: block;
}

.aqs-validation-summary h4 {
    color: #721c24;
    margin: 0 0 10px 0;
    font-size: 1em;
}

.aqs-validation-summary ul {
    margin: 0;
    padding-left: 20px;
    color: #721c24;
}

.aqs-validation-summary li {
    margin-bottom: 5px;
}

/* Form Valid State */
.aqs-form-valid .aqs-start-quiz {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
    transform: scale(1.02);
}

.aqs-user-info-section.aqs-form-valid {
    border-left: 4px solid #28a745;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
    padding-left: 20px;
}

/* Enhanced Answer Selection Feedback */
.aqs-answer-option.aqs-answer-selected {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Button Ready State */
.aqs-btn.aqs-btn-ready {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
}

/* Auto-advance Button Effects */
.aqs-btn.aqs-auto-advancing {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4) !important;
    animation: autoAdvancePulse 0.8s ease-out;
}

.aqs-btn.aqs-auto-advancing::after {
    content: '⚡';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: bounce 0.6s ease-out;
}

.aqs-btn.aqs-ready-to-submit {
    background: linear-gradient(135deg, #fd7e14, #e55a00) !important;
    border-color: #fd7e14 !important;
    box-shadow: 0 6px 25px rgba(253, 126, 20, 0.4) !important;
}

.aqs-btn.aqs-submit-pulse {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(253, 126, 20, 0.5) !important;
}

/* Auto-advance Notification */
.aqs-auto-advance-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    z-index: 1000;
    animation: slideInRight 0.4s ease-out;
    font-weight: 600;
    font-size: 0.9em;
}

.aqs-auto-advance-notification::before {
    content: '⚡';
    margin-right: 8px;
}

/* Welcome Banner */
.aqs-welcome-banner {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideInDown 0.5s ease-out;
}

.aqs-welcome-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.aqs-welcome-text {
    flex: 1;
    font-weight: 500;
}

.aqs-welcome-help {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.aqs-welcome-help:hover {
    background: rgba(255, 255, 255, 0.3);
}

.aqs-welcome-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.aqs-welcome-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Enhanced Result Percentages */
.aqs-result-percentages {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #007cba;
}

.aqs-percentage-item {
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.aqs-percentage-item.aqs-primary-result {
    background: rgba(0, 124, 186, 0.1);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #007cba;
}

.aqs-percentage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.aqs-percentage-label {
    font-weight: 600;
    color: #2c3e50;
}

.aqs-percentage-value {
    font-weight: 700;
    color: #007cba;
    font-size: 1.1em;
}

.aqs-percentage-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.aqs-percentage-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.aqs-junglecat-fill {
    background: linear-gradient(90deg, #d63384, #b02a5b);
}

.aqs-horse-fill {
    background: linear-gradient(90deg, #198754, #146c43);
}

.aqs-bear-fill {
    background: linear-gradient(90deg, #fd7e14, #e55a00);
}

.aqs-monkey-fill {
    background: linear-gradient(90deg, #6f42c1, #5a2d91);
}

/* Enhanced Keyboard Help Modal */
.aqs-keyboard-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.aqs-keyboard-help-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInUp 0.3s ease-out;
}

.aqs-keyboard-help-modal h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    text-align: center;
}

.aqs-keyboard-shortcuts {
    margin-bottom: 25px;
}

.aqs-shortcut-group {
    margin-bottom: 20px;
}

.aqs-shortcut-group h4 {
    color: #007cba;
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.aqs-shortcut-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 0;
}

.aqs-shortcut-item kbd {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    margin-right: 8px;
    font-family: monospace;
    font-size: 0.9em;
    color: #495057;
    min-width: 30px;
    text-align: center;
}

.aqs-shortcut-item span {
    flex: 1;
    margin-left: 10px;
}

/* Enhanced Button Ready State */
.aqs-start-quiz.ready {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
    animation: readyPulse 2s infinite;
}

/* Validation Animations */
@keyframes gentlePulse {
    0%, 100% { 
        transform: scale(1);
        border-color: #dc3545;
    }
    50% { 
        transform: scale(1.01);
        border-color: #ff6b7a;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes autoAdvancePulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 8px 30px rgba(40, 167, 69, 0.6);
    }
    100% { 
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-8px);
    }
    70% {
        transform: translateY(-4px);
    }
    90% {
        transform: translateY(-2px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes readyPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4); }
    50% { box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6); }
}

/* Loading States for Better UX */
.aqs-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.aqs-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile Optimizations for Form Validation */
@media (max-width: 768px) {
    .aqs-auto-advance-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        font-size: 0.85em;
        padding: 10px 15px;
    }
    
    .aqs-welcome-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .aqs-welcome-help {
        align-self: center;
    }
    
    .aqs-welcome-close {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    .aqs-btn.aqs-auto-advancing::after {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: -6px;
        right: -6px;
    }
    
    .aqs-validation-summary {
        margin: 10px 0;
        padding: 12px;
    }
    
    .aqs-field-error,
    .aqs-field-warning,
    .aqs-field-success {
        font-size: 0.8em;
    }
    
    /* Adjust input padding on mobile to accommodate icons */
    input.aqs-valid,
    input.aqs-error,
    input.aqs-warning {
        padding-right: 40px;
        background-size: 18px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .aqs-answer-option,
    .aqs-btn,
    .aqs-progress-fill,
    .aqs-percentage-fill {
        transition: none !important;
        animation: none !important;
    }
    
    .aqs-field-error,
    .aqs-field-warning,
    .aqs-field-success {
        animation: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    input.aqs-error {
        border-width: 3px !important;
    }
    
    input.aqs-valid {
        border-width: 3px !important;
    }
    
    .aqs-field-error,
    .aqs-field-warning {
        font-weight: bold;
    }
    
    .aqs-validation-summary {
        border-width: 2px;
    }
}

/* Focus Improvements for Form Elements */
input[required]:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.aqs-start-quiz:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

/* Enhanced Tooltip System for Form Help */
.aqs-form-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.aqs-form-tooltip .aqs-tooltip-trigger {
    width: 16px;
    height: 16px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.aqs-form-tooltip .aqs-tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    transition: all 0.3s ease;
}

.aqs-form-tooltip:hover .aqs-tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Print Styles for Form Validation */
@media print {
    .aqs-validation-summary,
    .aqs-field-error,
    .aqs-field-warning,
    .aqs-auto-advance-notification,
    .aqs-welcome-banner {
        display: none !important;
    }
    
    input.aqs-error,
    input.aqs-valid,
    input.aqs-warning {
        border: 1px solid #333 !important;
        background: none !important;
        padding-right: 20px !important;
    }
}
/* ==========================================================================
   FIRST AND LAST NAME SIDE-BY-SIDE LAYOUT - BROWSER COMPATIBLE
   Replace the previous CSS with this version
   ========================================================================== */

/* Side-by-side layout for name fields - using class instead of :has() */
.aqs-form-row.aqs-name-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 25px;
}

.aqs-form-row-half {
    flex: 1;
    min-width: 0;
}

.aqs-form-row-half:last-child {
    margin-right: 0;
}

/* Ensure regular form rows remain full width */
.aqs-form-row:not(.aqs-name-row) {
    margin-bottom: 25px;
}

/* Mobile: Stack vertically on small screens */
@media (max-width: 767px) {
    .aqs-form-row.aqs-name-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .aqs-form-row-half {
        flex: none;
        width: 100%;
    }
}

/* Tablet: Keep side-by-side on medium screens */
@media (min-width: 768px) and (max-width: 1024px) {
    .aqs-form-row.aqs-name-row {
        gap: 15px;
    }
}

/* Validation states for name fields */
.aqs-form-row-half input.aqs-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.aqs-form-row-half input.aqs-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Focus improvements for name fields */
.aqs-form-row-half input:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}
/* ==========================================================================
   WELCOME SCREEN STYLES
   ========================================================================== */

/* Welcome Screen Layout */
.aqs-welcome-screen {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aqs-welcome-hero {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.aqs-welcome-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #2c3e50, #007cba);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.aqs-welcome-description {
    font-size: 1.2em;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Feature Highlights */
.aqs-welcome-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.aqs-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    flex: 1;
    max-width: 150px;
}

.aqs-feature-icon {
    font-size: 2em;
    line-height: 1;
}

.aqs-feature-text {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}

/* Welcome Actions */
.aqs-welcome-actions {
    margin-top: 50px;
}

.aqs-btn-large {
    padding: 20px 40px;
    font-size: 1.3em;
    font-weight: 700;
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.3);
    transition: all 0.3s ease;
}

.aqs-btn-large:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.4);
}

.aqs-keyboard-hint {
    margin-top: 30px;
    font-size: 0.95em;
    color: #6c757d;
    line-height: 1.4;
}

.aqs-link-button {
    background: none;
    border: none;
    color: #007cba;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    margin: 0;
    transition: color 0.3s ease;
}

.aqs-link-button:hover {
    color: #005a87;
}

/* Compact Header for Quiz Progress (Hidden by Default) */
.aqs-quiz-progress-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px 20px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.aqs-quiz-title-small {
    font-size: 1.2em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.2;
}

/* Form Introduction Text */
.aqs-form-intro {
    font-size: 1em;
    color: #6c757d;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
}

/* Enhanced Back Button */
.aqs-back-to-welcome {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.aqs-back-to-welcome:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

/* Mobile Optimizations for Welcome Screen */
@media (max-width: 768px) {
    .aqs-welcome-screen {
        min-height: 400px;
        padding: 20px 0;
    }
    
    .aqs-welcome-hero {
        padding: 20px 15px;
    }
    
    .aqs-welcome-title {
        font-size: 2em;
        margin-bottom: 15px;
    }
    
    .aqs-welcome-description {
        font-size: 1.1em;
        margin-bottom: 30px;
    }
    
    .aqs-welcome-features {
        flex-direction: column;
        gap: 20px;
        margin: 30px 0;
        padding: 15px;
    }
    
    .aqs-feature-item {
        flex-direction: row;
        max-width: none;
        text-align: left;
        padding: 10px;
    }
    
    .aqs-feature-icon {
        font-size: 1.5em;
        margin-right: 15px;
        flex-shrink: 0;
    }
    
    .aqs-feature-text {
        text-align: left;
        margin: 0;
    }
    
    .aqs-btn-large {
        width: 100%;
        padding: 18px 30px;
        font-size: 1.2em;
    }
    
    .aqs-keyboard-hint {
        display: none; /* Hide keyboard hints on mobile */
    }
    
    .aqs-quiz-progress-header {
        padding: 10px 15px 15px;
        margin-bottom: 20px;
        position: relative; /* Remove sticky on mobile */
    }
    
    .aqs-quiz-title-small {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .aqs-form-intro {
        font-size: 0.95em;
        margin-bottom: 25px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .aqs-welcome-title {
        font-size: 1.8em;
        line-height: 1.3;
    }
    
    .aqs-welcome-description {
        font-size: 1em;
    }
    
    .aqs-btn-large {
        padding: 16px 25px;
        font-size: 1.1em;
    }
    
    .aqs-welcome-features {
        margin: 25px 0;
        padding: 12px;
    }
    
    .aqs-feature-item {
        padding: 8px;
    }
    
    .aqs-feature-icon {
        font-size: 1.3em;
    }
    
    .aqs-feature-text {
        font-size: 0.85em;
    }
}

/* Animation for Welcome Screen */
.aqs-welcome-screen.active .aqs-welcome-hero {
    animation: welcomeFadeInUp 0.8s ease-out;
}

@keyframes welcomeFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced transitions for step changes */
.aqs-step.aqs-welcome-exit {
    animation: welcomeFadeOut 0.5s ease-in-out;
}

@keyframes welcomeFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Progressive disclosure - show quiz header when questions start */
.aqs-quiz-container.aqs-questions-active .aqs-quiz-progress-header {
    display: block !important;
}

.aqs-quiz-container.aqs-questions-active .aqs-welcome-screen {
    display: none;
}
/* ==========================================================================
   WELCOME SCREEN STYLES - ADD TO THE END OF YOUR quiz.css FILE
   ========================================================================== */

/* Welcome Screen Layout */
.aqs-welcome-screen {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* Overlay for better text readability on background images */
.aqs-welcome-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.aqs-welcome-hero {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
}

.aqs-welcome-title {
    font-size: 2.5em;
    color: white;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.aqs-welcome-description {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Feature Highlights */
.aqs-welcome-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.aqs-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    flex: 1;
    max-width: 150px;
    transition: transform 0.3s ease;
}

.aqs-feature-item:hover {
    transform: translateY(-5px);
}

.aqs-feature-icon {
    font-size: 2em;
    line-height: 1;
    margin-bottom: 8px;
}

.aqs-feature-text {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}

/* Welcome Actions */
.aqs-welcome-actions {
    margin-top: 50px;
}

.aqs-btn-large {
    padding: 20px 40px;
    font-size: 1.3em;
    font-weight: 700;
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.3);
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.aqs-btn-large:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.4);
    background: linear-gradient(135deg, #005a87, #004066);
}

.aqs-btn-large:active {
    transform: translateY(-1px);
}

.aqs-keyboard-hint {
    margin-top: 30px;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.aqs-link-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    margin: 0;
    transition: color 0.3s ease;
}

.aqs-link-button:hover {
    color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Quiz Progress Header (Hidden by Default, Shown When Questions Start) */
.aqs-quiz-progress-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px 20px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0;
}

.aqs-quiz-title-small {
    font-size: 1.2em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.2;
}

/* Form Introduction Text */
.aqs-form-intro {
    font-size: 1em;
    color: #6c757d;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

/* Enhanced Back Button */
.aqs-back-to-welcome {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
}

.aqs-back-to-welcome:hover:not(:disabled) {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #495057 !important;
    transform: translateY(-2px);
}

/* Mobile Optimizations for Welcome Screen */
@media (max-width: 768px) {
    .aqs-welcome-screen {
        min-height: 400px;
        padding: 20px 0;
        border-radius: 8px;
    }
    
    .aqs-welcome-hero {
        padding: 20px 15px;
    }
    
    .aqs-welcome-title {
        font-size: 2em;
        margin-bottom: 15px;
    }
    
    .aqs-welcome-description {
        font-size: 1.1em;
        margin-bottom: 30px;
    }
    
    .aqs-welcome-features {
        flex-direction: column;
        gap: 20px;
        margin: 30px 0;
        padding: 15px;
    }
    
    .aqs-feature-item {
        flex-direction: row;
        max-width: none;
        text-align: left;
        padding: 10px;
        justify-content: flex-start;
    }
    
    .aqs-feature-icon {
        font-size: 1.5em;
        margin-right: 15px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .aqs-feature-text {
        text-align: left;
        margin: 0;
    }
    
    .aqs-btn-large {
        width: 100%;
        padding: 18px 30px;
        font-size: 1.2em;
    }
    
    .aqs-keyboard-hint {
        display: none; /* Hide keyboard hints on mobile */
    }
    
    .aqs-quiz-progress-header {
        padding: 10px 15px 15px;
        margin-bottom: 20px;
        position: relative; /* Remove sticky on mobile */
    }
    
    .aqs-quiz-title-small {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .aqs-form-intro {
        font-size: 0.95em;
        margin-bottom: 25px;
        padding: 12px 15px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .aqs-welcome-title {
        font-size: 1.8em;
        line-height: 1.3;
    }
    
    .aqs-welcome-description {
        font-size: 1em;
    }
    
    .aqs-btn-large {
        padding: 16px 25px;
        font-size: 1.1em;
    }
    
    .aqs-welcome-features {
        margin: 25px 0;
        padding: 12px;
    }
    
    .aqs-feature-item {
        padding: 8px;
    }
    
    .aqs-feature-icon {
        font-size: 1.3em;
    }
    
    .aqs-feature-text {
        font-size: 0.85em;
    }
}

/* Animation for Welcome Screen */
.aqs-welcome-screen.active .aqs-welcome-hero {
    animation: welcomeFadeInUp 0.8s ease-out;
}

@keyframes welcomeFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced transitions for step changes */
.aqs-step.aqs-welcome-exit {
    animation: welcomeFadeOut 0.5s ease-in-out;
}

@keyframes welcomeFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Progressive disclosure - show quiz header when questions start */
.aqs-quiz-container.aqs-questions-active .aqs-quiz-progress-header {
    display: block !important;
}

.aqs-quiz-container.aqs-questions-active .aqs-welcome-screen {
    display: none;
}

/* Hide the original quiz header when welcome screen is enabled */
.aqs-quiz-container:has(.aqs-welcome-screen) .aqs-quiz-header {
    display: none;
}

/* Form step styling when coming from welcome screen */
.aqs-user-info-section .aqs-step-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    border: 1px solid #e9ecef;
    position: relative;
    min-height: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Enhanced welcome screen background image support */
.aqs-welcome-screen[style*="background-image"] {
    background-attachment: fixed;
}

.aqs-welcome-screen[style*="background-image"]::before {
    background: rgba(0, 0, 0, 0.5); /* Darker overlay for better text readability */
}

/* Pulse animation for the main button */
.aqs-btn-large {
    position: relative;
    overflow: hidden;
}

.aqs-btn-large::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
}

.aqs-btn-large:hover::before {
    width: 300px;
    height: 300px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .aqs-welcome-screen {
        background: #000;
        color: #fff;
    }
    
    .aqs-welcome-screen::before {
        display: none;
    }
    
    .aqs-btn-large {
        border: 2px solid #fff;
    }
    
    .aqs-welcome-features {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .aqs-welcome-screen.active .aqs-welcome-hero,
    .aqs-step.aqs-welcome-exit,
    .aqs-feature-item,
    .aqs-btn-large {
        animation: none !important;
        transition: none !important;
    }
    
    .aqs-feature-item:hover {
        transform: none;
    }
    
    .aqs-btn-large:hover {
        transform: none;
    }
}

/* Print styles for welcome screen */
@media print {
    .aqs-welcome-screen {
        background: none !important;
        color: #000 !important;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .aqs-welcome-screen::before {
        display: none;
    }
    
    .aqs-welcome-actions {
        display: none;
    }
    
    .aqs-keyboard-hint {
        display: none;
    }
}

/* Hide progress bar on user info screen */
.aqs-user-info-section.active ~ .aqs-quiz-progress-header,
.aqs-welcome-screen.active ~ .aqs-quiz-progress-header {
    display: none !important;
}

/* Only show progress bar when a question is active */
.aqs-question-section.active ~ .aqs-quiz-progress-header {
    display: block !important;
}
/* Add this to your quiz.css file */

/* Rate Limit Error Styling */
.aqs-rate-limit-error {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    border-left: 4px solid #ffc107;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.aqs-error-icon {
    font-size: 3em;
    margin-bottom: 20px;
    line-height: 1;
}

.aqs-rate-limit-error h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 1.4em;
    font-weight: 600;
}

.aqs-rate-limit-error p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.retry-info {
    background: #e7f3ff;
    border: 1px solid #007cba;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    color: #007cba !important;
}

.aqs-error-help {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.aqs-error-help h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.aqs-error-help ul {
    margin: 0;
    padding-left: 20px;
    color: #6c757d;
}

.aqs-error-help li {
    margin-bottom: 8px;
}

.aqs-error-actions {
    margin-top: 30px;
}

.aqs-error-actions .aqs-btn {
    margin: 0 10px;
}

/* Countdown styling */
#retry-countdown {
    font-weight: bold;
    color: #007cba;
}

.aqs-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive design for rate limit errors */
@media (max-width: 768px) {
    .aqs-rate-limit-error {
        padding: 30px 15px;
        margin: 10px;
    }
    
    .aqs-error-icon {
        font-size: 2.5em;
    }
    
    .aqs-rate-limit-error h3 {
        font-size: 1.3em;
    }
    
    .aqs-error-help {
        padding: 15px;
        margin: 20px 0;
    }
    
    .aqs-error-actions .aqs-btn {
        width: 100%;
        margin: 5px 0;
    }
}