/* Room2Exchange Forms CSS - Modern Multi-step Forms */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    --r2e-primary: #502399;
    --r2e-primary-dark: #3a1a7d;
    --r2e-secondary: #000000;
    --r2e-success: #10b981;
    --r2e-error: #ef4444;
    --r2e-warning: #f59e0b;
    --r2e-info: #3b82f6;
    --r2e-background: #ffffff;
    --r2e-surface: #f8fafc;
    --r2e-border: #000000;
    --r2e-text: #000000;
    --r2e-text-light: #64748b;
    --r2e-shadow: none;
    --r2e-shadow-lg: none;
    --r2e-radius: 0;
    --r2e-radius-lg: 0;
}

/* Base form container */
.r2e-form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Form wrapper */
.r2e-form-wrapper {
    background: var(--r2e-background);
    border-radius: var(--r2e-radius-lg);
    box-shadow: var(--r2e-shadow-lg);
    overflow: hidden;
}

/* Form header */
.r2e-form-header {
    background: linear-gradient(135deg, var(--r2e-primary) 0%, var(--r2e-primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.r2e-form-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
}

.r2e-form-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.125rem;
    font-weight: 400;
}

/* Progress indicator */
.r2e-progress-container {
    background: var(--r2e-surface);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--r2e-border);
}

.r2e-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.r2e-progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--r2e-border);
    z-index: 1;
}

.r2e-progress-line {
    position: absolute;
    top: 50%;
    left: 0;
    height: 2px;
    background: var(--r2e-primary);
    transition: width 0.3s ease;
    z-index: 2;
}

.r2e-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
}

.r2e-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--r2e-background);
    border: 3px solid var(--r2e-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.r2e-step-circle.active {
    background: var(--r2e-primary);
    border-color: var(--r2e-primary);
    color: white;
}

.r2e-step-circle.completed {
    background: var(--r2e-success);
    border-color: var(--r2e-success);
    color: white;
}

.r2e-step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--r2e-text-light);
    text-align: center;
    max-width: 80px;
}

.r2e-step-label.active {
    color: var(--r2e-primary);
    font-weight: 600;
}

/* Form content */
.r2e-form-content {
    padding: 2rem;
}

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

.r2e-form-step.active {
    display: block;
}

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

/* Form sections */
.r2e-form-section {
    margin-bottom: 2rem;
}

.r2e-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--r2e-text);
    margin-bottom: 0.5rem;
}

