body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Form Container */
.form-container {
    /* max-width: 900px; */
    margin: 0 auto;
}

/* Modern Header */
.form-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 0.5rem;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.form-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="white" fill-opacity="0.1"/></svg>') repeat;
    background-size: 50px 50px;
}

.header-content {
    position: relative;
    z-index: 2;
}

.header-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    opacity: 0.9;
    margin: 0;
}

/* Modern Form Card */
.form-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 0 0 20px 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-large);
    padding: 0;
    overflow: hidden;
}

.form-body {
    padding: 3rem;
}


/* Form Sections */
.form-section {
    background: rgba(248, 250, 252, 0.5);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(234, 91, 43, 0.1);
}

.section-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.section-description {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

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

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label .required {
    color: #ef4444;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: white;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 0.2rem rgba(234, 91, 43, 0.25);
    transform: translateY(-1px);
}

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

/* Validation Styles */
.form-control.is-invalid, .form-select.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.form-control.is-valid, .form-select.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25);
}

.text-danger {
    color: #ef4444 !important;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Select2 Styling */
.select2-container--bootstrap-5 .select2-selection {
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    min-height: 48px !important;
    transition: all 0.3s ease;
}

.select2-container--bootstrap-5 .select2-selection--single {
    padding: 0.75rem 1rem !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    padding: 0.5rem 1rem !important;
    min-height: 48px !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--primary-orange) !important;
    box-shadow: 0 0 0 0.2rem rgba(234, 91, 43, 0.25) !important;
}

/* Select2 Validation Styles */
.select2-container--bootstrap-5.is-invalid .select2-selection {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25) !important;
}

.select2-container--bootstrap-5.is-valid .select2-selection {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}

/* Select2 Dropdown Styling */
.select2-container--bootstrap-5 .select2-dropdown {
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-medium) !important;
    margin-top: 4px !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 0.75rem 1rem !important;
    border-radius: 8px !important;
    margin: 2px !important;
    transition: all 0.2s ease;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-orange) !important;
    color: white !important;
}

.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
    background-color: rgba(234, 91, 43, 0.1) !important;
    color: var(--primary-orange) !important;
}

#raionSelect, #localitySelect {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #374151 !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 1rem !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    border-color: #6b7280 transparent transparent transparent !important;
    border-width: 6px 4px 0 4px !important;
    transition: transform 0.2s ease;
}

.select2-container--bootstrap-5.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6b7280 transparent !important;
    border-width: 0 4px 6px 4px !important;
    transform: rotate(180deg);
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: var(--primary-orange);
    background: rgba(234, 91, 43, 0.02);
}

