/* Beautiful Customer-Facing Quiz Styles with Material Design */

/* Labels that name a field for assistive tech without repeating a visible caption */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Global body styling for quiz - high specificity */
body:has(.quiz-container) {
    background: linear-gradient(135deg,
        #fdfbff 0%,
        #f9f9ff 50%,
        #ebf1ff 100%) !important;
    min-height: 100vh;
}

/* Quiz Container - Clean, spacious, inviting */
.quiz-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Progress Bar - Elegant and motivating */
.quiz-progress {
    width: 100%;
    height: 6px;
    background-color: var(--md-sys-color-surface-variant);
    border-radius: 100px;
    margin-bottom: 2.5rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
        var(--md-sys-color-primary) 0%,
        var(--md-sys-color-secondary) 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(var(--md-sys-color-primary-rgb), 0.3);
}

/* Quiz Content - Centered and comfortable */
.quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Question Slide - Smooth entrance */
.question-slide {
    animation: slideInFade 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Question Header - Warm and welcoming */
.question-header {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 600;
    margin-bottom: 1.75rem;
    text-align: center;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Answer Options - Card-like, inviting to click */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

/* Answer Option - Beautiful interactive cards */
.answer-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 1.125rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(var(--md-sys-color-outline-rgb, 121, 116, 126), 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
                0 1px 2px rgba(0, 0, 0, 0.02);
}

.answer-option:hover {
    border-color: var(--md-sys-color-primary);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(var(--md-sys-color-primary-rgb), 0.12),
                0 4px 8px rgba(0, 0, 0, 0.06);
}

.answer-option:active {
    transform: translateY(0);
}

/* Custom Radio/Checkbox styling */
.answer-option input[type="radio"],
.answer-option input[type="checkbox"] {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--md-sys-color-outline);
    margin-right: 0.875rem;
    margin-top: 0.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.answer-option input[type="radio"] {
    border-radius: 50%;
}

.answer-option input[type="checkbox"] {
    border-radius: 6px;
}

.answer-option input[type="radio"]:checked,
.answer-option input[type="checkbox"]:checked {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    position: relative;
}

.answer-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--md-sys-color-on-primary);
    border-radius: 50%;
}

.answer-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--md-sys-color-on-primary);
    font-size: 16px;
    font-weight: bold;
}

/* Answer Label - Clear and readable */
.answer-label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.answer-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    line-height: 1.4;
}

.answer-description {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
}

/* Other Option - Seamless integration */
.answer-option-other {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 1.125rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(var(--md-sys-color-outline-rgb, 121, 116, 126), 0.2);
    border-radius: 20px;
}

.other-toggle {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--md-sys-color-outline);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.other-toggle:checked {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.other-input {
    padding: 0.75rem 0.875rem;
    border: 2px solid var(--md-sys-color-outline-variant);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s ease;
}

.other-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(var(--md-sys-color-primary-rgb), 0.1);
}

.other-input:disabled {
    background-color: var(--md-sys-color-surface-variant);
    opacity: 0.5;
    cursor: not-allowed;
}

/* Textarea Answer - Spacious and comfortable */
.quiz-container .answer-text textarea.form-control {
    width: 100% !important;
    padding: 1.125rem !important;
    border: 1.5px solid rgba(121, 116, 126, 0.2) !important;
    border-radius: 20px !important;
    resize: vertical;
    min-height: 150px;
    margin-bottom: 0.875rem;
    font-size: 1rem !important;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    line-height: 1.6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.quiz-container .answer-text textarea.form-control:focus {
    outline: none !important;
    border-color: var(--md-sys-color-primary) !important;
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 0 0 4px rgba(33, 95, 166, 0.08),
                0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.quiz-container .answer-text textarea.form-control::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
}

/* Form Actions - Prominent and inviting */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.625rem;
}

/* Button - Material Design 3 style */
.quiz-container .btn.btn-primary {
    padding: 0.875rem 2.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    border: none !important;
    border-radius: 100px !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none !important;
    background: #215fa6 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: auto !important;
    line-height: 1.2 !important;
}

.quiz-container .btn.btn-primary:hover {
    background: #4178c1 !important;
    box-shadow: 0 8px 24px rgba(33, 95, 166, 0.3) !important;
    transform: translateY(-2px);
}

.quiz-container .btn.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(33, 95, 166, 0.3) !important;
}

.quiz-container .btn.btn-primary:disabled {
    background-color: #e0e2ec !important;
    color: #43474e !important;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1.25rem 0.875rem;
    }

    .question-header {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .answer-option {
        padding: 0.875rem 0.875rem;
    }

    .btn {
        padding: 0.75rem 1.75rem;
        font-size: 0.875rem;
    }
}