/* ACF Quiz System - Multi-Step Form Styles */

/* RTL Support */
html[dir="rtl"] .acf-quiz-container {
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.acf-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
}

/* Step Progress Indicator */
.step-progress {
    margin-bottom: 30px;
    text-align: center;
}

/* Date Input Group - Horizontal Layout */
.date-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.date-select {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
}

/* Agreement Scrolling Pane Styles */
.agreement-section {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.agreement-scroll-container {
    max-height: 250px;
    min-height: 250px;
    overflow-y: auto;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #eee;
    position: relative;
}

/* Scroll indicator for agreement */
.agreement-scroll-container::after {
    content: "גלול למטה כדי להמשיך";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(255,255,255,0.9) 50%, rgba(255,255,255,1));
    text-align: center;
    padding: 20px 10px 10px;
    font-size: 12px;
    color: #666;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.agreement-scroll-container.scrolled-to-bottom::after {
    opacity: 0;
}

.agreement-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.agreement-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.agreement-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.agreement-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.agreement-content {
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

.agreement-content p {
    margin-bottom: 15px;
}

.agreement-content ul, .agreement-content ol {
    margin: 15px 0;
    padding-right: 20px;
}

.agreement-content li {
    margin-bottom: 8px;
}

.agreement-checkbox-container {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    animation: fadeInUp 0.3s ease-out;
}

.agreement-checkbox-container.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.agreement-checkbox-container.disabled .checkbox-input-new,
.checkbox-input-new[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.agreement-checkbox-container.disabled .checkbox-label-new,
.checkbox-input-new[disabled] + .checkbox-label-new {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    color: #999;
}

.scroll-instruction {
    font-size: 12px;
    color: #d32f2f;
    font-weight: bold;
    margin-top: 8px;
    display: block;
}

/* Gentle notification styles */
.scroll-notification {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 13px;
    color: #856404;
    display: none;
    animation: gentleFadeIn 0.4s ease-out;
}

.scroll-notification.show {
    display: block;
}

.scroll-notification .icon {
    display: inline-block;
    margin-left: 8px;
    font-size: 16px;
}

@keyframes gentleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for scroll container when user needs to scroll */
.agreement-scroll-container.needs-scroll {
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    }
}

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

.agreement-checkbox-container .checkbox-label-new {
    font-weight: 600;
    color: #2c3e50;
}

/* Scroll indicator */
.agreement-scroll-container::after {
    content: "גלול למטה לקריאת ההסכם המלא";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    opacity: 0.8;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.agreement-scroll-container.scrolled-to-bottom::after {
    opacity: 0;
}

/* Submit Button Styling - Only visible on step 4 */
.submit-btn, #submit-form {
    background-color: #1e40af !important;
    color: white !important;
    appearance: none !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    padding: 12px 22px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.06) !important;
    transition: transform .05s ease, box-shadow .2s ease, background .2s ease !important;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.step-indicator .step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.step-indicator .step.active {
    background: #007cba;
    color: white;
    transform: scale(1.1);
}

.step-indicator .step.completed {
    background: #28a745;
    color: white;
}

.step-indicator .step.completed::after {
    content: '✓';
    position: absolute;
    font-size: 14px;
}

.step-title h2 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 24px;
}

.step-title p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Multi-Step Form */
.quiz-form.multi-step {
    position: relative;
}

.form-step {
    display: none !important;
    animation: fadeIn 0.3s ease-in-out;
}

.form-step.active {
    display: block !important;
}

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

/* Step Introduction */
.step-intro {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #007cba;
}

.step-intro h3 {
    margin: 0 0 15px 0;
    color: #007cba;
    font-size: 20px;
}

.step-intro p {
    margin: 0 0 10px 0;
    color: #555;
    line-height: 1.6;
}

.step-intro p:last-child {
    margin-bottom: 0;
}

/* Legal Notice */
.legal-notice {
    margin-top: 30px;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
}

