/* ESG Survey Widget Styles */
.esg-survey-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    position: relative;
    padding-top: 0;
}

/* Survey Header Title */
.survey-header-title {
    text-align: center;
    padding: 20px 10px;
    margin-bottom: 20px;
    background: white;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.survey-main-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #B09731;
    margin: 0;
    line-height: 1.4;
}

/* Introduction Page Styles */
.esg-survey-container .introduction-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 20px !important;
    text-align: center !important;
}

.esg-survey-container .intro-content {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 40px 30px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    border: 1px solid #e9ecef !important;
    margin: 0 !important;
}

/* Main introduction section */
.intro-main {
    margin-bottom: 30px !important;
    text-align: left !important;
}

.intro-main p {
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    color: #555 !important;
    margin-bottom: 0 !important;
}

.intro-main strong {
    color: #B09731 !important;
}

/* Participant Counter Section */
.participant-counter-section {
    margin: 20px 0 !important;
    text-align: center !important;
}

.participant-counter-text {
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    color: #555 !important;
    margin-bottom: 0 !important;
}

.counter-number {
    font-weight: 700 !important;
    color: #B09731 !important;
    font-size: 1.4em !important;
    display: inline-block !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    transform-origin: center center !important;
    min-width: 40px !important;
    text-align: center !important;
}

/* Flip animation states */
.counter-number.flip-compress {
    transform: scaleY(0.1) !important;
    opacity: 0.7 !important;
    filter: blur(1px) !important;
}

.counter-number.flip-expand {
    transform: scaleY(1.1) !important;
    color: #8B7A28 !important;
    text-shadow: 0 2px 8px rgba(176, 151, 49, 0.4) !important;
}

.counter-number.flip-settle {
    transform: scaleY(1) !important;
    color: #B09731 !important;
    text-shadow: none !important;
}

/* Key information points section */
.intro-info-points {
    background: #f8f9fa !important;
    border-radius: 12px !important;
    padding: 25px !important;
    margin: 30px auto !important;
    border-left: 4px solid #B09731 !important;
    text-align: left !important;
    max-width: 800px !important;
}

.info-point {
    display: flex !important;
    margin-bottom: 15px !important;
    align-items: flex-start !important;
}

.info-point:last-child {
    margin-bottom: 0 !important;
}

.info-label {
    font-weight: 600 !important;
    color: #B09731 !important;
    min-width: 140px !important;
    margin-right: 15px !important;
    flex-shrink: 0 !important;
}

.info-text {
    flex: 1 !important;
    color: #555 !important;
    line-height: 1.6 !important;
}

/* Closing statement section */
.intro-closing {
    margin: 30px 0 !important;
    text-align: center !important;
}

.intro-closing p {
    font-style: italic !important;
    color: #666 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 0 !important;
}


.esg-survey-container .intro-start-container {
    text-align: center !important;
}

.esg-survey-container #start-survey-btn {
    font-size: 1.2rem !important;
    padding: 15px 40px !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3) !important;
}

.esg-survey-container #start-survey-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,123,255,0.4) !important;
}

@media (max-width: 768px) {
    .esg-survey-container .intro-title {
        font-size: 1.8rem !important;
    }
    
    .esg-survey-container .intro-content {
        padding: 30px 20px !important;
    }
    
    .esg-survey-container .intro-body {
        font-size: 1rem !important;
    }
    
    .esg-survey-container #start-survey-btn {
        font-size: 1.1rem !important;
        padding: 12px 30px !important;
    }
}

/* Language Switcher (for external use) */
.esg-language-switcher {
    display: flex;
    gap: 5px;
    background: white;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    width: fit-content;
    margin: 0;
    height: fit-content;
}

