:root {
    --plum: #642751;
    --brick: #932308;
    --mauve: #7F566C;
    --rust: #9F5D08;
    --green: #2C654E;
    --darkgray: #575858;
    --lightgray: #f1f2f2;
}

body {
    font-family: "Montserrat", "Arial", sans-serif;
    background: var(--lightgray);
    color: var(--darkgray);
    margin: 0;
    padding: 0;
}

#logo {
    display: block;
    margin: 1em auto 0.5em auto;
    padding: 1em;
    background-color: #fff;
    border-radius: 16px;
    max-width: 350px;
    box-shadow: 0 8px 40px 0 rgba(100, 39, 81, 0.10);
}

.icon img{
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    align-items: center;
    padding-bottom: 0.2em;
    opacity: 0.93;
}

.dept-badge {
    background: #fff;
    color: var(--plum);
    border-radius: 999px;
    padding: 1em 0.8em 1em 0.7em;
    border: 1px solid var(--mauve);
    font-weight: 600;
    font-size: 0.95em;
    margin: 0 0 0 0.2em;
    box-shadow: 0 1px 4px 0 rgba(127, 86, 108, 0.06);
    text-align: center;
}

#dept-name {
    margin-left: 0.5em;
    font-weight: 700;
    color: var(--plum);
    letter-spacing: 0.04em;
}


/*---- Survey Card ----*/

#survey {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0px 6px 40px 0 rgba(127, 86, 108, 0.18);
    max-width: 720px;
    margin: 0 auto 3em auto;
    padding: 2.4em 2em 2.1em 2em;
}

#survey h1 {
    color: var(--plum);
    margin-top: 0.2em;
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    letter-spacing: 0.02em;
    margin-bottom: 2.1em;
}

#survey label {
    color: var(--plum);
    font-weight: 600;
    display: block;
    margin-bottom: 0.3em;
    font-size: 1.07em;
}

#survey select,
#survey textarea,
.department-selector {
    margin-top: 0.12em;
    padding: 0.6em;
    width: 100%;
    background: #f9f4f7;
    border: 1.7px solid var(--mauve);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    color: var(--darkgray);
    transition: border-color 0.19s, box-shadow 0.17s;
    margin-bottom: 0.7em;
    box-sizing: border-box;
    outline: none;
}

#survey select:focus,
#survey textarea:focus {
    border-color: var(--rust);
    box-shadow: 0 0 0 2px #9F5D0814;
    background: #fff9f4;
}

#survey textarea {
    resize: vertical;
    min-height: 90px;
}

#survey button[type="submit"] {
    display: block;
    margin: 2.5em auto 0 auto;
    padding: 0.8em 3.2em;
    border-radius: 999px;
    background: var(--plum);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.13em;
    border: none;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 16px 0 rgba(100, 39, 81, 0.11);
    transition: background 0.19s, box-shadow 0.16s, transform 0.13s;
}

#survey button[type="submit"]:hover,
#survey button[type="submit"]:focus {
    color: #fff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px 0 rgba(44, 101, 78, 0.13);
}

/*---- Department Selection Page ----*/
#department-selection {
    max-width: 650px;
    margin: 2.4em auto;
    background: #fff;
    border-radius: 20px;
    padding: 2.3em 2em 2.7em 2em;
    box-shadow: 0 8px 40px 0 rgba(127, 86, 108, 0.16);
    text-align: center;
}

#department-selection h1 {
    color: var(--plum);
    margin-bottom: 0.4em;
    font-size: 2em;
    font-weight: bold;
    letter-spacing: 0.01em;
}

.department-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9em;
    justify-content: center;
    margin-top: 1.4em;
}

.department-selector {
    display: inline-block;
    background: var(--plum);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    padding: 0.8em 1.6em;
    font-size: 1.08em;
    margin: 0.22em 0.22em;
    box-shadow: 0 2px 8px rgba(127, 86, 108, 0.11);
    cursor: pointer;
    transition: background 0.16s, box-shadow 0.16s, transform 0.12s;
}

.department-selector:hover,
.department-selector:focus {
    box-shadow: 0 8px 22px 0 rgba(127, 86, 108, 0.19);
    transform: translateY(-2px) scale(1.04);
    outline: none;
}

/*---- Stats Table ----*/
#stats-container {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0px 6px 40px 0 rgba(127, 86, 108, 0.18);
    max-width: 720px;
    margin: 0 auto 3em auto;
    padding: 2.4em 2em 2.1em 2em;
}

#stats-container h1 {
    color: var(--plum);
    margin-bottom: 1.4em;
    text-align: center;
    font-size: 2em;
}

#back-button a {
    background: var(--plum);
    color: #fff;
    border-radius: 999px;
    padding: 0.45em 1.5em;
    font-weight: 600;
    box-shadow: 0 2px 10px 0 rgba(100, 39, 81, 0.07);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 1.2em;
    transition: background .14s;
    font-size: 1.00em;
    font-family: inherit;
}

#back-button a:hover,
#back-button a:focus {
    box-shadow: 0 4px 18px 0 rgba(100, 39, 81, 0.16);
    transform: translateY(-1px) scale(1.04);
    text-decoration: none;
}

.download-buttons {
    background: var(--plum);
    width: 80%;
    color: #fff;
    border-radius: 999px;
    padding: 0.45em 1.5em;
    font-weight: 600;
    box-shadow: 0 2px 10px 0 rgba(100, 39, 81, 0.07);
    text-decoration: none;
    display: block;
    margin-bottom: 1.2em;
    transition: background .14s;
    font-size: 1.00em;
    font-family: inherit;
    border: 0px;

}