.legal-notice h4 {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 16px;
}

.legal-notice p {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.5;
}

.legal-notice p:last-child {
    margin-bottom: 0;
}

/* Final Declaration */
.final-declaration {
    margin-top: 30px;
    padding: 20px;
    background: #e7f3ff;
    border: 2px solid #007cba;
    border-radius: 8px;
}

.final-declaration .checkbox-label {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.nav-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Elementor button styling */
.nav-btn .elementor-button-content-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.nav-btn .elementor-button-text {
    flex-grow: 0;
    flex-shrink: 0;
}

.nav-btn .elementor-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    transition: transform 0.2s ease;
    min-width: 16px;
    min-height: 16px;
}

.nav-btn .elementor-button-icon i {
    line-height: 1;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* FontAwesome fallback - if icons don't load, show text alternatives */
.nav-btn .elementor-button-icon i.fas.fa-angle-left:before {
    content: "<<";
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
}

.nav-btn .elementor-button-icon i.fas.fa-angle-right:before {
    content: ">>";
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
}

/* Ensure FontAwesome icons display if loaded */
.nav-btn .elementor-button-icon i[class*="fa-"]:before {
    font-family: "Font Awesome 5 Free", "FontAwesome", Arial, sans-serif;
    font-weight: 900;
}

.nav-btn.prev-btn .elementor-button-icon {
    order: -1;
}

.nav-btn.next-btn .elementor-button-icon {
    order: 1;
}

.nav-btn.prev-btn {
    background: #6c757d;
    color: white;
    flex-direction: row-reverse;
}

.nav-btn.prev-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.nav-btn.prev-btn:hover .button-icon {
    transform: translateX(-3px);
}

.nav-btn.next-btn,
.nav-btn.submit-btn {
    background: #007cba;
    color: white;
}

.nav-btn.next-btn:hover,
.nav-btn.submit-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.nav-btn.next-btn:hover .button-icon {
    transform: translateX(3px);
}

.nav-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none !important;
}

.nav-btn:disabled .button-icon {
    transform: none !important;
}

.nav-btn.loading {
    position: relative;
    color: transparent;
}

.nav-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Quiz Header */
.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.quiz-title {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.quiz-instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007cba;
    margin-top: 15px;
}

.quiz-instructions p {
    margin: 0;
    color: #555;
    font-size: 16px;
}

/* Personal Details Section */
.personal-details-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.section-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.personal-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.field-group {
display: flex;
flex-direction: column;
}

.field-label {
font-weight: bold;
margin-bottom: 5px;
color: #34495e;
}

.field-input {
width: 100%;
border: 2px solid #ddd;
border-radius: 10px;
padding: 12px 14px;
background: #fff;
font-size: 16px;
line-height: 1.4;
color: #333;
box-sizing: border-box;
direction: rtl;
text-align: right;
transition: border-color 0.3s ease;
    color: #333;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
    transition: border-color 0.3s ease;
}

