.bi {
    vertical-align: -.125em;
    fill: currentColor;
}

.btn-bd-primary {
    --bd-violet-bg: #712cf9;
    --bd-violet-rgb: 112.520718, 44.062154, 249.437846;
    --bs-btn-font-weight: 600;
    --bs-btn-color: var(--bs-white);
    --bs-btn-bg: var(--bd-violet-bg);
    --bs-btn-border-color: var(--bd-violet-bg);
    --bs-btn-hover-color: var(--bs-white);
    --bs-btn-hover-bg: #6528e0;
    --bs-btn-hover-border-color: #6528e0;
    --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
    --bs-btn-active-color: var(--bs-btn-hover-color);
    --bs-btn-active-bg: #5a23c8;
    --bs-btn-active-border-color: #5a23c8;
}

.bd-mode-toggle {
    z-index: 1500;
}

.bd-mode-toggle .dropdown-menu .active .bi {
    display: block !important;
}

.btn-check:focus + label.btn {
    border-color: var(--bs-btn-hover-border-color);
    outline: 0;
    box-shadow: var(--bs-btn-focus-box-shadow);
}

[data-bs-theme=light] .text-danger-emphasis {
    color: rgba(var(--bs-danger-rgb)) !important;
}

[data-bs-theme=light] .text-info-emphasis {
    color: rgba(var(--bs-primary-rgb)) !important;
}

.w-100px {
    min-width: 100px;
    max-width: 100%;
}

header {
    background-color: #009ca6;
}

.main-header h1,
.main-header p {
    text-align: center;
}

.section-title.accordion-header button {
    font-size: 1.4rem;
}

.accordion-button:focus {
    border-color: #6c757d;
    box-shadow: rgba(108, 117, 125, 0.5) 0px 0px 0px 4px;
}

[data-bs-theme=dark] .accordion-button::after {
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dee2e6'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dee2e6'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.section-title.accordion-header button.accordion-button:not(.collapsed) {
    color: inherit;
}

.section-validity {
    display: inline-block;
    margin-left: 15px;
    background-repeat: no-repeat;
    width: calc(.75em + .375rem);
    height: calc(.75em + .375rem);
    background-size: 20px;
    background-position: 0 center;
}

.section-validity.invalid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
}

.section-validity.valid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
}

.vetting-time-element {
    display: inline-block;
    padding: 5px 6px;
}

.vetting-time-element.no-text {
    padding: 0 3px;
}

.vetting-time-element.no-text .clock-icon {
    margin: 0;
    background-position: center;
}

.vetting-time-element .clock-icon {
    display: inline-block;
    margin-right: 5px;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    background-size: 16px;
    background-position: left center;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%230d6efd" class="bi bi-clock-fill" viewBox="0 0 16 16"><path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z"/></svg>');
    vertical-align: text-bottom;
}

.show-details {
    display: inline;
    margin-left: 10px;
}

.show-details .details-wrap {
    display: none;
}

.show-details .details-wrap .details {
    display: block;
    margin-top: 10px;
}

.show-details button[aria-pressed="true"] + .details-wrap {
    display: block;
}

.question-section::before,
#role-clearances.question-section::before {
    content: "";
    padding-top: 1rem;
    margin-bottom: 1rem;
    opacity: .25;
    border-bottom: 1px solid var(--bs-body-color);
    width: 100%;
    display: block;
}

.question-section:first-of-type::before,
.inner-questions .question-section::before {
    display: none;
}

.question-section-inner legend {
    font-size: 1.2rem;
}

.hide {
    display: none;
}

.hide-if-not-required {
    display: none;
}

.hide-if-not-required.show {
    display: block;
}

.invisible-if-not-required {
    visibility: hidden;
}

.invisible-if-not-required.show {
    visibility: visible;
}

.w-15-rem {
    width: 15rem;
    max-width: 100%;
}

#warwickshire-cost-table-wrap,
#new-clearance-valid-length-table {
    display: none;
}

.form-table thead th {
    background-color: inherit;
}

/* Ensure table body text has readable contrast in light mode */
[data-bs-theme=light] .form-table tbody td {
    color: var(--bs-body-color) !important;
}

#clearance-cost #warwickshire-cost-table-wrap,
#clearance-valid-period #new-clearance-valid-length-table {
    display: block;
}

#new-clearance-valid-length-table td:nth-child(2),
#new-clearance-valid-length-table th:nth-child(2) {
    white-space: nowrap!important;
}

/* .form-control.file-upload::file-selector-button {
    border: none;
    background-color: #198754;
    color: #fff;
}
  
.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
    background-color: #157347!important;
} */

textarea.form-control,
.form-floating>textarea.form-control {
    height: 100px;
}

legend .dynamic-list-wrap {
    display: block;
}

#header-images-b64 {
    display: none;
}

img#header-large {
    width: 960px;
    height: auto;
}

#form-pdf-content .note {
    margin-top: 10px;
    color: red;
}

/* (removed unused notification overlay styles) */

/* Accessibility and Theme Fixes */
[data-bs-theme="light"] .table {
    --bs-table-color: var(--bs-body-color);
    --bs-table-bg: var(--bs-body-bg);
}

[data-bs-theme="light"] .table thead th {
    background-color: #f8f9fa; /* A light grey for header background */
    color: #212529; /* Dark text for contrast */
    border-bottom-width: 2px;
}

.main-header {
    background-color: #00838F; /* A slightly darker teal for better contrast */
}

#header-image {
    filter: brightness(0) invert(1); /* Makes the SVG logo white */
}
