/**
 * Multi-Step Form Frontend Styles
 * Modern, responsive styling for the multi-step form
 */

.multistep-form {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

/* Loading state */
.multistep-form.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multistep-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1001;
}

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

/* Progress Bar */
.form-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e1e5e9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Form Content */
.form-content {
    min-height: 400px;
    position: relative;
}

.form-step {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.form-step h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.4;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.form-option {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.form-option:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.15);
}

.form-option.selected {
    border-color: #007cba;
    background: #f0f8ff;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.2);
}

.form-option.selected::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.option-image img {
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.option-icon {
    font-size: 2.5rem;
    color: #007cba;
}

.option-text {
    font-weight: 500;
    color: #333;
    font-size: 1rem;
    line-height: 1.4;
}

/* Contact Form */
.contact-step {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

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

.form-field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-field input,
.form-field textarea,
.form-field select {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #fff;
}

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

.form-field input.error,
.form-field textarea.error,
.form-field select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

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

.field-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Checkbox styling */
.form-field input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.checkbox-label {
    font-weight: normal;
    color: #666;
    cursor: pointer;
}

/* Success Step */
.success-step {
    text-align: center;
    padding: 2rem;
}

.success-message h3 {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-message p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

/* Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e5e9;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Error Messages */
.form-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .multistep-form {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-option {
        padding: 1.25rem;
    }
    
    .option-icon {
        font-size: 2rem;
    }
    
    .form-step h3 {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.95rem;
        min-width: 100px;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-navigation .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .multistep-form {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .options-grid {
        gap: 0.75rem;
    }
    
    .form-option {
        padding: 1rem;
    }
    
    .option-content {
        gap: 0.5rem;
    }
    
    .contact-form {
        gap: 1rem;
    }
}

/* Animation for form transitions */
.multistep-form.in-viewport {
    animation: fadeInUp 0.6s ease;
}

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

/* Focus styles for accessibility */
.form-option:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-option {
        border-width: 3px;
    }
    
    .form-option.selected {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-option,
    .btn,
    .progress-fill,
    .form-step {
        transition: none;
    }
    
    .multistep-form.in-viewport {
        animation: none;
    }
}