.field-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.field-input.error.touched {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.field-input.error.touched:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Select field styling */
select.field-input {
    background-image: none;
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px;
    padding-left: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Textarea styling */
textarea.field-input {
    resize: vertical;
    min-height: 80px;
}

/* Remove duplicate error rule - handled above with higher specificity */

.checkbox-group {
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    direction: rtl;
}

.checkbox-label input[type="checkbox"] {
    margin-left: 10px;
    margin-right: 0;
    transform: scale(1.2);
}

.checkbox-group.error .checkbox-label {
    color: #e74c3c;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.section-divider {
    margin: 20px 0;
    border: none;
    height: 2px;
    background: linear-gradient(to left, #3498db, #2ecc71);
    border-radius: 1px;
}

/* Question Blocks */
.question-block {
    background: #fafafa;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 25px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
    text-align: right;
}

html[dir="rtl"] .question-block {
    text-align: right;
}

.question-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Question Header */
.question-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    direction: rtl;
    text-align: right;
}

.question-number {
    background: #007cba;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: 15px;
    margin-right: 0;
    flex-shrink: 0;
    font-size: 14px;
    order: 1;
}

/* Ensure question text comes after number in RTL */
.question-text {
    order: 2;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    text-align: right;
    direction: rtl;
    line-height: 1.4;
}

/* Force RTL layout for Hebrew sites */
.acf-quiz-container .question-header {
    direction: rtl !important;
    justify-content: flex-start;
}

.acf-quiz-container .question-number {
    margin-left: 15px !important;
    margin-right: 0 !important;
}

.acf-quiz-container .question-text {
    text-align: right !important;
    direction: rtl !important;
}

/* Answer Options */
.answers-container {
    display:flex; flex-direction:column; gap:10px;
    margin-right: 0;
    margin-left: 45px;
    direction: rtl;
}

html[dir="rtl"] .answers-container {
    margin-right: 0;
    margin-left: 0;
}


.answer-option {
    margin-bottom: 12px;
    position: relative;
}

.answer-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    margin: 0;
    z-index: 2;
    pointer-events: auto;
}

.answer-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    direction: rtl;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
}

.answer-label:hover {
    border-color: #007cba;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.answer-input:focus-visible + .answer-label {
    outline: 3px solid #4d90fe;
    outline-offset: 2px;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.answer-input:focus:not(:focus-visible) + .answer-label {
    outline: none;
}

.answer-input:checked + .answer-label {
    border-color: #007cba;
    background: #e7f3ff;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
    transform: translateY(-1px);
}

.answer-input:checked + .answer-label .answer-marker {
    background: #007cba;
    border-color: #007cba;
}

.answer-input:checked + .answer-label .answer-marker::after {
    opacity: 1;
    transform: scale(1);
}

.answer-marker {
    width: 20px;
    height: 20px;
    border: 2px solid #999;
    border-radius: 50%;
    margin-left: 12px;
    margin-right: 0;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    flex-grow: 0;
    background: white;
    display: inline-block;
}

html[dir="rtl"] .answer-marker {
    margin-left: 12px;
    margin-right: 0;
}

.answer-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.2s ease;
}

/* Signature Section Styling - Enhanced */
.signature-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border: 2px solid #007cba;
    border-radius: 12px;
    direction: rtl;
    text-align: right;
}

.signature-section h5 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.signature-required {
    color: #dc3545;
    font-weight: bold;
}

.signature-instructions {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.signature-container {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
}

.signature-wrapper {
    position: relative;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

#signature_pad {
    display: block;
    width: 100% !important;
    height: 150px !important;
    touch-action: none;
    -ms-touch-action: none;
    cursor: crosshair;
}

.signature-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.8);
    color: #999;
    font-size: 16px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

.signature-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 15px;
}

.clear-signature-btn {
    background: #f8f9fa;
    border: 2px solid #dc3545;
    color: #dc3545;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-signature-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
}

.signature-status {
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
}

.signature-status.signature-required {
    color: #dc3545;
}

.signature-status.signature-valid {
    color: #28a745;
}

.signature-status.signature-error {
    color: #dc3545;
}

/* Mobile signature improvements */
@media (max-width: 768px) {
    .signature-section {
        padding: 20px 15px;
    }
    
    #signature_pad {
        height: 120px !important;
    }
    
    .signature-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .clear-signature-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Plan-specific declarations */
body.yearly-trial .monthly-declaration,
body.monthly-trial .yearly-declaration {
    display: none;
}

/* Show only the relevant declaration based on plan type */
body.yearly-trial .yearly-declaration,
body.monthly-trial .monthly-declaration {
    display: block;
}

/* Final declaration styling */
.final-declaration {
    background: #f8f9fa;
    border: 2px solid #007cba;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    direction: rtl;
    text-align: right;
}

