/* Base container styles */
.custom-form-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: clamp(15px, 4vw, 30px);
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: clamp(8px, 2vw, 15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Typography */
.custom-form-container h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.custom-form-container label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: clamp(4px, 1vw, 8px);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Form controls */
.custom-form-container .form-control,
.custom-form-container .form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: clamp(8px, 2vw, 12px);
    font-size: clamp(0.875rem, 2vw, 1rem);
    width: 100%;
    transition: all 0.3s ease;
}

/* Button styles */
.custom-form-container .btn {
    padding: clamp(8px, 2vw, 12px) clamp(15px, 3vw, 30px);
    font-size: clamp(0.875rem, 2vw, 1rem);
    white-space: nowrap;
    margin: 5px;
}

/* Responsive grid */
@media (max-width: 768px) {
    .row {
        margin: 0;
    }
    
    .col-md-6 {
        padding: 5px;
    }
    
    .custom-form-container .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
}

/* Enhanced visual feedback */
.custom-form-container .form-control:focus,
.custom-form-container .form-select:focus {
    box-shadow: 0 0 0 3px rgba(161, 0, 11, 0.2);
    border-color: #a1000b;
    outline: none;
}

/* Button variations */
.btn-custom-primary {
    background: linear-gradient(145deg, #a1000b, #8b0009);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(161, 0, 11, 0.3);
}

.btn-custom-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(161, 0, 11, 0.4);
    color: white;
}

.btn-custom-secondary {
    background: #ffffff;
    color: #2c3e50;
    border: 2px solid #e0e0e0;
}

.btn-custom-secondary:hover {
    background: #f8f9fa;
    border-color: #a1000b;
    color: #a1000b;
}

/* Form elements spacing */
.form-check {
    margin-bottom: clamp(8px, 2vw, 12px);
}

.form-check-input:checked {
    background-color: #a1000b;
    border-color: #a1000b;
}

/* Preview section */
#form-preview {
    margin-top: clamp(15px, 3vw, 20px);
    padding: clamp(15px, 3vw, 20px);
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 2px dashed #e0e0e0;
}

/* Mobile optimizations */
@media (max-width: 576px) {
    .custom-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .col-12 {
        margin-bottom: 10px;
    }
    
    .btn-group-vertical > .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .text-center {
        text-align: center !important;
    }
    
    .custom-form-container .btn {
        margin-bottom: 10px;
    }
}

/* Tablet optimizations */
@media (min-width: 577px) and (max-width: 991px) {
    .custom-form-container {
        max-width: 90%;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .custom-form-container * {
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-form-container {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .btn-custom-primary {
        background: #a1000b;
        box-shadow: none;
    }
}

.preview-container {
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-container table {
    margin-bottom: 0;
}

.preview-container th {
    width: 30%;
    background-color: #f8f9fa;
}
