/* =============================================================================
   style.css — Public Request Form
   WCAG 2.1 AA compliant
   ============================================================================= */

/* ---- Bootstrap primary colour override ---------------------------------- */
:root {
    --bs-primary: #00549a;
    --bs-primary-rgb: 0, 84, 154;
    --bs-btn-bg: #00549a;
    --bs-btn-border-color: #00549a;
    --bs-btn-hover-bg: #004480;
    --bs-btn-hover-border-color: #004480;
    --bs-link-color: #00549a;
    --bs-link-hover-color: #004480;
}

/* ---- Skip Navigation ---------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -200%;
    left: 0;
    padding: 0.5rem 1.25rem;
    background-color: #003087;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 4px 0;
    transition: top 0.15s ease;
}
.skip-link:focus {
    top: 0;
}

/* ---- Site Header --------------------------------------------------------- */
.site-header {
    padding: 1rem 0;
}
.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* ---- Focus — Enhanced for keyboard / ADA --------------------------------- */
/* Replaces browser default which can be low-contrast */
:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 3px;
    border-radius: 2px;
}
/* Suppress outline for mouse-only interactions */
:focus:not(:focus-visible) {
    outline: none;
}

/* ---- Fieldset Sub-headers ----------------------------------------------- */
fieldset legend.section-header {
    width: 100%;
    padding: 0.4rem 0.75rem;
    margin-bottom: 1rem;
    background-color: #00549a;
    color: #fff;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    /* text-transform: uppercase; */
    letter-spacing: 0.06em;
}

/* ---- Required Field Indicator ------------------------------------------- */
.required-star {
    color: #b91c1c;    /* contrast ratio > 4.5:1 on white */
    font-weight: 700;
    margin-left: 0.15rem;
}

/* ---- Form Section Heading ------------------------------------------------ */
.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

/* ---- Card ---------------------------------------------------------------- */
.card {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

/* ---- Form Controls ------------------------------------------------------- */
.form-control {
    border-color: #9ca3af;
}
.form-control:focus {
    border-color: #003087;
    box-shadow: 0 0 0 0.2rem rgba(0, 48, 135, 0.25);
}
.form-control.is-invalid {
    border-color: #b91c1c;
    border-width: 2px;
}
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(185, 28, 28, 0.25);
}

/* ---- Error Messages ------------------------------------------------------ */
.invalid-feedback {
    display: none;
    font-size: 0.875rem;
    color: #7f1d1d;     /* dark red — contrast > 4.5:1 on white */
    font-weight: 500;
    margin-top: 0.3rem;
}
/* Show when sibling input is invalid */
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn-primary {
    background-color: #003087;
    border-color: #003087;
}
.btn-primary:hover {
    background-color: #002266;
    border-color: #002266;
}
.btn-primary:focus-visible {
    background-color: #002266;
    border-color: #002266;
    box-shadow: 0 0 0 0.2rem rgba(0, 48, 135, 0.5);
}
.btn-primary:disabled {
    background-color: #6b7280;
    border-color: #6b7280;
}

/* ---- Alerts -------------------------------------------------------------- */
.alert-success {
    background-color: #f0fdf4;
    border-color: #86efac;
    color: #14532d;     /* contrast > 4.5:1 */
}
.alert-success .alert-heading {
    color: #14532d;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #7f1d1d;     /* contrast > 4.5:1 */
}
.alert-danger .alert-heading {
    color: #7f1d1d;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
    background-color: #f3f4f6;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 0;
    margin-top: 3rem;
}
