/* Base Styles */
.ci-form-container {
    max-width: 700px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    font-family: var(--e-global-typography-text-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: var(--e-global-typography-text-font-weight, 400);
    position: relative;
}

/* Screen Management */
.ci-screen {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.ci-screen.active {
    display: block;
}

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

/* Progress Bar */
.ci-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.ci-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6A655F 0%, #49453f 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.ci-progress-text {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

/* Welcome Screen */
.ci-welcome-content {
    text-align: center;
    padding: 40px 20px;
}

.ci-welcome-title {
    color: var(--e-global-color-primary, #323842);
    font-family: var(--e-global-typography-primary-font-family, inherit);
    font-size: var(--e-global-typography-primary-font-size, 42px);
    font-weight: var(--e-global-typography-primary-font-weight, 800);
    margin-bottom: 30px;
    line-height: var(--e-global-typography-primary-line-height, 1.2);
    letter-spacing: var(--e-global-typography-primary-letter-spacing, normal);
}

.ci-welcome-message {
    color: var(--e-global-color-text, #555);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: var(--e-global-typography-text-font-size, 18px);
    font-weight: var(--e-global-typography-text-font-weight, 400);
    line-height: var(--e-global-typography-text-line-height, 1.7);
    letter-spacing: var(--e-global-typography-text-letter-spacing, normal);
    margin-bottom: 40px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

/* Thank You Screen */
.ci-thank-you-content {
    text-align: center;
    padding: 60px 20px;
}

.ci-thank-you-title {
    color: var(--e-global-color-primary, #323842);
    font-family: var(--e-global-typography-primary-font-family, inherit);
    font-size: var(--e-global-typography-primary-font-size, 36px);
    font-weight: var(--e-global-typography-primary-font-weight, 700);
    line-height: var(--e-global-typography-primary-line-height, 1.2);
    letter-spacing: var(--e-global-typography-primary-letter-spacing, normal);
    margin-bottom: 30px;
}

.ci-thank-you-message {
    color: var(--e-global-color-text, #555);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: var(--e-global-typography-text-font-size, 18px);
    font-weight: var(--e-global-typography-text-font-weight, 400);
    line-height: var(--e-global-typography-text-line-height, 1.7);
    letter-spacing: var(--e-global-typography-text-letter-spacing, normal);
    margin-bottom: 30px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.ci-completion-icon {
    font-size: 60px;
    margin-top: 20px;
}

/* Screen Content */
.ci-screen-content {
    padding: 20px 0;
}

.ci-screen-title {
    color: var(--e-global-color-primary, #323842);
    font-family: var(--e-global-typography-primary-font-family, inherit);
    font-size: var(--e-global-typography-primary-font-size, 24px);
    font-weight: var(--e-global-typography-primary-font-weight, 600);
    line-height: var(--e-global-typography-primary-line-height, 1.3);
    letter-spacing: var(--e-global-typography-primary-letter-spacing, normal);
    margin-bottom: 15px;
    text-align: center;
}

.ci-screen-description {
    color: var(--e-global-color-text, #666);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: var(--e-global-typography-text-font-size, 16px);
    font-weight: var(--e-global-typography-text-font-weight, 400);
    line-height: var(--e-global-typography-text-line-height, 1.6);
    letter-spacing: var(--e-global-typography-text-letter-spacing, normal);
    margin-bottom: 30px;
    text-align: center;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ci-question-title {
    color: var(--e-global-color-primary, #323842);
    font-family: var(--e-global-typography-primary-font-family, inherit);
    font-size: var(--e-global-typography-primary-font-size, 26px);
    font-weight: var(--e-global-typography-primary-font-weight, 700);
    line-height: var(--e-global-typography-primary-line-height, 1.3);
    letter-spacing: var(--e-global-typography-primary-letter-spacing, normal);
    margin-bottom: 20px;
    text-align: center;
}

.ci-question-description {
    color: var(--e-global-color-text, #666);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: var(--e-global-typography-text-font-size, 14px);
    font-weight: var(--e-global-typography-text-font-weight, 400);
    line-height: var(--e-global-typography-text-line-height, 1.5);
    letter-spacing: var(--e-global-typography-text-letter-spacing, normal);
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
}

/* Form Fields */
.ci-form-fields {
    max-width: 450px;
    margin: 0 auto 30px;
}

.ci-field {
    margin-bottom: 25px;
}

.ci-field label {
    display: block;
    color: var(--e-global-color-primary, #323842);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-weight: var(--e-global-typography-text-font-weight, 600);
    font-size: var(--e-global-typography-text-font-size, 15px);
    letter-spacing: var(--e-global-typography-text-letter-spacing, normal);
    margin-bottom: 10px;
}

.ci-field input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 16px;
    background: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.ci-field input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ci-field input:valid {
    border-color: #27ae60;
}

/* Answer Options */
.ci-answer-options {
    max-width: 500px;
    margin: 0 auto 30px;
}

.ci-option {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 18px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.ci-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-1px);
}

.ci-option input[type="radio"],
.ci-option input[type="checkbox"] {
    margin-right: 15px;
    transform: scale(1.3);
}

.ci-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
}

.ci-option-text {
    flex: 1;
    color: var(--e-global-color-primary, #323842);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-weight: var(--e-global-typography-text-font-weight, 500);
    font-size: var(--e-global-typography-text-font-size, 16px);
    line-height: var(--e-global-typography-text-line-height, 1.4);
    letter-spacing: var(--e-global-typography-text-letter-spacing, normal);
}

/* Checkbox specific styling */
.ci-checkbox-option {
    margin-bottom: 12px;
    padding: 15px 18px;
}

.ci-checkbox-option input[type="checkbox"] {
    transform: scale(1.2);
}

/* Textarea */
.ci-textarea-field {
    max-width: 500px;
    margin: 0 auto 30px;
}

.ci-textarea-field textarea {
    width: 100%;
    min-height: 120px;
    padding: 18px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #fafafa;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ci-textarea-field textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Other Field */
.ci-other-field {
    max-width: 400px;
    margin: 20px auto;
}

.ci-other-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}

/* Image Options */
.ci-image-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 400px;
    margin: 0 auto 30px;
}

.ci-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.ci-image-option {
    border: 3px solid #e8e8e8;
    border-radius: 0px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.ci-image-option:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.ci-image-option.selected {
    border-color: #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.ci-image-option img {
    width: 100%;
    height: auto;
    display: block;
}

/* Navigation */
.ci-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 15px;
}

/* Buttons */
.ci-btn {
    padding: 15px 35px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    font-family: inherit;
    min-width: 120px;
}

.ci-btn-primary {
    background: #B7ACA2 !important;
    color: white !important;
    border: 2px solid #B7ACA2 !important;
}

.ci-btn-primary:hover:not(:disabled) {
    background: #A89B91 !important;
    border-color: #A89B91 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(183, 172, 162, 0.4);
}

.ci-btn-secondary {
    background: #ffffff;
    color: var(--e-global-color-primary, #323842) !important;
    border: 2px solid #e8e8e8 !important;
}

.ci-btn-secondary:hover:not(:disabled) {
    background: #f8f9fa !important;
    border-color: #ddd !important;
}

.ci-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.ci-btn-finish {
    background: #B7ACA2;
    color: white;
    border: 2px solid #B7ACA2;
}

.ci-btn-finish:hover {
    background: #A89B91;
    border-color: #A89B91;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(183, 172, 162, 0.4);
}

/* Loading State */
.ci-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.ci-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .ci-form-container {
        margin: 10px;
        padding: 25px 20px;
    }
    
    .ci-welcome-title {
        font-size: 32px;
    }
    
    .ci-welcome-message {
        font-size: 16px;
    }
    
    .ci-welcome-content {
        padding: 30px 15px;
    }
    
    .ci-question-title {
        font-size: 22px;
    }
    
    .ci-screen-title {
        font-size: 20px;
    }
    
    .ci-screen-description {
        font-size: 15px;
    }
    
    .ci-form-fields {
        max-width: 100%;
        padding: 0 5px;
    }
    
    .ci-answer-options {
        max-width: 100%;
    }
    
    .ci-option {
        padding: 15px;
        font-size: 15px;
    }
    
    .ci-image-options {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
    
    .ci-image-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    
    .ci-navigation {
        flex-direction: column;
        gap: 12px;
    }
    
    .ci-btn {
        width: 100%;
        padding: 18px 25px;
    }
    
    .ci-progress-text {
        top: -25px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .ci-image-grid {
        grid-template-columns: 1fr;
        max-width: 200px;
    }
    
    .ci-welcome-title {
        font-size: 28px;
    }
    
    .ci-question-title {
        font-size: 20px;
    }
}