/* Enhanced File Upload Styles */
.file-upload-container {
    margin-top: 10px;
}

.hidden-file-input {
    display: none !important;
}

/* Utility: force-hide dependent form groups within the wizard */
#wizard.form-inline .form-group.ir-hidden,
#wizard .form-group.ir-hidden {
    display: none !important;
}

input[type="file"]#attachments {
    display: none !important;
}

.upload-area {
    border: 2px dashed #3DB3FF;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    background: #f8f9fa;
    border-color: #1592E3;
}

.upload-area.drag-over {
    background: #e3f2fd;
    border-color: #1592E3;
    color: #0066cc;
}

.upload-area.drag-over .upload-icon svg {
    stroke: #0066cc;
}

.upload-icon {
    margin-bottom: 20px;
}

.upload-icon svg {
    stroke: #3DB3FF;
    transition: stroke 0.3s ease;
}

.upload-area h4 {
    color: #333;
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-area.drag-over h4 {
    color: #0066cc;
}

.upload-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.upload-btn,
.camera-btn {
    background: #3DB3FF;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid #1592E3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
    vertical-align: middle;
}

.camera-btn {
    background: #ffffff;
    color: #3DB3FF;
    border: 2px solid #3DB3FF;
    padding: 12px 30px;
}

.upload-btn:hover {
    background: #70c7ff;
    transform: none;
    box-shadow: none;
}

.camera-btn:hover {
    background: #f0f8ff;
    color: #1592E3;
    border: 2px solid #1592E3;
    transform: none;
    box-shadow: none;
}

.camera-btn svg {
    flex-shrink: 0;
    stroke: #3DB3FF;
}

.camera-btn:hover svg {
    stroke: #1592E3;
}

/* Hide camera button on desktop by default */
.camera-btn {
    display: none;
}

.upload-info {
    color: #6c757d;
    font-size: 14px;
    margin: 5px 0;
}

.upload-area.drag-over .upload-info {
    color: #666;
}

.image-preview-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.image-preview-container h5 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.image-preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-preview-info {
    padding: 10px;
    background: #fff;
}

.image-name {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.image-size {
    font-size: 11px;
    color: #6c757d;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.remove-image svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
    fill: none;
}

.image-preview-item:hover .remove-image {
    opacity: 1;
}

.remove-image:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.file-validation-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
}

.file-validation-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.file-validation-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.file-validation-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.upload-progress {
    margin-top: 10px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* reCAPTCHA Styling */
.g-recaptcha {
    margin-top: 10px;
}

/* Remove border styling for reCAPTCHA error - just show message */
.g-recaptcha.error {
    /* No border styling */
}

.g-recaptcha + label.error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

/* Spacing and styling for form sections */
/* Fix declaration checkbox and label alignment using flexbox */

/* Target the form group containing the declaration checkbox */
/* Use more specific targeting to avoid affecting other form groups */
.form-group:has(input[type="checkbox"]#declaration) {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 40px !important;
}

/* Fallback for browsers without :has() support - target by content */
.form-group input[type="checkbox"]#declaration {
    margin-top: 40px !important;
}

.form-group input[type="checkbox"]#declaration + label.css-label {
    margin-top: 0 !important;
}

/* Ensure declaration checkbox has no individual margins */
input[type="checkbox"]#declaration {
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* Style the declaration label */
input[type="checkbox"]#declaration + label.css-label {
    font-weight: bold !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    flex: 1 !important;
}

/* Remove problematic nth-last-child selectors - they affect unintended elements */

/* AddressFinder Dropdown Styling - Comprehensive Coverage */
.af-widget {
    position: relative !important;
}

/* Target all possible AddressFinder dropdown classes */
.af-list,
.addressfinder-list,
.af_list,
div[class*="af-list"],
div[class*="addressfinder"] {
    background: #ffffff !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
}

