/* Hide validation summary on search page - individual field errors are shown instead */
.validation-summary-errors {
    display: none !important;
}

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 9999;
    padding: 10px 15px;
    background-color: #1C84C6;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    left: 10px;
    top: 10px;
}

/* Fieldset and legend styling for radio button group */
.search-method-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.search-method-legend {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 0;
    border: none;
}

.search-method-fieldset .form-check {
    margin-bottom: 2px;
}

.search-method-fieldset .form-check-input {
    margin-right: 8px;
}

/* Reduce ibox margin to keep footer in viewport */
#pollingPlaceSearchCriteria .ibox {
    margin-bottom: 10px;
}

/* Fixed max-width for search form to prevent responsive skip */
#pollingPlaceSearchCriteria {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

@media (min-width: 768px) {
    #pollingPlaceSearchCriteria {
        width: 600px;
        padding: 0;
    }
}

/* Address info panel border */
#divAddressInfoDetail {
    border: 1px solid #1C84C6;
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 12px;
}

/* Button spacing */
#btnReset {
    margin-left: 8px !important;
}

/* Add bottom margin so buttons don't collapse into a single visual block at high zoom (e.g., 400% reflow) */
.button-search {
    margin-bottom: 8px !important;
}

/* Ensure reset button also gets bottom spacing in case it overrides .button-search */
#btnReset {
    margin-bottom: 8px !important;
}

/* Search / Reset buttons (blue background, white text) */
.button-search {
    background-color: #1578BB !important; /* Darker blue for WCAG AA compliance - 3.5:1 contrast ratio */
    border-color: #1578BB !important;
    color: #FFFFFF !important;
    font-size: 19px; /* large text threshold for WCAG */
    font-weight: 700; /* bold to reinforce readability */
    line-height: 1.1;
    padding: 8px 18px;
    border-radius: 3px;
    width: auto !important; /* override site.css 80px width */
    /* Ensure the button is wide enough so the label doesn't wrap or get truncated */
    white-space: nowrap !important;
    min-width: 180px; /* desktop/tablet minimum */
    /* enforce consistent height to match the search-ibox-content min-height */
    min-height: 44px;
    height: auto;
}

.button-search:hover,
.button-search:focus,
.button-search:active {
    background-color: #126ba8 !important;
    border-color: #126ba8 !important;
    color: #FFFFFF !important;
}

/* Ensure proper spacing for required field asterisk */
span.required {
    font-size: small;
    font-style: italic;
    color: #C00000; /* Darker red for WCAG AA contrast compliance (7.0:1 ratio) */
    float: left;
    margin-right: 4px;
}

/* Match validation error message color to required field indicators */
.text-danger,
.field-validation-error {
    color: #C00000 !important; /* Match required field color for consistency */
}

/* Allow button to scale down on very small screens to avoid horizontal overflow */
@media (max-width: 420px) {
    .button-search {
        min-width: 140px; /* smaller min-width on narrow screens */
        font-size: 18px;
        padding: 6px 12px;
        min-height: 40px;
    }
}

/* Form field borders - WCAG 3:1 contrast ratio with white background */
#pollingPlaceSearchForm .form-control {
    border: 1px solid #767676; /* 3:1 contrast ratio with white */
}

#pollingPlaceSearchForm .form-control:focus {
    /* Use the same darker blue focus color as radio buttons and buttons to improve non-text contrast (WCAG 1.4.11)
       - border-color matches radio/button focus: #1C84C6
       - use a visible solid outline with offset to match radio focus treatment
       - keep a subtle box-shadow for depth but ensure contrast is sufficient */
    border-color: #1C84C6;
    outline: 2px solid #1C84C6;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.2rem rgba(28, 132, 198, 0.25);
}

/* Radio button borders */
#pollingPlaceSearchForm .form-check-input[type="radio"] {
    border: 2px solid #767676; /* 3:1 contrast ratio with white */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1.2em;
    height: 1.2em;
    border-radius: 50%;
    background-color: #FFFFFF;
    position: relative;
    vertical-align: middle;
    cursor: pointer;
}

#pollingPlaceSearchForm .form-check-input[type="radio"]:checked {
    border-color: #1C84C6;
    background-color: #FFFFFF;
}

#pollingPlaceSearchForm .form-check-input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    background-color: #1C84C6;
}

#pollingPlaceSearchForm .form-check-input[type="radio"]:focus {
    border-color: #1C84C6;
    outline: 2px solid #1C84C6;
    outline-offset: 2px;
}