/* Checkbox styling for final declaration - new implementation */
.checkbox-group-new {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.checkbox-input-new {
    width: 24px;
    height: 24px;
    margin: 0;
    cursor: pointer;
    accent-color: #007cba;
    flex-shrink: 0;
    margin-top: 3px;
}

.checkbox-input {
    width: 24px;
    height: 24px;
    margin: 0;
    cursor: pointer;
    accent-color: #007cba;
    flex-shrink: 0;
    margin-top: 3px;
    transform: scale(1.2);
    pointer-events: auto;
    z-index: 10;
}

.checkbox-label-new {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    cursor: pointer;
    flex: 1;
    user-select: none;
}

.checkbox-label {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    cursor: pointer;
    flex: 1;
    user-select: none;
    font-weight: 500;
}

.checkbox-label:hover {
    color: #007cba;
}

.checkbox-group.has-error .checkbox-input {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.checkbox-group.has-error .checkbox-label {
    color: #dc3545;
}

/* Make sure checkbox is visible and clickable */
.checkbox-input:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.checkbox-input:checked {
    background-color: #007cba;
    border-color: #007cba;
}

.answer-input:checked + .answer-label .answer-marker::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Selected answer option styling */
.answer-option.selected .answer-label {
    border-color: #007cba;
    background: #e7f3ff;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
    transform: translateY(-1px);
}

.answer-option.selected .answer-marker {
    background: #007cba;
    border-color: #007cba;
}

.answer-option.selected .answer-marker::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.answer-text {
    color: #333;
    font-size: 16px;
    line-height: 1.4;
    display: block;
    width: 100%;
    padding-right: 5px;
    text-align: right;
    direction: rtl;
    unicode-bidi: plaintext;
}

/* Questions Container for Multi-Step */
.questions-container {
    margin-top: 20px;
}

.questions-container .question-block {
    margin-bottom: 30px;
}

/* Question Explanation */
.question-explanation {
    margin-top: 15px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 6px;
    border-right: 3px solid #007cba;
    font-size: 14px;
    line-height: 1.5;
}

.question-explanation p {
    margin: 0;
    color: #856404;
    font-size: 14px;
}

/* Quiz Actions */
.quiz-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.quiz-submit-btn,
.quiz-retry-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-submit-btn:hover,
.quiz-retry-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.quiz-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quiz-retry-btn {
    background: #6c757d;
    margin-left: 10px;
}

.quiz-retry-btn:hover {
    background: #545b62;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Quiz Results */
.quiz-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-top: 30px;
    text-align: center;
}

.results-header h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
}

.score-display {
    margin-bottom: 20px;
}

.score-label {
    font-size: 18px;
    color: #666;
    margin-right: 10px;
}

.score-value {
    font-size: 36px;
    font-weight: bold;
    color: #007cba;
    margin-right: 10px;
}

.score-fraction {
    font-size: 16px;
    color: #666;
}

.result-message {
    margin: 20px 0;
}

.result-message p {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

/* Success/Failure States */
.quiz-results.passed .score-value {
    color: #28a745;
}

.quiz-results.failed .score-value {
    color: #dc3545;
}

.quiz-results.passed .result-message p {
    color: #155724;
    background: #d4edda;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

.quiz-results.failed .result-message p {
    color: #721c24;
    background: #f8d7da;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* Error State */
.quiz-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.quiz-error p {
    margin: 0;
    font-weight: 500;
}

/* Loading State */
.quiz-loading {
    text-align: center;
    padding: 20px;
}

.quiz-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Messages for Multi-Step */
.step-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-size: 14px;
}

/* Success Messages */
.step-success {
    background: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
    text-align: center;
    font-size: 14px;
}

/* Loading State for Steps */
.form-step.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Checkbox styling improvements */
.checkbox-group .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-group .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.checkbox-group input[type="checkbox"]:checked + .checkmark {
    background: #007cba;
    border-color: #007cba;
}

.checkbox-group input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-group input[type="checkbox"] {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .acf-quiz-container {
        margin: 10px;
        padding: 15px;
    }
    
    .quiz-title {
        font-size: 24px;
    }
    
    .answers-container {
        margin-left: 0;
    }
    
    .question-header {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    .question-number {
        margin-bottom: 0;
        margin-right: 0;
        margin-left: 10px;
    }
    
    .question-text {
        font-size: 16px;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .answer-text {
        font-size: 14px;
    }
    
    .score-value {
        font-size: 28px;
    }
    
    .step-indicator {
        gap: 10px;
    }
    
    .step-indicator .step {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .nav-btn .button-icon {
        font-size: 13px;
    }
    
    .step-intro,
    .legal-notice,
    .final-declaration {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .acf-quiz-container {
        padding: 15px;
    }
    
    .step-title h2 {
        font-size: 20px;
    }
    
    .step-intro h3 {
        font-size: 18px;
    }
    
    .nav-btn {
        padding: 14px 12px;
        font-size: 15px;
    }
    
    .nav-btn .button-icon {
        font-size: 14px;
    }
    
    .field-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .quiz-submit-btn,
    .quiz-retry-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .quiz-retry-btn {
        margin-left: 0;
    }
}

/* Step 2 specific styles - 2 column layout */
.form-step[data-step="2"] {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-step[data-step="2"] .field-row {
    padding: 25px 0;
    display: flex;
    gap: 20px;
    width: 100%;
}

.form-step[data-step="2"] .field-row .field-group {
    flex: 1;
    margin-bottom: 0;
}

.form-step[data-step="2"] .field-group {
    margin-bottom: 20px;
}

.form-step[data-step="2"] .field-group.full-width {
    width: 100%;
}

/* Birthdate container styling */
.form-step[data-step="2"] .birthdate-container {
    display: flex;
    gap: 10px;
}

.form-step[data-step="2"] .birthdate-container select {
    flex: 1;
}

.subscription-checkbox {
    column-gap: 10px;
}

/* Responsive for mobile */
@media (max-width: 768px) {
    .form-step[data-step="2"] .field-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-step[data-step="2"] .birthdate-container {
        flex-direction: column;
        gap: 10px;
    }

    #acf-quiz-form .form-navigation .nav-btn {
        width: 100%;
        text-align: center;
        margin: 0 !important;
    }
    .subscription-checkbox {
        flex-direction: column;
    }
}

/* Popup css */
#viderfinance_join_popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
}

#viderfinance_join_popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #FFFFFF; /* белый фон */
    color: #0E2451;      /* текст тёмно-синий */
    width: 420px;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    z-index: 9999;
    overflow: hidden;
    font-family: Arial, sans-serif;
    animation: popupFadeIn 0.3s ease;
}

/* Заголовок */
#viderfinance_join_popup .popup-header {
    color: #0E2451; /* жёлтый акцент */
    font-weight: bold;
    font-size: 20px;
    text-align: center;
    padding: 16px 20px 8px;
}

/* Текст */
#viderfinance_join_popup .popup-body {
    padding: 0 20px 20px;
    font-size: 15px;
    line-height: 1.5em;
    color: #0E2451;
}

/* Нижняя часть */
#viderfinance_join_popup .popup-footer {
    text-align: right;
    padding: 12px 18px;
    background: #FFFFFF;
}

/* Кнопка */
#viderfinance_join_popup .popup-close {
    background: #FCC62E;  /* жёлтая кнопка */
    color: #0E2451;       /* текст тёмно-синий */
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#viderfinance_join_popup .popup-close:hover {
    background: #E6B826; /* чуть темнее жёлтый */
    transform: translateY(-2px);
}

/* Анимация */
@keyframes popupFadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

#viderfinance_join_ls {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#viderfinance_join_ls .loader {
    width: 60px;
    height: 60px;
    border: 6px solid #ccc;
    border-top: 6px solid #003366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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