/* Shared Security Styles - Kill Switch and Form Meta Protection */
/* This file is included in both frontend and admin areas */

/* Kill Switch - Form Disabled Styles */
.form-disabled {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.form-disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
    pointer-events: none;
}

.form-disabled .form-control,
.form-disabled .form-select,
.form-disabled .form-check-input,
.form-disabled .btn {
    pointer-events: none;
    opacity: 0.6;
}

.form-disabled .form-control:focus,
.form-disabled .form-select:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* Kill Switch - Banner Styles */
.kill-switch-banner {
    position: relative;
    z-index: 1050;
    margin-bottom: 1rem;
}

.kill-switch-banner .alert {
    margin-bottom: 0;
    border-radius: 0;
    border-left: 4px solid #f39c12;
}

.kill-switch-banner .alert-warning {
    background-color: #fff3cd;
    border-color: #f39c12;
    color: #856404;
}

.kill-switch-banner .alert-danger {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Kill Switch - Card Overlay for Disabled Forms */
.form-disabled .card {
    position: relative;
}

.form-disabled .card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.8);
    z-index: 10;
    pointer-events: none;
}

/* Kill Switch - Extended Form Elements */
.form-disabled input[type="text"],
.form-disabled input[type="email"],
.form-disabled input[type="password"],
.form-disabled input[type="tel"],
.form-disabled input[type="url"],
.form-disabled textarea,
.form-disabled select {
    cursor: not-allowed;
    background-color: #f8f9fa;
    opacity: 0.6;
}

.form-disabled .btn {
    cursor: not-allowed;
    opacity: 0.6;
}

.form-disabled .btn:hover {
    opacity: 0.6;
    transform: none;
}

/* Kill Switch - reCAPTCHA Disabled */
.form-disabled .g-recaptcha {
    pointer-events: none;
    opacity: 0.6;
}

/* Kill Switch - Interactive Elements */
.form-disabled .form-check {
    pointer-events: none;
}

.form-disabled .form-check-input {
    cursor: not-allowed;
}

.form-disabled .form-check-label {
    cursor: not-allowed;
    color: #6c757d;
}

/* Kill Switch - File Upload Disabled */
.form-disabled input[type="file"] {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Kill Switch - County Selector Disabled */
.form-disabled .service-areas-grid {
    pointer-events: none;
    opacity: 0.6;
}

.form-disabled .service-areas-grid .form-select,
.form-disabled .service-areas-grid .form-control {
    cursor: not-allowed;
}

.form-disabled .service-areas-grid .county-item {
    pointer-events: none;
    opacity: 0.6;
}

.form-disabled .service-areas-grid .tag {
    pointer-events: none;
    opacity: 0.6;
}

/* Kill Switch - Modal Disabled State */
.form-disabled .modal-body {
    opacity: 0.6;
}

.form-disabled .modal-footer .btn {
    cursor: not-allowed;
    pointer-events: none;
}

/* Kill Switch - Transition Effects */
.form-disabled {
    transition: opacity 0.3s ease-in-out;
}

.form-disabled * {
    transition: opacity 0.3s ease-in-out;
}

/* Kill Switch - Accessibility */
.form-disabled [aria-describedby] {
    pointer-events: none;
}

.form-disabled .form-text {
    color: #6c757d;
    opacity: 0.8;
}

/* Kill Switch - Bootstrap Component Overrides */
.form-disabled .input-group {
    pointer-events: none;
}

.form-disabled .input-group-text {
    background-color: #f8f9fa;
    color: #6c757d;
}

.form-disabled .dropdown-toggle {
    pointer-events: none;
    cursor: not-allowed;
}

.form-disabled .dropdown-menu {
    display: none !important;
}

/* Kill Switch - Form Validation States (disabled) */
.form-disabled .is-valid,
.form-disabled .is-invalid {
    border-color: #ced4da;
}

.form-disabled .valid-feedback,
.form-disabled .invalid-feedback {
    display: none;
}

/* Kill Switch - Custom Form Controls */
.form-disabled .form-switch .form-check-input {
    cursor: not-allowed;
    opacity: 0.5;
}

.form-disabled .form-range {
    cursor: not-allowed;
    opacity: 0.5;
}

.form-disabled .form-floating {
    opacity: 0.6;
}

.form-disabled .form-floating > label {
    color: #6c757d;
}

/* Kill Switch - All remaining interactive elements */
.form-disabled {
    user-select: none;
}

.form-disabled * {
    user-select: none;
}

/* Kill Switch - Responsive Banner */
@media (max-width: 768px) {
    .kill-switch-banner {
        margin-left: -15px;
        margin-right: -15px;
    }
    
    .kill-switch-banner .alert {
        border-radius: 0;
        border-left: none;
        border-top: 4px solid #f39c12;
    }
}

/* Form Meta Fields - Anti-Spam Protection */
.form-meta {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.form-meta label {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.form-meta input {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
}

/* Ensure form meta fields are not visible even if CSS is disabled */
.form-meta input:focus {
    outline: none !important;
}

/* Form meta fields should not interfere with form layout */
.form-meta:before,
.form-meta:after {
    display: none !important;
}

/* Additional protection against CSS manipulation */
.form-meta * {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
} 