/* Target all possible AddressFinder item classes */
.af-list .af-item,
.af-list li,
.addressfinder-list .af-item,
.addressfinder-list li,
.af_list .af_item,
.af_list li,
div[class*="af-list"] div,
div[class*="af-list"] li,
div[class*="addressfinder"] div,
div[class*="addressfinder"] li {
    background: #ffffff !important;
    color: #333333 !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

/* Hover states */
.af-list .af-item:hover,
.af-list .af-item.af-hover,
.af-list li:hover,
.addressfinder-list .af-item:hover,
.addressfinder-list li:hover,
.af_list .af_item:hover,
.af_list li:hover,
div[class*="af-list"] div:hover,
div[class*="af-list"] li:hover,
div[class*="addressfinder"] div:hover,
div[class*="addressfinder"] li:hover {
    background: #f8f9fa !important;
    color: #000000 !important;
}

/* Last child items */
.af-list .af-item:last-child,
.af-list li:last-child,
.addressfinder-list .af-item:last-child,
.addressfinder-list li:last-child {
    border-bottom: none !important;
}

/* Text elements within items */
.af-list .af-item .af-main,
.af-list .af-item span,
.af-list .af-item div,
.af-list li span,
.af-list li div,
div[class*="af-list"] span,
div[class*="af-list"] div div,
div[class*="addressfinder"] span,
div[class*="addressfinder"] div div {
    color: #333333 !important;
    font-weight: 500 !important;
}

.af-list .af-item .af-secondary,
.af-list .af-item small,
div[class*="af-list"] small,
div[class*="addressfinder"] small {
    color: #666666 !important;
    font-size: 0.9em !important;
}

/* Removed universal fallback - it was too broad and broke Google Maps */

/* Removed overly broad address input rules - they were still affecting the map */

/* Removed nuclear option rules - they were too broad and broke Google Maps */

/* Let Google Maps handle its own styling naturally */

/* Target any elements that might be using inline styles for white text */
/* Exclude Google Maps elements */
*[style*="color: white"]:not([class*="gm-"]):not([id*="gm-"]),
*[style*="color: #fff"]:not([class*="gm-"]):not([id*="gm-"]),
*[style*="color: #ffffff"]:not([class*="gm-"]):not([id*="gm-"]),
*[style*="color:white"]:not([class*="gm-"]):not([id*="gm-"]),
*[style*="color:#fff"]:not([class*="gm-"]):not([id*="gm-"]),
*[style*="color:#ffffff"]:not([class*="gm-"]):not([id*="gm-"]) {
    color: #333333 !important;
}

/* Standardize Form Spacing - Logical Grouping Principles */
/* Default tight spacing between form groups */
.form-group {
    margin-bottom: 15px !important;
}

/* Consistent spacing between form labels and inputs */
.form-group label.control-label {
    margin-bottom: 6px !important;
    display: block !important;
}

/* Consistent spacing for form inputs */
.form-group input.form-control,
.form-group textarea.form-control,
.form-group select.form-control {
    margin-bottom: 0 !important;
}

/* Ensure all textareas have proper height */
.form-group textarea.form-control {
    min-height: 80px !important;
    height: auto !important;
    resize: vertical !important;
}

/* Consistent spacing for radio and checkbox groups */
.radio-group,
.checkbox-group {
    margin-top: 6px !important;
    margin-bottom: 0 !important;
}

.radio-group > div,
.checkbox-group > div {
    margin-bottom: 6px !important;
}

.radio-group > div:last-child,
.checkbox-group > div:last-child {
    margin-bottom: 0 !important;
}

/* Consistent spacing for help text */
.help-block {
    margin-top: 4px !important;
    margin-bottom: 0 !important;
}

/* Section headers spacing */
h3 {
    margin-bottom: 25px !important;
    margin-top: 0 !important;
}

/* Special spacing for specific sections */
/* Upload section spacing */
.file-upload-container {
    margin-top: 15px !important;
    margin-bottom: 25px !important;
}

/* Map container spacing */
#offender_location_map {
    margin-top: 10px !important;
    margin-bottom: 25px !important;
}

/* Additional parties section spacing */
#add_party_form {
    margin-bottom: 20px !important;
}

#added_parties_list {
    margin-top: 20px !important;
}

/* Professional styling for added parties */
.added-party {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.added-party:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #3DB3FF;
}

.added-party:last-child {
    margin-bottom: 0;
}

.party-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    position: relative;
}

.party-info {
    flex: 1;
    margin-right: 20px;
}

