/* Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body, input, textarea {
    font-family: sans-serif;
    font-size: 16px;
    background-color: #fffdf7;
    color: #023366;
    margin: 0;
    padding: 0;
}

input, textarea, select, button {
    border: 2px solid #023366;
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
    width: 100%;
}

/* Link Styles */
a {
    font-weight: 800;
    color: #023366;
}

a:hover {
    outline: 2px solid #023366;
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: #023366;
    color: #fffdf7;
    padding: 8px 16px;
    z-index: 1001;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* Button Styles */
.submit-btn {
    background-color: #fffdf7;
    color: #023366;
    cursor: pointer;
    padding: 12px 32px;
    font-weight: 700;
    border: 2px solid #023366;
    width: auto;
    min-width: 160px;
    transition: background-color 0.2s, color 0.2s;
}

.submit-btn:hover {
    color: #fffdf7;
    background-color: #023366;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Title Styles */
.title {
    text-align: center;
    width: 100%;
    margin-bottom: 8px;
}

.title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Header & Logo */
header {
    width: 100%;
}

.logo-container {
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;
}

.logo-image {
    width: 50%;
    max-width: 500px;
}

/* Form Layout */
form {
    width: 100%;
}

.form-container {
    width: 50%;
    padding: 20px;
    margin-right: auto;
    margin-left: auto;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.label {
    font-family: sans-serif;
    font-size: 16px;
    font-weight: 700;
}

label {
    padding-top: 2px;
    padding-bottom: 2px;
    display: block;
}

/* Responsive Styles */
@media (max-width: 900px) and (min-width: 601px) {
    .form-container {
        width: 70%;
    }

    .logo-image {
        width: 70%;
    }
}

@media (max-width: 600px) {
    .form-container {
        width: 90%;
    }

    .logo-image {
        width: 90%;
    }
}

/* Fields Group Styles */
.fields-group {
    display: flex;
    flex-flow: column;
    padding-top: 10px;
    padding-bottom: 10px;
}

.fields-group input,
.fields-group textarea,
.fields-group select,
.fields-group button {
    padding: 10px;
}

/* Field Hint */
.field-hint {
    display: block;
    font-size: 0.875rem;
    font-style: italic;
    color: #023366;
    margin-top: 2px;
    margin-bottom: 4px;
}

/* Validation */
.error {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 4px;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
    border-color: #d32f2f;
}

.required-note {
    font-size: 0.875rem;
    margin-top: 0;
    margin-bottom: 8px;
}

.validation-summary {
    color: #d32f2f;
    margin-bottom: 16px;
}

.validation-summary ul {
    padding-left: 20px;
}

/* Submission Info and Finished Panel Styles */
.submission-info-container {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 16px;
    border: 1px solid #023366;
    border-radius: 4px;
    background-color: #f5f5f5;
}

.privacy-container {
    padding-top: 20px;
}

/* Footer Styles */
footer {
    width: 100%;
    text-align: center;
    padding: 10px;
}

/* Focus Styles for Accessibility */
input:focus,
textarea:focus,
select:focus,
button:focus,
a:focus {
    outline: 2px solid #023366;
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Loading Icon Styles */
.loading-icon {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 253, 247, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-icon.active {
    display: flex;
}

.loading-icon::after {
    content: "";
    width: 48px;
    height: 48px;
    border: 4px solid #023366;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Google Places Autocomplete Element */
gmp-place-autocomplete {
    width: 100%;
    --gmpx-color-surface: #fffdf7;
    --gmpx-color-on-surface: #023366;
    --gmpx-color-primary: #023366;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}