.file-upload-area.dragover {
    border-color: var(--primary-orange);
    background: rgba(234, 91, 43, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.file-upload-area:hover .upload-icon {
    color: var(--primary-orange);
    transform: scale(1.1);
}

.upload-text {
    color: #374151;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* File Preview */
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.file-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
    transition: all 0.2s ease;
}

.file-item:hover {
    border-color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.file-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background: var(--info-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.file-size {
    color: #9ca3af;
    font-size: 0.75rem;
}
.upload-status {
    color: #11eb1c;
    font-size: 1rem;
    font-weight: 600;
}

.file-remove {
    background: var(--danger-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-remove:hover {
    transform: scale(1.1);
}

/* Checkbox and Radio Styling */
.form-check {
    margin-bottom: 1rem;
}


.form-check-label {
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

/* Textarea */
.form-control[rows] {
    resize: vertical;
    min-height: 120px;
}

/* Modern Buttons */
.btn-modern {
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.btn-modern:hover::before {
    transform: translateY(0);
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-primary-modern {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary-modern:hover { color: white; }

.btn-success-modern {
    background: var(--success-gradient);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-success-modern:hover { color: white; }

.btn-secondary-modern {
    background: #6b7280;
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-secondary-modern:hover {
    background: #4b5563;
    color: white;
}

/* Form Actions */
.form-actions {
    background: white;
    padding: 2rem 3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.prefill-locked {
    background-color: #f0f4ff !important;
    cursor: not-allowed !important;
    color: #374151;
}

/* Select2 container - disable click/hover */
.prefill-locked-s2 {
    pointer-events: none !important;
    opacity: 0.85;
    background-color: #f0f4ff !important;
    cursor: not-allowed !important;
}

.prefill-locked-s2 .select2-selection {
    background-color: #f0f4ff !important;
    border-color: #c7d2fe !important;
}

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

/* Card modern - similar to loading-modern in dashboard, but larger */
.loading-card-modern {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem 3.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    min-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInScale .25s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}

/* Spinner in dashboard style */
.spinner-form-modern {
    width: 60px;
    height: 60px;
    border: 5px solid #e5e7eb;
    border-top: 5px solid var(--primary-color, #1a56db);
    border-radius: 50%;
    animation: spinForm 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

.loading-form-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.loading-form-sub {
    font-size: 0.875rem;
    color: #64748b;
}

/* Modal block - upload session / reload page */
.upload-reload-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeInScale .2s ease-out;
}

.upload-reload-modal-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    max-width: min(540px, 100%);
    width: 100%;
    padding: 2.75rem 2.5rem 2.25rem;
    text-align: center;
}

.upload-reload-modal-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(249, 115, 22, 0.15), rgba(234, 88, 12, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.35rem;
    color: #ea580c;
}

.upload-reload-modal-icon-wrap {
    position: relative;
}

.upload-reload-modal-time-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #fdba74;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: #c2410c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.upload-reload-modal-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.upload-reload-modal-message {
    font-size: 1rem;
    color: #475569;
    margin: 0 0 1.5rem;
    line-height: 1.55;
    word-break: break-word;
}

.upload-reload-modal-tip {
    margin: 0 0 1.35rem;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    color: #334155;
    text-align: left;
    line-height: 1.55;
}

.upload-reload-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.upload-reload-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.upload-reload-modal-btn:hover {
    transform: translateY(-1px);
}

.upload-reload-modal-btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #1a56db), #1e40af);
    color: #fff;
    box-shadow: 0 8px 24px rgba(26, 86, 219, 0.35);
}

.upload-reload-modal-btn-secondary {
    background: #f1f5f9;
    color: #334155;
}

@media (max-width: 480px) {
    .upload-reload-modal-card {
        padding: 2rem 1.5rem 1.75rem;
    }
    .upload-reload-modal-icon {
        width: 72px;
        height: 72px;
        font-size: 2rem;
    }
    .upload-reload-modal-time-badge {
        width: 26px;
        height: 26px;
        font-size: 0.68rem;
        bottom: 2px;
        right: 2px;
    }
    .upload-reload-modal-title {
        font-size: 1.2rem;
    }
}

/* Alert Messages */
.alert-modern {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success-modern {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border-left: 4px solid #10b981;
    color: #065f46;
}

.alert-danger-modern {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.alert-warning-modern {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-body {
        padding: 2rem 1.5rem;
    }
    
    .form-actions {
        padding: 1.5rem;
        flex-direction: column-reverse;
        align-items: stretch;
    }
    
    .btn-modern {
        width: 100%;
        justify-content: center;
    }
    
    
    
    .form-header {
        padding: 2rem 1.5rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .file-item {
        min-width: auto;
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    
    .form-body {
        padding: 0.5rem 0.5rem;
    }
    .form-section {
        padding: 0.5rem;
    }
    
    }

/* Asterisk styling for required fields */
.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading Overlay - duplicate eliminated, defined above */

/* Map Styles */
.map-container {
    position: relative;
}

#incident-map {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#incident-map:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.map-info {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.map-info small {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Location Search Styles */
#searchSuggestions {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
    padding: 8px 12px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f8f9fa !important;
}

.suggestion-item:active {
    background-color: #e9ecef !important;
}

.suggestion-item.selected {
    background-color: #007bff !important;
    color: white !important;
}

.suggestion-item.selected small {
    color: rgba(255, 255, 255, 0.8) !important;
}

.suggestion-item.selected i {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Styles for highlighting text */
#searchSuggestions mark {
    background-color: #fff3cd !important;
    color: #856404 !important;
    padding: 1px 2px !important;
    border-radius: 2px !important;
    font-weight: bold !important;
}

.suggestion-item.selected mark {
    background-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

/* Responsive for map */
@media (max-width: 768px) {
    #incident-map {
        height: 300px;
    }
    
    .map-container {
        margin-top: 20px;
    }
}

select option:disabled {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed;
}