.party-name {
    font-weight: 600 !important;
    font-size: 16px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

.party-address {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.remove-party-btn {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 16px !important; /* Allow font-based icons to show */
    line-height: 1 !important;
    text-indent: 0 !important; /* Reset text-indent for unicode chars */
    overflow: visible !important;
    text-decoration: none !important;
}

.remove-party-btn svg {
    width: 16px !important;
    height: 16px !important;
    stroke: #ffffff !important;
    fill: none !important;
    display: block !important;
    text-indent: 0 !important;
    position: relative !important;
    z-index: 10 !important;
    pointer-events: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin: 0 !important;
    padding: 0 !important;
}

.remove-party-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.remove-party-btn:active {
    transform: scale(0.95);
}

/* Empty state styling */
#added_parties_list:empty::before {
    content: "";
    display: none;
}

/* Responsive adjustments for mobile */
@media (max-width: 640px) {
    .party-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }
    
    .party-info {
        margin-right: 0;
        margin-bottom: 12px;
        width: 100%;
    }
    
    .remove-party-btn {
        align-self: flex-end;
        margin-top: 8px;
    }
}

/* Logical Grouping - Tight spacing within groups, larger between groups */

/* STEP 1: Reporter Details - Tight grouping */
#is_anonymous { margin-bottom: 20px !important; } /* Anonymous checkbox gets space */
#reporter_name,
#reporter_organisation,
#reporter_address,
#reporter_email,
#reporter_phone { margin-bottom: 10px !important; } /* Reporter info grouped tightly */
#relationship_to_report { margin-bottom: 25px !important; } /* Relationship section ends */

/* Style ALL checkboxes and radio buttons to match site design */

/* Hide all native checkboxes and radio buttons but keep them functional */
.form-group input[type="checkbox"],
.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    position: absolute !important;
    opacity: 0.01 !important;
    z-index: -1 !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Base styling for all custom checkbox labels */
.form-group input[type="checkbox"] + label.css-label,
.checkbox-group input[type="checkbox"] + label.css-label {
    padding-left: 25px !important;
    height: 16px !important;
    display: inline-block !important;
    line-height: 1em !important;
    background-repeat: no-repeat !important;
    background-position: 0 0 !important;
    font-size: 16px !important;
    font-weight: normal !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    margin: 0 !important;
    white-space: normal !important;
    width: auto !important;
    color: inherit !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' fill='white' stroke='%23ccc' stroke-width='1'/%3E%3C/svg%3E") !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Checked state for all checkboxes */
.form-group input[type="checkbox"]:checked + label.css-label,
.checkbox-group input[type="checkbox"]:checked + label.css-label {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' fill='white' stroke='%233DB3FF' stroke-width='2'/%3E%3Cpath d='M3 8l3 3 7-7' stroke='%233DB3FF' stroke-width='2' fill='none'/%3E%3C/svg%3E") !important;
}

/* Base styling for all custom radio button labels */
.radio-group input[type="radio"] + label {
    padding-left: 25px !important;
    height: 16px !important;
    display: inline-block !important;
    line-height: 1.25em !important;
    background-repeat: no-repeat !important;
    background-position: 0 0 !important;
    font-size: 14px !important;
    font-weight: normal !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    margin: 0 !important;
    white-space: normal !important;
    width: auto !important;
    color: inherit !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='white' stroke='%23ccc' stroke-width='1'/%3E%3C/svg%3E") !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Checked state for all radio buttons */
.radio-group input[type="radio"]:checked + label {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='white' stroke='%233DB3FF' stroke-width='2'/%3E%3Ccircle cx='8' cy='8' r='3' fill='%233DB3FF'/%3E%3C/svg%3E") !important;
}

/* Ensure the form group containing the anonymous checkbox has proper layout */
.form-group:has(input[type="checkbox"]#is_anonymous) {
    display: block !important;
}

/* Override any form-inline interference for this specific checkbox */
#wizard.form-inline input[type="checkbox"]#is_anonymous {
    display: inline-block !important;
    width: auto !important;
}

#wizard.form-inline input[type="checkbox"]#is_anonymous + label.css-label {
    display: inline-block !important;
    width: auto !important;
}