/* Fix for WordPress/Elementor HTML Widget containers */
.elementor-widget-html .elementor-widget-container,
.wp-block-html,
.textwidget {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

/* Ensure parent containers don't add extra space */
.esg-language-switcher-wrapper {
    height: fit-content;
    display: inline-block;
    margin: 0;
    padding: 0;
}

.esg-lang-btn {
    background: none;
    border: none;
    font-size: 20px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    user-select: none;
}

.esg-lang-btn:hover {
    background-color: #f8f9fa;
    opacity: 1;
    transform: scale(1.1);
}

.esg-lang-btn.active {
    opacity: 1;
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Progress Bar Styles */
.progress-container {
    margin: 20px 0 30px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-header {
    margin-bottom: 12px;
    text-align: center;
}

.progress-text {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 4px;
    transition: width 0.4s ease-in-out;
    min-width: 2px;
    box-shadow: 0 1px 2px rgba(0, 123, 255, 0.3);
}

/* Progress bar animation */
@keyframes progressPulse {
    0% { box-shadow: 0 1px 2px rgba(0, 123, 255, 0.3); }
    50% { box-shadow: 0 1px 4px rgba(0, 123, 255, 0.5); }
    100% { box-shadow: 0 1px 2px rgba(0, 123, 255, 0.3); }
}

.progress-fill {
    animation: progressPulse 2s ease-in-out infinite;
}

/* Mobile responsive for progress bar */
@media (max-width: 768px) {
    .progress-container {
        margin: 15px 0 20px 0;
        padding: 12px 15px;
    }
    
    .progress-header {
        margin-bottom: 10px;
    }
    
    .progress-text {
        font-size: 0.85em;
    }
    
    .progress-bar {
        height: 6px;
    }
}

/* Question Container */
.question-container {
    margin-bottom: 40px;
    min-height: 400px;
}

/* Reduce spacing on mobile */
@media (max-width: 768px) {
    .question-container {
        margin-bottom: 20px;
        min-height: auto;
    }
}

.question-step h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.scenario-text {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
}

.question-text {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: 500;
}

/* Reduce question text margin on mobile */
@media (max-width: 768px) {
    /* Adjust container spacing on mobile */
    .esg-survey-container {
        padding-top: 20px;
    }
    
    .question-text {
        margin-bottom: 20px;
        font-size: 1em;
    }
    
    .scenario-text {
        margin-bottom: 15px;
    }
    
    .scenario-text p {
        font-size: 1em;
    }
}

/* Choice Options */
.choice-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

/* Desktop: First two rows side by side, third row below */
@media (min-width: 769px) {
    .choice-container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }

    .choice-container > .choice-row:nth-child(1),
    .choice-container > .choice-row:nth-child(2) {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }

    .choice-container > .choice-row:nth-child(3) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Ensure choice-option takes full width within its row */
    .choice-container > .choice-row .choice-option {
        width: 100%;
    }

    /* Only apply min-height to first two options (with images) */
    .choice-container > .choice-row:nth-child(1) .choice-option,
    .choice-container > .choice-row:nth-child(2) .choice-option {
        min-height: 400px; /* Accommodate image + 2 lines of text */
    }

    /* Adjust option text to allow wrapping for first two options */
    .choice-container > .choice-row:nth-child(1) .option-text,
    .choice-container > .choice-row:nth-child(2) .option-text {
        min-height: 3em; /* Minimum 2 lines of text (1.5em line-height × 2) */
        line-height: 1.5em;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.choice-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.choice-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-height: 60px;
}

/* Radio button styling - will be positioned next to text */
.choice-option input[type="radio"] {
    position: static;
    margin: 0;
    margin-right: 10px;
    flex-shrink: 0;
}

/* When info box is not active, choice takes full width */
.choice-row:not(.has-active-info) .choice-option {
    flex: 1;
}

/* When info box is active, choice takes half width */
.choice-row.has-active-info .choice-option {
    flex: 0 0 48%;
}

/* Style for options that have tooltip triggers (can show info boxes) */
.choice-option.has-tooltip-trigger {
    cursor: pointer;
}

.choice-option.has-tooltip-trigger:hover {
    background-color: #f8f9ff;
    border-color: #c3d9ff;
}


.choice-option:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

.choice-option input[type="radio"] {
    /* Reset default styles */
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    margin: 0;

    /* Sizing and spacing */
    width: 1.2em;
    height: 1.2em;
    margin-right: 15px;
    flex-shrink: 0; /* Prevent shrinking in flex container */

    /* Border and shape */
    border: 2px solid #adb5bd;
    border-radius: 50%;

    /* Positioning */
    display: grid;
    place-content: center;
    transition: all 0.1s ease-in-out;
}

.choice-option input[type="radio"]::before {
    content: "";
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #007bff;
}

.choice-option input[type="radio"]:checked {
    border-color: #007bff;
}

.choice-option input[type="radio"]:checked::before {
    transform: scale(1);
}

.choice-option input[type="radio"]:checked + .option-content {
    color: #007bff;
    font-weight: 500;
}

.choice-option:has(input:checked) {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    pointer-events: none;
    gap: 10px;
}

.option-image {
    width: 300px !important; /* Fixed width */
    max-width: 300px !important;
    height: auto !important;
    border-radius: 6px;
    object-fit: contain; /* Preserve aspect ratio without cropping */
    margin-bottom: 10px;
    display: block;
}

/* Wrapper for radio button + text (horizontal layout) */
.option-text-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: auto;
}

/* Text styling */
.option-text {
    font-size: 1em;
    color: #333;
    font-weight: 500;
    text-align: center;
}

/* Radio button inside text wrapper */
.option-text-wrapper input[type="radio"] {
    position: static;
    margin: 0;
    flex-shrink: 0;
    pointer-events: auto;
}

.carbon-highlight {
    color: #007bff;
    font-weight: 600;
}

/* Information Box Styles (replaced tooltips) */
.tooltip-trigger {
    color: #007bff;
    cursor: pointer;
    position: relative;
    font-weight: 500;
}

.info-box {
    flex: 0 0 48%;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    display: none;
    font-size: 0.9em;
    line-height: 1.5;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

/* Mobile info box improvements */
@media (max-width: 768px) {
    .info-box {
        margin-top: 8px;
        padding: 12px;
        font-size: 0.85em;
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        z-index: 10;
        animation: slideDown 0.2s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .info-box-close {
        font-size: 18px;
        width: 24px;
        height: 24px;
        top: 6px;
        right: 8px;
    }
    
    .choice-container {
        gap: 12px;
        margin-top: 8px;
    }
    
    .choice-row {
        gap: 10px;
    }
}

.info-box.active {
    display: block;
    border-color: #007bff;
    background: #f0f7ff;
}

.info-box.active {
    display: block;
    border-color: #007bff;
    background: #f0f7ff;
}

.info-box h4 {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 1em;
    font-weight: 600;
}

.info-box p {
    margin: 0;
}

.info-box-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.info-box-close:hover {
    color: #dc3545;
}

/* Legacy tooltip styles (keeping for backward compatibility) */
.tooltip {
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 300px;
    z-index: 1000;
    font-size: 0.9em;
    line-height: 1.4;
    display: none;
    pointer-events: none;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: #2c3e50;
}

.tooltip h4 {
    margin-bottom: 8px;
    color: #74b9ff;
    font-size: 1em;
}

/* Value Input */
.value-input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.value-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.value-option:hover {
    border-color: #007bff;
}

.value-option:has(input:focus) {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

#value-input {
    border: none;
    outline: none;
    font-size: inherit;
    line-height: inherit;
    padding: 2px 5px;
    min-width: 140px;
    width: 140px;
    text-align: center;
    background: transparent;
    -moz-appearance: textfield; /* Firefox */
    height: auto;
}

/* Hide number input spinners */
#value-input::-webkit-outer-spin-button,
#value-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.currency {
    color: #6c757d;
    font-weight: 500;
    font-size: inherit;
    line-height: inherit;
}

/* Value Input Row - match height with other options */
.value-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    margin-bottom: 20px;
    height: 54px; /* Exact height match with .value-option */
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-size: 1.1em;
    line-height: 1.2;
}

.value-input-row:hover {
    border-color: #007bff;
}

.value-input-field {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 200px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.currency-prefix {
    font-weight: 500;
    color: #6c757d;
    font-size: inherit;
    line-height: inherit;
}

/* Slider Container - now shorter and inline */
.slider-container {
    flex: 1;
    max-width: 300px;
    min-width: 200px;
    display: flex;
    align-items: center;
    position: relative;
}

/* Range Slider Styling */
.value-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: transparent;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
    border: none;
    position: relative;
    z-index: 100;
}

.value-slider:hover {
    opacity: 1;
}

.value-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s;
    position: relative;
    z-index: 999;
    border: 2px solid white;
}

.value-slider::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.value-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s;
    position: relative;
    z-index: 999;
}