.download-buttons:hover, .download-buttons:hover {
    box-shadow: 0 4px 18px 0 rgba(100, 39, 81, 0.25);
    transform: translateY(-1px) scale(1.04);
    text-decoration: none;
    border: 0px;
}


#stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5em;
    text-align: center;
}

#stats-table th{
    text-align: center;
    padding: 1em;
}

#ambulatory-download-buttons,
#respite-download-buttons {
    display: flex;
    flex-direction: column;  /* or 'row' if you want buttons side by side */
    align-items: center;     /* horizontal center */
    justify-content: center; /* vertical center (if needed, e.g., for fixed height) */
}


/*---- Thank You / Loader ----*/
#thankyou {
    max-width: 470px;
    margin: 3em auto 0 auto;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0px 6px 40px 0 rgba(127, 86, 108, 0.15);
    padding: 2.1em 2em 3em 2em;
    text-align: center;
}

#thankyou h1 {
    color: var(--plum);
    font-size: 2em;
}

#thankyou p {
    color: var(--darkgray);
    font-size: 1.13em;
}

/* Loader animation (circle) */
#loader {
    display: inline-block;
    margin: 2em auto 0 auto;
    width: 36px;
    height: 36px;
    border: 4px solid #eee;
    border-top: 4px solid var(--plum);
    border-radius: 50%;
    animation: spinner 0.5s linear infinite;
}

/* Department Selection Dropdown & Button */
#department-dropdown {
    display: block;
    margin: 2.2em auto 0.9em auto;
    width: 100%;
    max-width: 420px;
    background: #f9f4f7;
    border: 2px solid var(--mauve);
    border-radius: 10px;
    padding: 0.9em 1em;
    font-size: 1.12em;
    font-family: inherit;
    color: var(--plum);
    font-weight: 600;
    box-shadow: 0 2px 10px 0 rgba(127, 86, 108, 0.06);
    transition: border-color 0.19s, box-shadow 0.17s, background 0.17s;
    appearance: none;
    outline: none;
}

#department-dropdown:focus {
    border-color: var(--rust);
    background: #fff9f4;
    box-shadow: 0 0 0 2px #9F5D0814;
}

#department-selection button[type="button"] {
    display: block;
    margin: 2.1em auto 0 auto;
    padding: 0.85em 3em;
    border-radius: 999px;
    background: var(--plum);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.13em;
    border: none;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 16px 0 rgba(100, 39, 81, 0.11);
    transition: background 0.19s, box-shadow 0.16s, transform 0.13s;
}

#department-selection button[type="button"]:hover,
#department-selection button[type="button"]:focus {
    background: var(--mauve);
    color: #fff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px 0 rgba(44, 101, 78, 0.13);
}


@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* ---- Nav Menu ---- */
.buttons-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    margin: 2em auto 2.5em auto;
    padding: 0.35em 1.3em;
    background: #ede8ec;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(100,39,81,0.07);
    max-width: 950px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75em;
    width: 30em;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 0.3em;
    max-width: 30em;
}

.nav-right {
    display: inline-block;
    align-items: center;
    text-align: right;
    gap: 0.3em;
    width: 30em;
}

.button {
    display: block;
    font-size: 0.98em;
    font-weight: 600;
    padding: 1em 1.1em;
    border-radius: 999px;
    border: none;
    background: var(--plum);
    color: #fff;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
    margin-left: 0.15em;
    margin-right: 0.15em;
    box-shadow: none;
    text-align: center;
    text-decoration: none;
    text-wrap: nowrap;
    display: inline-block;
    font-family: inherit;

}

.button:hover,
.button:focus {
    background: var(--mauve);
    color: #fff;
    box-shadow: 0 4px 18px 0 rgba(100, 39, 81, 0.13);
    transform: translateY(-1px) scale(1.03);
    text-decoration: none;
}


/* --- Language Buttons --- */
#lang-en, #lang-es {
    font-size: 0.98em;
    font-weight: 600;
    padding: 0.45em 1.1em;
    border-radius: 999px;
    border: none;
    background: var(--mauve);
    color: #fff;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
    margin-left: 0.15em;
    margin-right: 0.15em;
    box-shadow: none;
}
#lang-en.active, #lang-es.active {
    background: var(--plum);
    color: #fff;
    /* Optionally add a subtle underline instead of a border! */
    text-decoration: underline 2px var(--rust);
}
#lang-en:hover, #lang-es:hover,
#lang-en:focus, #lang-es:focus {
    background: var(--plum);
    color: #fff;
}

@media (max-width: 800px) {
   
    #survey h1, #department-selection h1 {
        font-size: 2.5em;
        margin-top: 0.2em;
        margin-bottom: 1.5em;
    }

    #survey label, #department-selection label {
        font-size: 1.4em;
    }

    #survey select,
    #survey textarea, #department-selection select,
    #department-selection textarea
    .department-selector {
        font-size: 1.2em;
        width: 100%;
        max-width: 100%;
    }
    
    .buttons-container {
        flex-direction: column;
        align-items: center;
        gap: 0.5em;
    }

    .nav-left, .nav-right {
        width: 100%;
        text-align: center;
    }

    .nav-center {
        width: 100%;
        justify-content: center;
    }

    .button {
        width: 100%;
        margin: 0;
    }

    #survey button[type="submit"] {
        margin: 1em auto 0 auto;
        padding: 0.8em 3.2em;
        font-size: 1.4em;
    }
    
    #survey button[type="submit"]:hover,
    #survey button[type="submit"]:focus {
        color: #fff;
        transform: translateY(-2px) scale(1.03);
        box-shadow: 0 6px 18px 0 rgba(44, 101, 78, 0.13);
    }


}