/* Override form-inline behavior for proper layout */
#wizard.form-inline .form-group {
    display: block !important;
    width: 100% !important;
    vertical-align: top !important;
    margin-bottom: 15px !important;
}

/* Ensure checkbox and radio groups display properly within form-inline */
#wizard.form-inline .checkbox-group,
#wizard.form-inline .radio-group {
    display: block !important;
    width: 100% !important;
}

#wizard.form-inline .checkbox-group > div,
#wizard.form-inline .radio-group > div {
    display: block !important;
    width: 100% !important;
    margin-bottom: 6px !important;
}

/* Override base forms.css rules that interfere with custom styling */
#wizard input[type=checkbox].form-control,
#wizard input[type=radio].form-control {
    float: none !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    width: auto !important;
    height: auto !important;
}

/* Exception for reporter fields - allow JavaScript toggle to work */
#wizard.form-inline .form-group.reporter-field[style*="display: none"] {
    display: none !important;
}

/* Exception for anonymous warning message - allow JavaScript toggle to work */
#wizard.form-inline .form-group#anonymous_warning_message[style*="display: none"] {
    display: none !important;
}

/* Default error message styling for all form fields */
label.error {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    float: none !important;
    margin-top: 5px !important;
    margin-left: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    color: #dc3545 !important;
    font-size: 14px !important;
    font-weight: normal !important;
    position: static !important;
    line-height: 1.4em !important;
}

/* Create a wrapper for Declaration checkbox to control positioning */
.declaration-wrapper {
    position: static !important;
    padding-bottom: 0 !important;
}

.declaration-wrapper label.error {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin-top: 8px !important;
}

/* Ensure the Declaration checkbox form group has proper styling */
#declaration {
    display: inline-block !important;
    margin: 0 !important;
    width: 16px !important;
    height: 16px !important;
}

#declaration + label.css-label {
    display: inline-block !important;
    margin: 0 !important;
    padding-left: 25px !important;
    width: auto !important;
}

/* Prevent radio button labels from turning red due to error styling */
.radio-group input[type="radio"] + label {
    color: inherit !important;
}

/* Ensure radio buttons maintain proper styling even when form has errors */
.radio-group input[type="radio"] + label:not(.error) {
    color: #333 !important;
}

/* Error styling for select elements using bootstrap-select */
.bootstrap-select.has-error .btn,
.bootstrap-select .btn.error {
    background: #FBE3E4 !important;
    border: 1px solid #FBC2C4 !important;
    color: #dc3545 !important; /* Match error message color */
}

.bootstrap-select.has-error .btn:focus,
.bootstrap-select .btn.error:focus {
    border-color: #843534 !important;
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.075) inset, 0px 0px 6px #CE8483 !important;
}

/* Ensure hidden form groups stay hidden with higher specificity */
#wizard.form-inline .form-group#relationship_other_group {
    display: none !important;
}

#wizard.form-inline .form-group#breach_other_group {
    display: none !important;
}

#wizard.form-inline .form-group#contact_method_group {
    display: none !important;
}

#wizard.form-inline .form-group#industry_other_group {
    display: none !important;
}

/* Show them only when explicitly set to block */
#wizard.form-inline .form-group#relationship_other_group[style*="display: block"],
#wizard.form-inline .form-group#relationship_other_group[style*="display: flex"] {
    display: block !important;
}

#wizard.form-inline .form-group#breach_other_group[style*="display: block"],
#wizard.form-inline .form-group#breach_other_group[style*="display: flex"] {
    display: block !important;
}

#wizard.form-inline .form-group#contact_method_group[style*="display: block"],
#wizard.form-inline .form-group#contact_method_group[style*="display: flex"] {
    display: block !important;
}

#wizard.form-inline .form-group#industry_other_group[style*="display: block"],
#wizard.form-inline .form-group#industry_other_group[style*="display: flex"] {
    display: block !important;
}

#wizard.form-inline .form-control {
    display: block !important;
    width: 100% !important;
    vertical-align: top !important;
}