.value-slider::-moz-range-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.value-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #e0e0e0;
    border-radius: 5px;
}

.value-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #e0e0e0;
    border-radius: 5px;
}

/* Full gradient background - always visible */
.slider-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    width: 100%;
    background: linear-gradient(to right, #28a745 0%, #ffc107 50%, #dc3545 100%);
    border-radius: 5px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

/* Gray overlay that covers the right side */
.slider-overlay {
    position: absolute;
    top: 50%;
    right: 0;
    height: 8px;
    width: 100%;
    background: #e0e0e0;
    border-radius: 5px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

/* Ensure slider thumb is above everything */
.value-slider::-webkit-slider-thumb {
    position: relative;
    z-index: 10;
}

.value-slider::-moz-range-thumb {
    z-index: 10;
}

/* Overflow Mode Animations */
.value-slider.overflow-active::-webkit-slider-thumb {
    background: linear-gradient(45deg, #ff6b6b, #ff0000) !important;
    animation: overflow-pulse 0.6s ease-in-out infinite !important;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.7) !important;
    border-color: #ff0000 !important;
}

.value-slider.overflow-active::-moz-range-thumb {
    background: linear-gradient(45deg, #ff6b6b, #ff0000) !important;
    animation: overflow-pulse 0.6s ease-in-out infinite !important;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.7) !important;
    border-color: #ff0000 !important;
}

@keyframes overflow-pulse {
    0% { 
        transform: scale(1.0);
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    }
    50% { 
        transform: scale(1.3);
        box-shadow: 0 0 25px rgba(255, 0, 0, 1.0);
    }
    100% { 
        transform: scale(1.0);
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    }
}

/* Overflow mode container effects */
.slider-container.overflow-mode .slider-overlay {
    background: linear-gradient(to right, transparent, rgba(255, 0, 0, 0.2)) !important;
    animation: overflow-glow 1.5s ease-in-out infinite !important;
}

@keyframes overflow-glow {
    0% { 
        opacity: 0.3;
    }
    50% { 
        opacity: 0.7;
    }
    100% { 
        opacity: 0.3;
    }
}

/* Additional visual feedback for overflow mode */
.slider-container.overflow-mode {
    position: relative;
}

.slider-container.overflow-mode::after {
    content: '∞';
    position: absolute;
    top: -25px;
    right: 10px;
    color: #ff0000;
    font-size: 1.2rem;
    font-weight: bold;
    animation: float-infinity 1s ease-in-out infinite;
}

@keyframes float-infinity {
    0%, 100% { 
        transform: translateY(0);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-3px);
        opacity: 1.0;
    }
}

/* Slider Labels */
.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8em;
    color: #6c757d;
}

