/* =========================================================
   Randolph County Family Crisis Center
   Bloomerang Hosted Registration Form
   Responsive FCC Brand Stylesheet
   ========================================================= */

/* Optional Google Fonts:
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap" rel="stylesheet">
*/

:root {
    --fcc-blue: #0057b7;
    --fcc-purple: #6a0da0;
    --fcc-teal: #1fa9a3;
    --fcc-light-blue: #84b8dc;
    --fcc-light-purple: #b486cf;
    --fcc-light-teal: #8fd4d1;
    --fcc-orange: #f7941d;
    --fcc-navy: #1b4e91;
    --fcc-white: #ffffff;
    --fcc-black: #000000;
    --fcc-gray: #f4f7fa;
    --fcc-border: #d7e1ea;
    --font-primary: "Poppins", Arial, sans-serif;
    --font-secondary: "Quicksand", Arial, sans-serif;
}

/* ---------------------------------------------------------
   Global sizing and overflow protection
   --------------------------------------------------------- */

html {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background: #f7fbff; /* very very light blue */
    color: #333333;
    font-family: var(--font-secondary);
    font-size: 16px;
    line-height: 1.5;
}

*,
*::before,
*::after {
    box-sizing: border-box !important;
}

body * {
    min-width: 0 !important;
}

/* Prevent long text, email addresses, URLs, and labels from overflowing */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
label,
legend,
li,
a,
strong,
small,
div {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-wrap: break-word !important;
}

/* ---------------------------------------------------------
   Bloomerang page wrappers
   --------------------------------------------------------- */

body > div,
body > form,
main,
header,
footer,
section,
article,
form,
.container,
.content,
.content-wrapper,
.page,
.page-wrapper,
.wrapper,
.form-container,
.form-wrapper,
.registration-form,
.donation-form,
.hosted-form,
.widget,
.widget-container {
    width: 100% !important;
    max-width: 900px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Add safe spacing without increasing total width */
main,
header,
footer,
section,
article,
form,
.container,
.content,
.content-wrapper,
.page,
.page-wrapper,
.wrapper,
.form-container,
.form-wrapper,
.registration-form,
.donation-form,
.hosted-form,
.widget,
.widget-container {
    padding-left: 18px !important;
    padding-right: 18px !important;
}

/* Nested elements should never retain a fixed desktop width */
header *,
footer *,
main *,
form *,
section *,
article * {
    min-width: 0 !important;
}

/* ---------------------------------------------------------
   Logo and header
   --------------------------------------------------------- */

header,
.header,
.page-header,
.form-header,
.widget-header {
    overflow: hidden !important;
}

header img,
.header img,
.page-header img,
.form-header img,
.widget-header img,
img[alt*="logo" i],
img[src*="logo" i] {
    display: block !important;
    width: auto !important;
    max-width: min(100%, 260px) !important;
    height: auto !important;
    margin: 0 0 20px !important;
    object-fit: contain !important;
}

/* Protect all images, including the FCC logo */
img,
svg,
picture,
picture img {
    max-width: 100% !important;
    height: auto !important;
}

/* Page title */
h1 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 24px !important;
    color: var(--fcc-navy);
    font-family: var(--font-primary);
    font-size: clamp(1.65rem, 5vw, 2.6rem) !important;
    font-weight: 700;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
}

h2 {
    margin: 0 0 18px;
    color: var(--fcc-navy);
    font-family: var(--font-primary);
    font-size: clamp(1.3rem, 3.5vw, 1.9rem) !important;
    font-weight: 700;
    line-height: 1.25;
}

h3 {
    margin: 0 0 14px;
    color: var(--fcc-navy);
    font-family: var(--font-primary);
    font-size: clamp(1.1rem, 3vw, 1.45rem) !important;
    font-weight: 700;
    line-height: 1.3;
}

/* ---------------------------------------------------------
   Form fields and option text
   --------------------------------------------------------- */

fieldset,
.form-section,
.field-group,
.panel,
.card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 24px !important;
    padding: 20px !important;
    overflow: hidden !important;
    border: 1px solid var(--fcc-border);
    border-radius: 12px;
    background: #ffffff;
}

legend,
.section-title {
    max-width: 100% !important;
    color: var(--fcc-blue);
    font-family: var(--font-primary);
    font-size: 1.15rem;
    font-weight: 700;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--fcc-navy);
    font-family: var(--font-primary);
    font-weight: 600;
}

input,
select,
textarea,
button {
    max-width: 100% !important;
    font: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    display: block;
    width: 100% !important;
    min-height: 46px;
    padding: 10px 12px;
    border: 2px solid var(--fcc-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--fcc-black);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--fcc-blue);
    box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.12);
}