/* ========== RESPONSIVE FILE UPLOAD BEHAVIOR ========== */
.upload-area p {
    padding-bottom: 0 !important;
}
/* Desktop View (768px and above) */
@media (min-width: 768px) {
    /* Hide Take Photo button on desktop */
    .camera-btn {
        display: none !important;
    }
    
    /* Show drag & drop area on desktop */
    .upload-area {
        display: block !important;
    }
    
    /* Show "or" text on desktop */
    .upload-area p {
        display: block !important;
    }
}

/* Mobile View (767px and below) */
@media (max-width: 767px) {
    /* Hide drag & drop elements on mobile */
    .upload-area h4,
    .upload-area p:not(.upload-info),
    .upload-icon {
        display: none !important;
    }
    
    /* Simplify upload area for mobile - minimal spacing */
    .upload-area {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        cursor: default !important;
        text-align: center !important;
    }
    
    /* Center the upload buttons container */
    .upload-buttons {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Hide browse button, show camera button on mobile */
    .upload-btn {
        display: none !important;
    }
    
    .camera-btn {
        display: inline-flex !important;
        margin: 0 !important;
    }
    
    /* Tighten spacing for upload info text */
    .upload-area .upload-info {
        margin: 10px 0 5px 0 !important;
        padding: 0 !important;
        font-size: 13px !important;
        color: #666 !important;
        text-align: center !important;
    }
    
    .upload-area .upload-info:first-of-type {
        margin-top: 15px !important;
    }
    
    /* Keep button centered on very small screens */
    @media (max-width: 480px) {
        .upload-buttons {
            justify-content: center !important;
            align-items: center !important;
        }
        
        .camera-btn {
            width: auto !important;
            min-width: 200px !important;
            justify-content: center !important;
        }
    }
}

/* Exception for selectpicker elements - let bootstrap-select handle display */
#wizard.form-inline .form-control.selectpicker {
    display: none !important;
}

#wizard.form-inline .control-label {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding: 0 !important;
    margin-bottom: 6px !important;
}


/* Ensure reporter fields can be toggled properly */
.reporter-field {
    transition: opacity 0.3s ease !important;
}

.reporter-field[style*="display: none"] {
    display: none !important;
}


/* Override any spacing rules that might interfere with hidden fields */
.reporter-field:not([style*="display: none"]) #reporter_organisation {
    margin-bottom: 10px !important;
}

/* STEP 2: Breach Details - Logical groups */
.checkbox-group { margin-bottom: 20px !important; } /* Breach types group */
#breach_other_group { margin-bottom: 20px !important; } /* Other breach group */
.radio-group { margin-bottom: 15px !important; } /* Radio groups */
#industry { margin-bottom: 10px !important; } /* Industry field */

/* STEP 3: Offender Details - Logical address grouping */
/* Company info group */
#offender_business,
#offender_legal_name,
#offender_acn,
#offender_abn,
#offender_individual { margin-bottom: 10px !important; }

/* Address group - very tight spacing */
#offender_address_street1 { margin-bottom: 8px !important; }
#offender_address_street2 { margin-bottom: 8px !important; }
#offender_address_suburb { margin-bottom: 8px !important; }
#offender_address_state { margin-bottom: 8px !important; }
#offender_address_postcode { margin-bottom: 15px !important; } /* End of address group */

/* Map gets its own space */
#offender_location_map { margin-bottom: 20px !important; }

/* Contact info group */
#offender_phone,
#offender_email { margin-bottom: 10px !important; }

/* STEP 4: Additional Parties - Grouped tightly */
#add_party_form .form-group { margin-bottom: 8px !important; }
#add_party_btn { margin-top: 15px !important; margin-bottom: 20px !important; }

/* STEP 5: Incident Details - Each field gets space */
#incident_datetime { margin-bottom: 15px !important; }
#incident_location { margin-bottom: 15px !important; }
#incident_description { 
    margin-bottom: 15px !important; 
    min-height: 120px !important;
    height: auto !important;
    resize: vertical !important;
}

/* STEP 6: Attachments & Consent - Logical sections */
.file-upload-container { margin-bottom: 25px !important; } /* Upload section */
input[name="ContactPermission"] { margin-bottom: 20px !important; } /* Contact question */
#contact_method_group { margin-bottom: 25px !important; } /* Contact method group */

