/* Base styles for the KYC Form System */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Form styles */
.form-step {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Progress bar animation */
#progress-bar {
    transition: width 0.3s ease-in-out;
}

/* File upload styles */
.file-upload {
    transition: all 0.2s ease-in-out;
}

.file-upload:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-upload.dragover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Signature canvas */
#signatureCanvas {
    border: 2px dashed #d1d5db;
    cursor: crosshair;
}

#signatureCanvas:hover {
    border-color: #3b82f6;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-reviewing {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-approved {
    background-color: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    /* Container adjustments */
    .max-w-4xl {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Form grid improvements */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Form step improvements */
    .form-step {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-step h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .form-step h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Form group improvements */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Input field improvements */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #d1d5db;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Button improvements */
    .btn-next, .btn-previous {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        border-radius: 0.5rem;
        min-height: 48px; /* Minimum touch target size */
    }
    
    /* Header improvements */
    .text-3xl {
        font-size: 1.75rem;
    }
    
    /* Progress bar improvements */
    .w-full {
        margin-bottom: 1rem;
    }
    
    /* Test data buttons */
    #fill-test-data, #skip-to-upload {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .form-step {
        break-inside: avoid;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Red Button Styles */
.btn-red {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-red:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-red:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.btn-red-secondary {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-red-secondary:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-red-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

/* Enhanced Section Headers */
.section-header {
    margin: 2rem 0 1.5rem 0;
    position: relative;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title i {
    color: #dc2626;
    font-size: 1.25rem;
}

/* Removed section dividers - using subtle background and spacing instead */

/* Enhanced Form Styling */
.form-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.form-label i {
    color: #6b7280;
    font-size: 0.9rem;
    width: 16px;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    transform: translateY(-1px);
}

.form-input:hover, .form-select:hover {
    border-color: #d1d5db;
}

.form-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Enhanced form group styling */
.form-group {
    position: relative;
    margin-bottom: 1rem;
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.form-group:hover {
    border-color: #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Form grid enhancements */
.form-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #fafbfc;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
}

/* Enhanced section styling */
.section-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #dc2626;
    padding: 0.75rem 1rem;
    margin: 1.5rem 0 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title i {
    color: #dc2626;
    font-size: 1rem;
    margin-right: 0.5rem;
    background: rgba(220, 38, 38, 0.1);
    padding: 0.375rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Responsive Form Grid */
@media (max-width: 768px) {
    .form-grid[style*="grid-template-columns: 0.5fr 3.5fr"] {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .form-grid[style*="grid-template-columns: 0.5fr 3.5fr"] .form-group:first-child {
        margin-bottom: 0;
    }
}

/* Enhanced Mobile Responsiveness for Small Screens */
@media (max-width: 640px) {
    /* Container and layout */
    .max-w-4xl {
        max-width: 100%;
        padding: 0 0.75rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .section-header {
        margin: 1rem 0 0.75rem 0;
    }
    
    /* Mobile form container adjustments */
    .form-container {
        padding: 0.75rem;
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
    }
    
    /* Enhanced mobile navigation */
    .form-actions {
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        padding: 1rem !important;
        border-top: 1px solid #e5e7eb !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
        z-index: 20 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Mobile button styling - optimized */
    .btn-next, .btn-previous {
        width: 100%;
        padding: 0.875rem;
        font-size: 0.95rem;
        font-weight: 600;
        min-height: 44px;
        border-radius: 0.375rem;
        touch-action: manipulation;
    }
    
    /* Reduce form spacing on mobile */
    .form-section {
        margin-bottom: 1rem;
    }
    
    /* Enhanced mobile input styling - optimized */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem;
        border-radius: 0.375rem;
        border: 1px solid #d1d5db;
        width: 100%;
        box-sizing: border-box;
        touch-action: manipulation;
    }
    
    /* Radio button and checkbox improvements */
    input[type="radio"], input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 0.5rem;
        transform: scale(1.2);
    }
    
    /* Label improvements for touch */
    label {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 0.25rem;
        display: block;
    }
    
    /* Header improvements for mobile - optimized */
    .text-3xl {
        font-size: 1.375rem;
        line-height: 1.3;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    /* Progress bar mobile improvements */
    .w-full {
        margin-bottom: 0.75rem;
    }
    
    /* Test data buttons mobile - optimized */
    #fill-test-data, #skip-to-upload {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.625rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    /* Mobile-specific improvements for file uploads */
    .file-upload {
        padding: 1rem;
        border: 2px dashed #d1d5db;
        border-radius: 0.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    /* Mobile signature canvas */
    #signatureCanvas {
        width: 100%;
        height: 150px;
        border: 2px dashed #d1d5db;
        border-radius: 0.5rem;
    }
    
    /* Mobile amenity checkboxes */
    .amenity-group {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .amenity-item {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: #f9fafb;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile amenity header (icon + title) */
    .amenity-item > div:first-child {
        display: flex;
        align-items: center;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile amenity radio buttons container */
    .amenity-item > div:last-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    /* Mobile amenity radio button groups */
    .amenity-item .radio-group {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 1;
        justify-content: center;
    }
    
    /* Mobile amenity radio buttons */
    .amenity-item input[type="radio"] {
        width: 18px;
        height: 18px;
        margin-right: 0.5rem;
        transform: scale(1.1);
    }
    
    /* Mobile amenity labels */
    .amenity-item label {
        font-size: 0.9rem;
        line-height: 1.3;
        margin: 0;
        white-space: nowrap;
    }
    
    /* Mobile estate details */
    .estate-details {
        background: #f8fafc;
        padding: 1rem;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile download message */
    .rules-message {
        padding: 1rem;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        border-radius: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .rules-message a {
        display: inline-block;
        padding: 0.5rem 1rem;
        background: #3b82f6;
        color: white;
        text-decoration: none;
        border-radius: 0.375rem;
        font-weight: 500;
        margin-top: 0.5rem;
    }
}

/* Extra Small Mobile Screens (Portrait Phones) */
@media (max-width: 480px) {
    /* Ultra-compact layout */
    .max-w-4xl {
        padding: 0 0.5rem;
    }
    
    .form-container {
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .form-step {
        padding: 0.75rem;
    }
    
    /* Compact headers */
    .text-3xl {
        font-size: 1.25rem;
        line-height: 1.2;
    }
    
    .text-xl {
        font-size: 1rem;
    }
    
    /* Compact form elements */
    input, select, textarea {
        padding: 0.625rem;
        font-size: 16px;
    }
    
    /* Compact buttons - optimized */
    .btn-next, .btn-previous {
        padding: 0.75rem;
        font-size: 0.9rem;
        min-height: 42px;
    }
    
    /* Compact test buttons - optimized */
    #fill-test-data, #skip-to-upload {
        padding: 0.5rem;
        font-size: 0.75rem;
        min-height: 38px;
    }
    
    /* Compact signature canvas */
    #signatureCanvas {
        height: 120px;
    }
    
    /* Compact amenity items */
    .amenity-item {
        padding: 0.375rem;
        font-size: 0.85rem;
    }
    
    /* Compact estate details */
    .estate-details {
        padding: 0.75rem;
    }
    
    /* Compact download message */
    .rules-message {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .rules-message a {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Extra Small Mobile Screens (Portrait Phones) */
@media (max-width: 480px) {
    /* Ultra-compact layout */
    .max-w-4xl {
        padding: 0 0.5rem;
    }
    
    .form-container {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .form-step {
        padding: 0.75rem;
    }
    
    /* Compact headers */
    .text-3xl {
        font-size: 1.25rem;
        line-height: 1.2;
    }
    
    .text-xl {
        font-size: 1rem;
    }
    
    /* Compact form elements */
    input, select, textarea {
        padding: 0.75rem;
        font-size: 16px;
    }
    
    /* Compact buttons */
    .btn-next, .btn-previous {
        padding: 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    /* Compact form groups */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Compact labels */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    /* Compact sections */
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Fix mobile amenity layout */
    .amenity-group {
        gap: 0.5rem;
    }
    
    .amenity-item {
        padding: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .amenity-item label {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    /* Fix mobile form grid */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Fix mobile button layout */
    .form-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }
    
    .btn-next, .btn-previous {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Fix mobile form step padding */
    .form-step {
        padding: 1rem !important;
    }
    
    /* Fix mobile container padding */
    .form-container {
        padding: 1rem !important;
    }
    
    /* Fix mobile rules message */
    .rules-message {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
    
    /* Fix mobile download link */
    .download-link {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
}

/* Enhanced Mobile Responsiveness for KYC Form */
@media (max-width: 768px) {
    /* Main container adjustments */
    .min-h-screen {
        padding: 0.5rem;
    }
    
    .max-w-4xl {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    /* Header adjustments */
    .text-3xl {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }
    
    .text-center {
        text-align: left !important;
    }
    
    .mb-8 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Test data buttons */
    .space-y-2 > * + * {
        margin-top: 0.5rem !important;
    }
    
    #fill-test-data, #skip-to-upload {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
        min-height: 44px !important;
    }
    
    /* Progress bar */
    .mb-8 {
        margin-bottom: 1.5rem !important;
    }
    
    .h-2 {
        height: 0.5rem !important;
    }
    
    /* Form container */
    .form-container {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 0.75rem !important;
    }
    
    /* Estate information sections */
    .bg-green-50 {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .text-lg {
        font-size: 1rem !important;
    }
    
    .text-sm {
        font-size: 0.875rem !important;
    }
    
    /* Navigation buttons */
    .form-actions {
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        padding: 1rem !important;
        border-top: 1px solid #e5e7eb !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
        z-index: 20 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .btn-next, .btn-previous {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        min-height: 48px !important;
        border-radius: 0.5rem !important;
        touch-action: manipulation !important;
    }
    
    /* Text truncation fixes */
    .text-ellipsis {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* Ensure text doesn't get cut off */
    .text-sm, .text-xs {
        line-height: 1.4 !important;
        word-wrap: break-word !important;
    }
    
    /* Estate information mobile layout */
    .estate-info {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    .estate-info h3 {
        font-size: 1.125rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .estate-info p {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
}

/* Extra Small Mobile Screens */
@media (max-width: 480px) {
    .min-h-screen {
        padding: 0.25rem;
    }
    
    .max-w-4xl {
        padding: 0 0.25rem;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .form-container {
        padding: 0.75rem !important;
    }
    
    .estate-info {
        padding: 0.75rem !important;
    }
    
    .btn-next, .btn-previous {
        padding: 0.875rem !important;
        font-size: 0.95rem !important;
    }
    
    #fill-test-data, #skip-to-upload {
        padding: 0.625rem !important;
        font-size: 0.8rem !important;
    }
}

/* Mobile-Friendly Modal Styles */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
}

.modal-box {
    background: white !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: relative !important;
    width: 100% !important;
    max-width: 500px !important;
}

.modal-close {
    position: absolute !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
    background: #ef4444 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 2rem !important;
    height: 2rem !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1001 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.modal-close:hover {
    background: #dc2626 !important;
    transform: scale(1.05) !important;
}

.modal-close:active {
    transform: scale(0.95) !important;
}

/* Mobile Modal Responsiveness */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.5rem !important;
        align-items: flex-start !important;
        padding-top: 2rem !important;
    }
    
    .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        margin: 0 !important;
        border-radius: 0.5rem !important;
    }
    
    .modal-close {
        top: 0.5rem !important;
        right: 0.5rem !important;
        width: 1.75rem !important;
        height: 1.75rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Modal content mobile adjustments */
    .modal-box .flex {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .modal-box .text-lg {
        font-size: 1rem !important;
    }
    
    .modal-box .text-sm {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
    
    .modal-box .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .modal-box .py-1 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .modal-box .mr-4 {
        margin-right: 0.75rem !important;
    }
    
    .modal-box .h-8.w-8 {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .modal-box .h-6.w-6 {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0.25rem !important;
        padding-top: 1rem !important;
    }
    
    .modal-box {
        max-height: 80vh !important;
        border-radius: 0.375rem !important;
    }
    
    .modal-close {
        top: 0.5rem !important;
        right: 0.5rem !important;
        width: 1.75rem !important;
        height: 1.75rem !important;
        font-size: 0.875rem !important;
    }
    
    .modal-box .text-lg {
        font-size: 0.875rem !important;
    }
    
    .modal-box .text-sm {
        font-size: 0.8rem !important;
    }
    
    .modal-box .mb-4 {
        margin-bottom: 0.75rem !important;
    }
}

/* Compact Form Optimization Styles */
.btn-compact {
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    min-height: 44px;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-compact-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 40px;
    border-radius: 0.375rem;
    font-weight: 600;
}

.text-compact-3xl {
    font-size: 1.5rem;
    line-height: 1.3;
}

.text-compact-xl {
    font-size: 1.125rem;
    line-height: 1.4;
}

.text-compact-lg {
    font-size: 1rem;
    line-height: 1.4;
}

.form-compact input,
.form-compact select,
.form-compact textarea {
    padding: 0.625rem;
    font-size: 16px;
    border-radius: 0.375rem;
}

.form-compact .form-group {
    margin-bottom: 0.75rem;
}

.section-compact {
    margin: 1.5rem 0 1rem 0;
}

.section-compact .section-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

/* Optimized Button Sizes */
.btn-red {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 44px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-red-secondary {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 44px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Optimized Navigation Buttons */
.btn-next, .btn-previous {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    min-height: 44px;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: auto;
    max-width: 200px;
}

/* Optimized Test Data Buttons */
#fill-test-data, #skip-to-upload {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    min-height: 40px;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

/* Optimized Section Headers */
.section-header {
    margin: 1.5rem 0 1rem 0;
    position: relative;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

/* Optimized Form Elements */
.form-group {
    margin-bottom: 0.75rem;
}

input, select, textarea {
    font-size: 16px;
    padding: 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
    width: 100%;
}

/* Optimized Radio Buttons and Checkboxes */
input[type="radio"], input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    transform: scale(1.1);
}

/* Optimized Labels */
label {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    display: block;
    font-weight: 500;
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Error states */
.error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.field-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Success states */
.success {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.field-success {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1) !important;
}

/* Modal styles */
.modal-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: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    position: relative;
    transform: translateY(-20px);
    animation: slideIn 0.3s ease-in-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
}

.modal-close:hover {
    color: #1f2937;
}

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