.slider-label-min,
.slider-label-max {
    font-weight: 500;
}

/* Continue/End Prompt */
.continue-prompt {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
}

.continue-prompt h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.continue-prompt p {
    margin-bottom: 20px;
    color: #6c757d;
}

.continue-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Buttons */
.navigation-container {
    display: none !important;
    justify-content: space-between !important;
    margin-bottom: 20px !important;
    gap: 15px !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

/* 🚨 THE FORWARD BUTTON STAYS ON THE RIGHT EVEN WHEN IT IS ALONE.
   space-between puts Back left and Next right — but Back is hidden on the
   first step of a question, and a lone child under space-between sits at the
   START, so "下一步" jumped to the bottom LEFT there while "完成问题" stayed
   bottom right on the next screen. Credamo, via Qidan, 2026-09-11: "电脑端感觉
   一会点击左边一会点击右边有点不习惯". margin-left:auto pins them right in both
   cases and changes nothing when Back is visible. */
#next-btn,
#complete-btn {
    margin-left: auto !important;
}

/* Show navigation only when survey is active */
.esg-survey-container.survey-active .navigation-container {
    display: flex !important;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* Demographic Collection Styles */
.demographic-collection {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px 25px;
    margin-bottom: 20px;
}

.demographic-header {
    text-align: center;
    margin-bottom: 30px;
}

.demographic-header h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: 600;
}