/* Radio and checkbox options */
input[type="radio"],
input[type="checkbox"] {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: auto !important;
    margin: 0.2rem 8px 0 0 !important;
    accent-color: var(--fcc-blue);
}

.radio,
.checkbox,
.radio-option,
.checkbox-option,
.form-check,
.form-check-inline {
    display: flex !important;
    align-items: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 12px !important;
    white-space: normal !important;
}

.radio label,
.checkbox label,
.radio-option label,
.checkbox-option label,
.form-check label,
.form-check-inline label {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: #333333;
    font-family: var(--font-secondary);
    font-weight: 500;
    line-height: 1.45;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Hosted forms sometimes use list items for registration levels */
ul,
ol {
    max-width: 100% !important;
    padding-left: 1.25rem !important;
}

li {
    max-width: 100% !important;
    margin-bottom: 10px;
}

/* ---------------------------------------------------------
   Bottom contact and organization information
   --------------------------------------------------------- */

footer,
.footer,
.page-footer,
.form-footer,
.widget-footer,
.contact-info,
.organization-info {
    width: 100% !important;
    max-width: 900px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

footer *,
.footer *,
.page-footer *,
.form-footer *,
.widget-footer *,
.contact-info *,
.organization-info * {
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

footer a,
.footer a,
.page-footer a,
.form-footer a,
.widget-footer a,
.contact-info a,
.organization-info a {
    display: inline-block;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* Remove fixed-position footer behavior if Bloomerang applies it */
footer,
.footer,
.page-footer,
.form-footer,
.widget-footer {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* ---------------------------------------------------------
   Tables and multi-column layouts
   --------------------------------------------------------- */

table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    border-collapse: collapse;
}

thead,
tbody,
tr {
    max-width: 100% !important;
}

th,
td {
    padding: 10px;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Collapse common desktop grids and rows */
.row,
.columns,
.form-row,
.grid,
.flex-row {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

[class*="col-"],
.column,
.columns > *,
.form-row > *,
.grid > *,
.flex-row > * {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

button,
input[type="submit"],
.submit-button,
.btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100% !important;
    min-height: 48px;
    padding: 12px 24px;
    border: 0;
    border-radius: 8px;
    background: var(--fcc-blue);
    color: var(--fcc-white);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    white-space: normal !important;
    cursor: pointer;
}

button:hover,
input[type="submit"]:hover,
.submit-button:hover,
.btn:hover,
.button:hover {
    background: var(--fcc-navy);
}

a {
    color: var(--fcc-blue);
}

a:hover,
a:focus {
    color: var(--fcc-purple);
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 700px) {
    main,
    header,
    footer,
    section,
    article,
    form,
    .container,
    .content,
    .content-wrapper,
    .page,
    .page-wrapper,
    .wrapper,
    .form-container,
    .form-wrapper,
    .registration-form,
    .donation-form,
    .hosted-form,
    .widget,
    .widget-container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    header img,
    .header img,
    .page-header img,
    .form-header img,
    .widget-header img,
    img[alt*="logo" i],
    img[src*="logo" i] {
        max-width: min(100%, 210px) !important;
    }

    h1 {
        font-size: 1.7rem !important;
    }

    h2 {
        font-size: 1.35rem !important;
    }

    fieldset,
    .form-section,
    .field-group,
    .panel,
    .card {
        padding: 15px !important;
    }

    .row,
    .columns,
    .form-row,
    .grid,
    .flex-row {
        display: block !important;
    }

    [class*="col-"],
    .column,
    .columns > *,
    .form-row > *,
    .grid > *,
    .flex-row > * {
        width: 100% !important;
        float: none !important;
    }

    button,
    input[type="submit"],
    .submit-button,
    .btn,
    .button {
        width: 100% !important;
    }
}

/* Final emergency override for any fixed-width Bloomerang element */
@media (max-width: 1000px) {
    body [style*="width"],
    body [style*="min-width"] {
        max-width: 100% !important;
        min-width: 0 !important;
    }
}


/* =========================================================
   Center FCC logo and organization header
   ========================================================= */

header,
.header,
.page-header,
.form-header,
.widget-header,
.logo,
.logo-container,
.brand,
.branding {
    text-align: center !important;
}

header img,
.header img,
.page-header img,
.form-header img,
.widget-header img,
.logo img,
.logo-container img,
img[alt*="logo" i],
img[src*="logo" i] {
    display: block !important;
    margin: 0 auto 20px auto !important;
}

header h1,
.header h1,
.page-header h1,
.form-header h1,
.widget-header h1,
header h2,
.header h2,
.page-header h2,
.form-header h2,
.widget-header h2 {
    text-align: center !important;
}