/* Remove grey bar and borders from wizard steps */
.wizard > .steps,
.wizard > .steps ul,
.wizard > .steps li,
.wizard .steps::after,
.wizard .steps::before {
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    background: transparent !important;
}

/* Remove any hr or separator elements */
.wizard > .steps hr,
.wizard hr {
    display: none !important;
}

/* Ensure no bottom borders on step containers */
.wizard > .steps {
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Remove borders from step navigation area specifically */
#wizard > .steps,
#wizard .steps,
.wizard-steps {
    border: none !important;
    border-bottom: none !important;
    background: none !important;
    box-shadow: none !important;
}

/* Target any possible grey divider elements */
.wizard .ui-widget-header,
.wizard .ui-corner-all,
.steps .ui-widget-header {
    border: none !important;
    background: none !important;
    display: none !important;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    /* Force horizontal layout on mobile with proper centering */
    .wizard.vertical {
        display: block !important;
        margin: 0 auto 30px auto !important;
        padding: 0 15px 30px 15px !important;
        box-sizing: border-box !important;
    }
    
    .wizard.vertical > .steps {
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin-bottom: 20px !important;
    }
    
    .wizard.vertical > .steps > ul {
        display: block !important;
        text-align: center !important;
    }
    
    /* Hide all steps on mobile except the current one */
    .wizard.vertical > .steps > ul > li {
        display: none !important;
    }
    
    /* Show only the current (active) step on mobile */
    .wizard.vertical > .steps > ul > li.current {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        text-align: center !important;
    }
    
    /* Style the current step text for mobile */
    .wizard.vertical > .steps > ul > li.current a {
        display: inline-block !important;
        background: #3DB3FF !important;
        color: white !important;
        padding: 12px 20px !important;
        border-radius: 6px !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        font-size: 16px !important;
        box-shadow: 0 2px 4px rgba(61, 179, 255, 0.3) !important;
        position: relative !important;
    }
    
    /* Add step progress indicator for mobile above the title */
    .wizard.vertical > .steps > ul > li.current a::before {
        content: attr(data-step-counter) !important;
        font-weight: normal !important;
        font-size: 14px !important;
        display: block !important;
        margin-bottom: 4px !important;
        opacity: 0.9 !important;
    }
    
    .wizard.vertical > .content {
        display: block !important;
        float: none !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .wizard.vertical > .content > .body {
        margin: 0 auto !important;
        padding: 20px 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure form groups are properly centered */
    .wizard .form-group {
        margin: 0 auto 15px auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Tighten label spacing for file upload section */
    .wizard .form-group label[for="attachments"] {
        margin-bottom: 10px !important;
    }
    
    /* Center form content within the wizard */
    .input_form {
        margin: 0 auto 50px auto !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .wizard.vertical > .actions {
        display: block !important;
        float: none !important;
        width: 100% !important;
        margin: 20px 0 40px 0 !important;
        padding: 0 0 20px 0 !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    
    .wizard.vertical > .actions > ul > li {
        display: inline-block !important;
        float: none !important;
        margin: 0 5px !important;
    }
    
    /* Adjust step numbers and titles for mobile (non-current steps) */
    .wizard > .steps li:not(.current) a {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }
    
    .wizard > .steps li:not(.current) .number {
        font-size: 16px !important;
    }
    
    /* Make form controls full width on mobile */
    .form-control, .selectpicker, .bootstrap-select {
        width: 100% !important;
    }
    
    /* Adjust upload area for mobile */
    .upload-area {
        padding: 20px !important;
    }
    
    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }
    
    /* Show camera button on mobile */
    .camera-btn {
        display: inline-flex !important;
    }
    
    /* Stack upload buttons vertically on small screens */
    .upload-buttons {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .upload-btn,
    .camera-btn {
        width: 220px !important;
        justify-content: center !important;
        font-size: 15px !important;
        padding: 14px 20px !important;
    }
    
    /* Camera button maintains inverse style on mobile */
    .camera-btn {
        background: #ffffff !important;
        color: #3DB3FF !important;
        border: 2px solid #3DB3FF !important;
    }
    
    .camera-btn:hover {
        background: #f0f8ff !important;
        color: #1592E3 !important;
        border: 2px solid #1592E3 !important;
    }
    
    /* Adjust map height for mobile */
    #offender_location_map {
        height: 300px !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .wizard > .steps > ul > li {
        width: 100% !important;
        margin: 2px 0 !important;
    }
    
    .wizard > .steps a {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    
    .upload-area h4 {
        font-size: 16px !important;
    }
    
    .upload-btn {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}

/* ========== PROFESSIONAL CONFIRMATION DIALOG ========== */

/* Overlay backdrop */
.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1); /* Start very light */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    /* Separate transitions - faster backdrop-filter, slower opacity */
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                backdrop-filter 0.1s ease-out,
                -webkit-backdrop-filter 0.1s ease-out,
                background 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.confirmation-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.7); /* Darker when active */
}

/* Main dialog container */
.confirmation-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.confirmation-dialog.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Professional header with training image background */
.confirmation-icon {
    width: 100%;
    height: 100px;
    background-image: url('/images/training_342x100.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

/* Subtle overlay for better text readability */
.confirmation-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Remove old icon elements */
.success-checkmark,
.error-x,
.corporate-logo {
    display: none;
}

/* Dialog content */
.confirmation-content {
    padding: 30px;
    text-align: center;
}

.confirmation-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.confirmation-message {
    font-size: 16px;
    color: #5a6c7d;
    line-height: 1.6;
    margin: 0 0 25px 0;
}

.confirmation-reference {
    background: #f0f8ff;
    border: 1px solid #d4e9ff;
    border-radius: 8px;
    padding: 15px;
    margin: 0 0 25px 0;
}

.reference-label {
    font-size: 14px;
    color: #5a6c7d;
    margin: 0 0 5px 0;
}

.reference-number {
    font-size: 20px;
    font-weight: 600;
    color: #3DB3FF;
    margin: 0;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

/* Dialog actions */
.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-dialog {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-dialog::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-dialog:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary-dialog {
    background: linear-gradient(135deg, #3DB3FF 0%, #1592E3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(61, 179, 255, 0.3);
}

.btn-primary-dialog:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 179, 255, 0.4);
}

.btn-secondary-dialog {
    background: #ffffff;
    color: #3DB3FF;
    border: 2px solid #3DB3FF;
}

.btn-secondary-dialog:hover {
    background: #f0f8ff;
    transform: translateY(-2px);
}

/* Error state styles */
/* Remove red tint - error icon will be added via JavaScript instead */

/* Style for error icon in title */
.confirmation-dialog .error-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    flex-shrink: 0;
}

.confirmation-dialog.error .reference-number {
    color: #ff4757;
}

.confirmation-dialog.error .btn-primary-dialog {
    background: linear-gradient(135deg, #ff4757 0%, #c44569 100%);
}

/* Header fade-in animation */
@keyframes headerFadeIn {
    0% { 
        opacity: 0; 
        transform: translateY(-10px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.confirmation-dialog.active .confirmation-icon {
    animation: headerFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .confirmation-dialog {
        width: 95%;
        max-width: 400px;
    }
    
    .confirmation-icon {
        height: 80px;
    }
    
    .confirmation-title {
        font-size: 20px;
    }
    
    .confirmation-message {
        font-size: 15px;
    }
    
    .btn-dialog {
        padding: 10px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .confirmation-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-dialog {
        width: 100%;
    }
}

/* Force hide contact permission group when anonymous */
#contact_permission_group.anonymous-hide {
    display: none !important;
}

#contact_method_group.anonymous-hide {
    display: none !important;
}

/* ========== DATETIME PICKER STYLING ========== */
/* Improve the appearance of the native datetime picker */

/* Native datetime-local input - browser controls the calendar popup styling */
/* This is the most reliable approach across different browsers and contexts */


/* ========== PROFESSIONAL WIZARD BUTTONS ========== */
/* Apply site-consistent styling to all wizard buttons */

/* Wizard button styling - matches site-wide blue_solid_button pattern */
.blue_solid_button,
.upload-btn,
.camera-btn {
    color: #fff !important;
    background-color: #3db3ff !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    text-align: center !important;
    font-weight: 500 !important;
    font-size: 16px !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: #1592e3 3px solid !important;
    border-radius: 3px;
    padding: 10px 25px 8px 25px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: auto !important;
    transition: background-color .2s ease-in-out !important;
}

.blue_solid_button:hover,
.upload-btn:hover {
    text-decoration: none !important;
    background-color: #70c7ff !important;
}

/* Secondary button styling (camera-btn) */
.camera-btn {
    background: #ffffff !important;
    color: #3DB3FF !important;
    border: 2px solid #3DB3FF !important;
}

.camera-btn:hover {
    background: #f0f8ff !important;
    color: #1592E3 !important;
    border: 2px solid #1592E3 !important;
    border-bottom: #1592e3 3px solid !important;
}

/* SVG icon styling in camera button */
.camera-btn svg {
    flex-shrink: 0;
    stroke: #3DB3FF !important;
    transition: stroke 0.3s ease !important;
}

.camera-btn:hover svg {
    stroke: #1592E3 !important;
}

/* Desktop: Hide camera button by default */
@media (min-width: 769px) {
    .camera-btn {
        display: none !important;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .blue_solid_button,
    .upload-btn,
    .camera-btn {
        padding: 12px 20px 10px 20px !important;
        font-size: 14px !important;
        width: auto !important;
        min-width: 140px !important;
        justify-content: center !important;
    }
    
    /* Show camera button on mobile, hide browse button */
    .camera-btn {
        display: inline-flex !important;
    }
    
    .upload-btn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .blue_solid_button,
    .upload-btn,
    .camera-btn {
        width: 170px !important;
        padding: 12px 20px 10px 20px !important;
        font-size: 14px !important;
    }
}

/* ========== POSTCODE VALIDATION ERROR STATES ========== */
/* Persistent error state styling for invalid postcode fields */

/* Error state for postcode input fields */
input.error,
input[type="text"].error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
    color: #721c24 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Focus states for error inputs */
input.error:focus,
input[type="text"].error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.4) !important;
    outline: none !important;
}

/* Tooltip styling for postcode validation messages */
input[title].error {
    position: relative;
}

/* Ensure error states override any other input styling */
input.form-control.error,
.form-group input.form-control.error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* ========== PARTY MODAL SPECIFIC STYLES ========== */

/* Party Modal Specific Styles */
.party-modal {
    max-width: 600px;
    max-height: 95vh;
}

.party-modal .confirmation-icon {
    width: 100%;
    height: 100px;
    background-image: url('/images/training_342x100.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    margin: 0;
    padding: 0;
}

.party-modal .confirmation-content {
    padding: 0;
}

.party-modal .confirmation-title {
    color: #3DB3FF;
    font-size: 22px;
    font-weight: 700;
    margin: 25px 0 20px 0;
    text-align: center;
}

.party-modal .confirmation-actions {
    padding: 20px 30px 30px 30px;
}

.party-modal .confirmation-icon {
    animation: none !important;
}

.party-form-content {
    padding: 20px 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.party-form-content .form-group {
    margin-bottom: 20px;
}

.party-form-content .control-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

/* Use default Bootstrap form-control styling - no custom overrides */

.party-form-content label.error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

/* Ensure text is visible in modal form controls */
.party-modal input.form-control,
.party-modal select.form-control,
.party-modal textarea.form-control {
    color: #333 !important;
}

.party-modal input.form-control::placeholder,
.party-modal textarea.form-control::placeholder {
    color: #999 !important;
}

/* Add chevron for regular selects (fallback if selectpicker fails) */
.party-modal select.form-control:not(.selectpicker) {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23333" d="M2 5L0 3h4z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 10px !important;
    padding-right: 30px !important;
}

/* Party modal responsive styles */
@media (max-width: 768px) {
    .party-modal {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .party-form-content {
        padding: 15px 20px;
        max-height: 50vh;
    }
}

/* Ensure bootstrap-select dropdowns appear above custom modal/overlay */
.bootstrap-select .dropdown-menu {
    z-index: 10001 !important;
}

/* In party modal specifically, ensure dropdown is above dialog and not clipped */
.party-modal .bootstrap-select .dropdown-menu {
    z-index: 10002 !important;
}