.demographic-subtitle {
    color: #6c757d;
    font-size: 1em;
    margin: 0;
    font-style: italic;
}

.demographic-form {
    max-width: 600px;
    margin: 0 auto;
}

.demographic-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.demographic-field {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 20px;
}

.demographic-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
    flex: 0 0 140px;
    margin: 0;
}

.demographic-select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background-color: white;
    font-size: 1em;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    min-width: 0;
}

.demographic-select:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.demographic-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.demographic-select option {
    padding: 8px;
    font-size: 1em;
}

.demographic-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Mobile responsive for demographic form */
@media (max-width: 768px) {
    .demographic-collection {
        padding: 20px 15px;
    }
    
    .demographic-header h3 {
        font-size: 1.2em;
    }
    
    .demographic-subtitle {
        font-size: 0.9em;
    }
    
    .demographic-fields {
        gap: 15px;
    }
    
    .demographic-field {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .demographic-label {
        font-size: 0.95em;
        flex: none;
        margin-bottom: 5px;
    }
    
    .demographic-select {
        padding: 10px 12px;
        font-size: 0.95em;
        padding-right: 35px;
        background-size: 14px;
    }
    
    .demographic-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .demographic-buttons .btn {
        width: 100%;
    }
}

/* SCC Clickable Text */
.scc-clickable-text {
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 2px dotted #007bff;
}

.scc-clickable-text:hover {
    color: #0056b3;
    border-bottom: 2px dotted #0056b3;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.ab-clickable-text {
    color: #007bff !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    border-bottom: 2px dotted #007bff !important;
}

.ab-clickable-text:hover {
    color: #0056b3 !important;
    border-bottom: 2px dotted #0056b3 !important;
    background-color: rgba(0, 123, 255, 0.1) !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
}

/* SCC Modal Styles */
.scc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.scc-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.scc-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scc-modal-title {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.scc-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.scc-modal-close:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.scc-modal-body {
    padding: 25px;
}

.scc-modal-content {
    font-size: 1em;
    line-height: 1.6;
    color: #495057;
}

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

.scc-modal-content p:last-child {
    margin-bottom: 0;
}

.scc-modal-footer {
    padding: 15px 25px 20px;
    display: flex;
    justify-content: center;
}

.scc-modal-footer .btn {
    min-width: 100px;
}

/* Mobile responsive for SCC modal */
@media (max-width: 768px) {
    .scc-modal-backdrop {
        padding: 10px;
    }
    
    .scc-modal {
        max-height: 90vh;
    }
    
    .scc-modal-header {
        padding: 15px 20px;
    }
    
    .scc-modal-title {
        font-size: 1.1em;
    }
    
    .scc-modal-body {
        padding: 20px;
    }
    
    .scc-modal-content {
        font-size: 0.95em;
    }
    
    .scc-modal-footer {
        padding: 15px 20px;
    }
    
    .scc-clickable-text:hover {
        background-color: rgba(0, 123, 255, 0.15);
        padding: 3px 6px;
    }
}

/* Final completion */
.completion-container {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.completion-icon {
    font-size: 4em;
    color: #28a745;
    margin-bottom: 20px;
}

/* Group Completion Styles */
.group-completion-container {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border-radius: 15px;
    border: 1px solid #e3e8ff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    max-width: 600px;
    margin: 0 auto;
}

.group-completion-content {
    position: relative;
}

.group-completion-container .completion-icon {
    font-size: 5em;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
    text-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    animation: celebrateIcon 0.8s ease-out;
}

@keyframes celebrateIcon {
    0% { transform: scale(0.5) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.group-completion-container h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.group-completion-container p {
    font-size: 1.1rem;
    color: #555;
    margin: 10px 0;
    line-height: 1.6;
}


.group-completion-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 35px;
}

.group-completion-buttons .btn {
    min-width: 180px;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.group-completion-buttons .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.group-completion-buttons .btn:hover::before {
    left: 100%;
}

.group-completion-buttons .btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    transform: translateY(0);
}

.group-completion-buttons .btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,123,255,0.3);
}

.group-completion-buttons .btn-secondary {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
    transform: translateY(0);
}

.group-completion-buttons .btn-secondary:hover {
    background: linear-gradient(45deg, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108,117,125,0.3);
}

/* Mobile responsiveness for group completion */
@media (max-width: 768px) {
    .group-completion-container {
        padding: 40px 20px;
        margin: 0 10px;
    }
    
    .group-completion-container .completion-icon {
        font-size: 4em;
    }
    
    .group-completion-container h2 {
        font-size: 1.8rem;
    }
    
    .group-completion-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .group-completion-buttons .btn {
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }
}

/* Error States */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header title mobile styling */
    .survey-main-title {
        font-size: 1.6rem;
    }
    
    .survey-header-title {
        padding: 15px 10px;
    }
    
    .esg-language-switcher {
        padding: 3px;
    }
    
    .esg-lang-btn {
        font-size: 18px;
        padding: 4px 6px;
    }
    
    /* Improved mobile choice layout */
    .choice-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    .choice-option {
        flex: 1 !important;
        padding: 15px 12px;
        min-height: auto;
    }

    /* Mobile image styles */
    .option-image {
        max-width: 100%;
        margin-bottom: 6px;
    }
    
    /* Better info box positioning */
    .info-box {
        flex: 1;
        margin-top: 5px;
        position: relative;
        max-height: none;
        overflow-y: visible;
    }
    
    /* Ensure info boxes don't overlap other choices */
    .choice-row.has-active-info {
        margin-bottom: 30px;
    }
    
    /* Mobile info box content styling */
    .info-box h4 {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .info-box p {
        font-size: 0.8em;
        line-height: 1.4;
        margin: 0;
    }
    
    .navigation-container {
        flex-direction: column;
        gap: 10px !important;
        margin-top: 20px;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .continue-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .tooltip {
        max-width: 250px;
        left: 50% !important;
        transform: translateX(-50%);
    }
    
    /* Mobile-specific text sizing */
    .option-text {
        font-size: 0.95em;
        line-height: 1.4;
    }
    
    /* Value input container mobile spacing */
    .value-input-container {
        margin-top: 8px;
        gap: 15px;
    }
    
    /* Tighter intro page on mobile */
    .esg-survey-container .intro-content {
        padding: 25px 20px !important;
    }
    
    /* Mobile intro styling */
    .intro-main p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }
    
    .info-point {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-bottom: 20px !important;
    }
    
    .info-label {
        min-width: auto !important;
        margin-right: 0 !important;
        margin-bottom: 5px !important;
        font-size: 0.95rem !important;
    }
    
    .info-text {
        font-size: 0.9rem !important;
    }
    
    .intro-info-points {
        padding: 20px !important;
        margin: 25px 0 !important;
    }
    
    .intro-closing p {
        font-size: 0.9rem !important;
    }
    
    /* Mobile - stack input and slider vertically */
    .value-input-row {
        flex-direction: column;
        gap: 15px;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .value-input-field {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }
    
    .slider-container {
        max-width: none;
        min-width: auto;
        width: 100%;
    }
    
    .value-slider {
        height: 10px;
    }
    
    .value-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .value-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
    
    .slider-labels {
        font-size: 0.75em;
        margin-top: 8px;
    }
}
/* ===================================================================== */
/* Phone gate (v2: collect respondent phone number before first question) */
/* ===================================================================== */

.phone-gate {
    max-width: 520px;
    margin: 0 auto;
    padding: 30px 20px;
    text-align: center;
}

.phone-gate-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 25px 0 5px;
    text-align: left;
}

.phone-gate-field .demographic-label {
    flex: none;
}

.phone-gate-input {
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1.1em;
    color: #333;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.phone-gate-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.phone-gate-input-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1) !important;
}

.phone-gate-error {
    color: #dc3545;
    font-size: 0.9em;
}

.phone-gate-note {
    font-size: 0.85em;
    color: #6c757d;
    line-height: 1.6;
    margin: 15px 0 20px;
    text-align: left;
}

/* ===================================================================== */
/* Demographics — mandatory fields (no skip)                             */
/* ===================================================================== */

.demographic-required {
    color: #dc3545;
    font-weight: 700;
    margin-left: 2px;
}

.demographic-error {
    color: #dc3545;
    font-size: 0.9em;
    text-align: center;
    margin: 12px 0 4px;
}