.r2e-section-description {
    color: var(--r2e-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Form groups */
.r2e-form-group {
    margin-bottom: 1.5rem;
}

.r2e-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.r2e-form-row.three-cols {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Labels */
.r2e-label {
    display: block;
    font-weight: 500;
    color: var(--r2e-text);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.r2e-label.required::after {
    content: ' *';
    color: var(--r2e-error);
}

/* Input fields */
.r2e-input,
.r2e-select,
.r2e-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--r2e-border);
    border-radius: var(--r2e-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--r2e-background);
    color: var(--r2e-text);
}

.r2e-input:focus,
.r2e-select:focus,
.r2e-textarea:focus {
    outline: none;
    border-color: var(--r2e-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.r2e-input.error,
.r2e-select.error,
.r2e-textarea.error {
    border-color: var(--r2e-error);
}

.r2e-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox and radio styles */
.r2e-checkbox-group,
.r2e-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.r2e-checkbox-item,
.r2e-radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid var(--r2e-border);
    border-radius: var(--r2e-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.r2e-checkbox-item:hover,
.r2e-radio-item:hover {
    border-color: var(--r2e-primary);
    background: rgba(37, 99, 235, 0.02);
}

.r2e-checkbox-item.selected,
.r2e-radio-item.selected {
    border-color: var(--r2e-primary);
    background: rgba(37, 99, 235, 0.05);
}

.r2e-checkbox,
.r2e-radio {
    width: 20px;
    height: 20px;
    margin: 0;
}

/* Error messages */
.r2e-error-message {
    color: var(--r2e-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Success messages */
.r2e-success-message {
    color: var(--r2e-success);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Form navigation */
.r2e-form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--r2e-border);
    margin-top: 2rem;
}

/* Buttons */
.r2e-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--r2e-radius);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 120px;
}

.r2e-btn-primary {
    background: var(--r2e-primary);
    color: white;
}

.r2e-btn-primary:hover {
    background: var(--r2e-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--r2e-shadow);
}

.r2e-btn-secondary {
    background: var(--r2e-surface);
    color: var(--r2e-text);
    border: 2px solid var(--r2e-border);
}

.r2e-btn-secondary:hover {
    background: var(--r2e-background);
    border-color: var(--r2e-primary);
    color: var(--r2e-primary);
}

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

.r2e-btn-loading {
    position: relative;
    color: transparent !important;
}

.r2e-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 currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* File upload */
.r2e-file-upload {
    border: 2px dashed var(--r2e-border);
    border-radius: var(--r2e-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.r2e-file-upload:hover {
    border-color: var(--r2e-primary);
    background: rgba(37, 99, 235, 0.02);
}

.r2e-file-upload.dragover {
    border-color: var(--r2e-primary);
    background: rgba(37, 99, 235, 0.05);
}

.r2e-file-upload-icon {
    font-size: 2rem;
    color: var(--r2e-text-light);
    margin-bottom: 1rem;
}

.r2e-file-upload-text {
    color: var(--r2e-text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.r2e-file-upload-hint {
    color: var(--r2e-text-light);
    font-size: 0.875rem;
}

/* Success Container */
.r2e-success-container {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--r2e-background);
}

.r2e-success-icon {
    margin: 0 auto 1.5rem;
    width: 64px;
    height: 64px;
    color: var(--r2e-success);
    font-size: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.r2e-success-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--r2e-text);
    margin-bottom: 1rem;
}

.r2e-success-message {
    font-size: 1.125rem;
    color: var(--r2e-text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.r2e-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

.r2e-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(80, 35, 153, 0.2);
    border-top: 3px solid var(--r2e-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Notification system */
.r2e-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    min-width: 300px;
    background: var(--r2e-background);
    border: 2px solid var(--r2e-border);
    border-radius: var(--r2e-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.r2e-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.r2e-notification-content {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--r2e-text);
}

.r2e-notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--r2e-text-light);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.r2e-notification-close:hover {
    color: var(--r2e-text);
}

/* Notification types */
.r2e-notification-error {
    border-color: var(--r2e-error);
    background: #fef2f2;
}

.r2e-notification-error .r2e-notification-content {
    color: var(--r2e-error);
}

.r2e-notification-success {
    border-color: var(--r2e-success);
    background: #f0fdf4;
}

.r2e-notification-success .r2e-notification-content {
    color: var(--r2e-success);
}

.r2e-notification-warning {
    border-color: var(--r2e-warning);
    background: #fffbeb;
}

.r2e-notification-warning .r2e-notification-content {
    color: var(--r2e-warning);
}

.r2e-notification-info {
    border-color: var(--r2e-info);
    background: #eff6ff;
}

.r2e-notification-info .r2e-notification-content {
    color: var(--r2e-info);
}

/* Responsive design */
@media (max-width: 768px) {
    .r2e-form-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .r2e-form-header {
        padding: 1.5rem;
    }
    
    .r2e-form-header h1 {
        font-size: 1.5rem;
    }
    
    .r2e-form-content {
        padding: 1.5rem;
    }
    
    .r2e-progress-container {
        padding: 1rem;
    }
    
    .r2e-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .r2e-form-row.three-cols {
        grid-template-columns: 1fr;
    }
    
    .r2e-progress-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .r2e-step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.75rem;
    }
    
    .r2e-step-label {
        font-size: 0.6875rem;
        max-width: 60px;
    }
    
    .r2e-form-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .r2e-btn {
        width: 100%;
    }
    
    .r2e-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
    
    .r2e-success-container {
        padding: 2rem 1rem;
    }
    
    .r2e-success-title {
        font-size: 1.5rem;
    }
    
    .r2e-success-message {
        font-size: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --r2e-background: #1e293b;
        --r2e-surface: #334155;
        --r2e-border: #475569;
        --r2e-text: #f1f5f9;
        --r2e-text-light: #94a3b8;
    }
}

/* Animation utilities */
.r2e-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.r2e-slide-up {
    animation: slideUp 0.3s ease-in-out;
}

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

/* Utility classes */
.r2e-text-center { text-align: center; }
.r2e-text-left { text-align: left; }
.r2e-text-right { text-align: right; }

.r2e-mb-0 { margin-bottom: 0; }
.r2e-mb-1 { margin-bottom: 0.5rem; }
.r2e-mb-2 { margin-bottom: 1rem; }
.r2e-mb-3 { margin-bottom: 1.5rem; }
.r2e-mb-4 { margin-bottom: 2rem; }

.r2e-mt-0 { margin-top: 0; }
.r2e-mt-1 { margin-top: 0.5rem; }
.r2e-mt-2 { margin-top: 1rem; }
.r2e-mt-3 { margin-top: 1.5rem; }
.r2e-mt-4 { margin-top: 2rem; }

.r2e-hidden { display: none; }
.r2e-visible { display: block; }

/* Form validation styles */
.r2e-form-group.has-error .r2e-input,
.r2e-form-group.has-error .r2e-select,
.r2e-form-group.has-error .r2e-textarea {
    border-color: var(--r2e-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.r2e-form-group.has-success .r2e-input,
.r2e-form-group.has-success .r2e-select,
.r2e-form-group.has-success .r2e-textarea {
    border-color: var(--r2e-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading overlay */
.r2e-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.r2e-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Navigation spacer */
.r2e-nav-spacer {
    flex: 1;
}

/* Field groups for conditional display */
.r2e-chores-description-group {
    margin-top: 1rem;
}

.r2e-childcare-fields {
    margin-top: 1rem;
}

/* Checkbox group improvements */
.r2e-checkbox-group .r2e-checkbox-item input[type="checkbox"]:checked + label,
.r2e-radio-group .r2e-radio-item input[type="radio"]:checked + label {
    font-weight: 600;
    color: var(--r2e-primary);
}
