* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

p,
ul {
    margin-bottom: 0.5em;
}

li {
    margin-left: 2em;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 14em;
    font-size: 1.05rem;
}

body {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    min-height: 100vh;
    letter-spacing: 0.01em;
    text-align: center;
}

h1 {
    font-size: 2em;
    font-weight: normal;
    margin-bottom: 1em;
    text-align: center;
}

#banner {
    display: inline-block;
    max-width: 100%;
    width: 40rem;
    margin: 0 auto;
}

.outer {
    display: block;
    margin: 2rem auto;
    width: 60rem;
    max-width: 100%;
}

.content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    background: none;
}

.sidebar {
    font-size: 1rem;
    flex-basis: 35%;
    text-align: left;
    padding-left: 2rem;
    border-left: 2px solid black;
}

.main {
    flex-basis: 65%;
    text-align: left;
    padding: 1em;
}

.left-aligned {
    text-align: left;
}

.centered {
    text-align: center;
}

.btn {
    padding: 0.5em;
    font-size: 0.9em;
}

.btn-primary {
    background: #1338c0;
    color: white;
    border: 1px solid #1338c0;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #0d2a8f;
    border-color: #0d2a8f;
}

.btn-success {
    background: #2a7a2a;
    color: white;
    border: 1px solid #2a7a2a;
    border-radius: 4px;
    cursor: pointer;
}

.btn-success:hover {
    background: #1e5c1e;
    border-color: #1e5c1e;
}

.btn-danger {
    background: #c03020;
    color: white;
    border: 1px solid #c03020;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger:hover {
    background: #9a2018;
    border-color: #9a2018;
}

.btn-secondary {
    background: #444;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #222;
    border-color: #222;
}

.btn-edit {
    background: none;
    border: 1px solid #1338c0;
    color: #1338c0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    padding: 0.25em 0.6em;
    white-space: nowrap;
}

.btn-edit:hover {
    background: #1338c0;
    color: white;
}

.error-message {
    color: #d32f2f;
    font-size: 0.9em;
    margin-top: 0.25em;
    display: block;
    text-align: left;
}

p.error-message {
    text-align: center;
    margin-bottom: 1em;
    font-weight: bold;
}

.form-group {
    margin: 0 0 0.5em 0;
}

.input-group {
    display: inline-block;
    text-align: right;
    margin-left: 1em;
}

.submit-button {
    text-align: center;
}

.turnstile-widget {
    margin-top: 0.75rem;
    text-align: center;
}

.turnstile-waiting {
    margin-top: 0.75rem;
    color: #555;
    font-size: 0.95rem;
    text-align: center;
}

.turnstile-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid #ccc;
    border-top-color: #555;
    border-radius: 50%;
    animation: turnstile-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4em;
}

@keyframes turnstile-spin {
    to { transform: rotate(360deg); }
}

.reqd {
    color: red;
}

.help-icon {
    cursor: pointer;
    color: #1338c0;
    font-weight: bold;
}

.help-icon:hover {
    background: #1338c0;
    color: white;
}

.tooltipped-text {
    cursor: pointer;
    color: #1338c0;
    text-decoration: underline;
}

.tooltipped-text:hover {
    background: #1338c0;
    color: white;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 0 3rem 1rem 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: left;
    font-weight: normal;
}

.modal-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #1338c0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-close-btn:hover {
    background: #0d2a8f;
}

#notification-modal-text {
    margin-top: 1rem;
    line-height: 1.5;
}

.flash-message {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75em 1em;
    margin-bottom: 1em;
    background: #ffffdd;
    border: 1px solid #1338c0;
    color: #1338c0;
    font-weight: bold;
}

/* Shown when the server rendered a message. Was an inline style="display:flex"
   emitted conditionally by views/layout.ts. */
.flash-message.is-visible {
    display: flex;
}

.flash-message-text {
    flex: 1;
}

.flash-message-close {
    background: none;
    border: none;
    color: #1338c0;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 0.25em;
}

.flash-message-close:hover {
    color: #0d2a8f;
}

.boxed {
    padding: 1em;
    margin: 1em 2em 0 2em;
    border: 1px solid #1338c0;
}

.boxed .boxed.inner {
    margin: 1em 0 0 0;
}

.bigboxed {
    margin-left: 0;
    margin-right: 0;
}

.box0 {
    background: #f0ffff;
    border-color: black;
    margin-bottom: 0.5em;
}

.box1 {
    background: #e0f0ff;
}

.box2 {
    background: #d0e8ff;
}

.box3 {
    background: #e0e8ff;
}

.box4 {
    border-width: 2px;
    border-color: #c03020
}

.boxed-title {
    text-align: center;
    font-weight: bold;
}

.home-welcome {
    font-size: 1.1em;
}

.faq-question {
    text-align: left;
    font-weight: bold;
    margin-bottom: 1em;
}

.faq-answer {
    text-align: left;
    margin-left: 2em;
    margin-bottom: 1em;
}


.under-construction {
    background: #FFFFC0;
    border-color: #c0a000;
    font-size: 1.2em;
    margin: 0 0 1em 0;
}

.generation-note {
    text-align: left;
    font-size: 0.9em;
    color: #1a5dab;
    margin: .75em;
    text-indent: -0.75em;
}

.recruitmentTotal-badge {
    display: inline-block;
    padding: 0.2em;
    font-size: 1.1em;
    font-weight: bold;
    background: #1338c0;
    color: white;
    border: 1px solid black;
}

.menubar {
    display: flex;
    width: 100%;
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    align-items: center;
    border-top: 2px solid black;
    border-bottom: 2px solid black;
}

.menu-item {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0.1rem 0.3rem;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
}

.menu-item.active,
.menu-item:hover,
.menu-item:focus {
    background: gray;
    color: white;
}

.menu-item-current {
    background: #1338c0;
    color: white;
}

.orgsfngimg {
    float: right;
    margin: 0 0 1rem 1rem;
    width: 40%;
}

.orgsimg {
    display: block;
    margin: 0 auto 1rem auto;
    width: 60%;
}

.orgsheading {
    font-size: 1.1rem;
    text-align: center;
    font-weight: bold;
    margin: 2rem 0 1rem 0;
}

.orgstext {
    text-align: left;
    margin-bottom: 1.5rem;
}

.aboutrow {
    display: flex;
    align-items: center;
    margin-bottom: 0.7em;
    gap: 1em;
}

.aboutimgdiv {
    flex-basis: 35%;
    text-align: left;
}

.aboutimg {
    width: 100%;
}

.abouttextdiv {
    flex-basis: 65%;
}

.abouttitle {
    display: block;
    text-align: center;
    font-style: italic;
    font-weight: bold;
    margin-left: -0.5em;
}

.homepage {
    font-weight: bold;
    text-align: center;
    margin: 0 0;
}

.follow-button-p {
    text-align: center;
    margin: 1em 0 0 0;
}

.follow-button {
    display: inline-block;
    border: 1px solid black;
    border-radius: 1rem;
    padding: 0.25rem 1.2rem;
    margin: 0 auto;
    text-align: center;
    font-weight: bold;
    transition: background 0.18s, color 0.18s;
}

.follow-button a,
.follow-button a:visited {
    color: black;
}

.follow-button:hover {
    background: #1338c0;
    color: #fff;
}

.account-fields {
    margin-top: 0.5rem;
}

.account-field+.account-field {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.field-label {
    display: block;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 0.25rem;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.field-value {
    flex: 1;
}

.field-note {
    font-size: 0.9em;
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    body {
        font-size: 1.4em;
        background-image: none;
    }

    .outer {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
        box-shadow: none;
        padding: 0 0 0.5em 0;
    }

    .menubar {
        gap: 1em;
        margin-bottom: 1em;
    }

    .content {
        flex-direction: column;
        gap: 0;
    }

    .sidebar,
    .main {
        width: 100%;
        max-width: 100%;
        font-size: 1em;
        border: none;
    }

    .boxed {
        padding: 0;
        margin: 1em 0 0 0;
        border: none;
    }

    .orgsheading {
        font-size: 1.5rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
        width: 100%;
        max-width: 16em;
    }

    .input-group {
        display: block;
        text-align: left;
        margin-left: 0;
    }

    .orgsfngimg {
        float: none;
        display: block;
        width: 60%;
        margin: 0 auto 1rem auto;
    }

    .aboutrow {
        flex-direction: column;
    }

    .abouttitle {
        margin-bottom: 0.5em;
    }

    .aboutrow:first-child {
        flex-direction: column-reverse;
    }

    .aboutimgdiv {
        flex-basis: auto;
        text-align: center;
    }

    .aboutimg {
        width: 200px;
    }

    .input-group {
        text-align: center;
    }

    .input-group label {
        display: block;
        text-align: center;
        margin-bottom: 0.25em;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
        max-width: none;
        width: 90%;
    }

    .box0,
    .box1,
    .box2,
    .box3,
    .box4 {
        border: 1px solid #1338c0;
        padding: 1em;
    }

    .box0 {
        margin-bottom: 1em;
    }

    .box4 {
        border-width: 2px;
        border-color: #c03020;
    }

    .faq-answer {
        margin-left: 1em;
    }

    .account-actions {
        flex-direction: column;
        align-items: center;
    }

    .account-actions form {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .account-actions-delete {
        margin-left: 0;
    }
}

.recruitment-link {
    overflow-wrap: anywhere;
    word-break: break-all;
}

.account-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.account-actions-delete {
    margin-left: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1001;
    padding: 0.5em 1em;
    background: #1338c0;
    color: white;
    font-weight: bold;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #1338c0;
    outline-offset: 2px;
}

button.help-icon {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}

button.tooltipped-text {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: #1338c0;
    text-decoration: underline;
}

button.tooltipped-text:hover {
    background: #1338c0;
    color: white;
}

/* Copy-link confirmation on the home page. Was an inline <style> block in
   views/home.ts; moved here so style-src need not allow inline stylesheets. */
.success {
    font-size: 0.9em;
    visibility: hidden;
    display: block;
    margin: 0.5em 0;
}

/* ---------------------------------------------------------------------------
   Classes replacing the style="..." attributes the views used to carry, so the
   CSP can drop style-src-attr 'unsafe-inline'. Derived from the 57 distinct
   declarations that were in use: repeated multi-property blobs became component
   classes, one-off spacing and colour became the small utility set below.

   Note that JS styling (element.style.foo = ...) is unaffected by CSP and was
   left alone; only markup attributes had to move.
   --------------------------------------------------------------------------- */

/* Spacing utilities */
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 0.75rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-1 { margin-bottom: 1rem; }
.ml-sm { margin-left: 0.5rem; }

/* Text utilities */
.muted { color: #666; }
.muted-light { color: #999; }
.dim { color: #888; }
.accent-red { color: #c03020; }
.warn-text { color: #b45309; }
.error-text { color: red; }
.success-text { color: #28a745; }
.small { font-size: 0.9em; }
.bold { font-weight: bold; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Display utilities */
.hidden { display: none; }
.inline { display: inline; }
.block { display: block; }
.scroll-x { overflow-x: auto; }
.button-row { display: flex; gap: 1rem; }
.button-row.wrap { flex-wrap: wrap; }
.button-row.align-center { align-items: center; }

/* Page containers */
.centered-page { text-align: center; padding: 2rem; }
.narrow-page { max-width: 500px; margin: 0 auto; padding: 2rem; }
.section-divider { margin: 3rem 0; border: none; border-top: 2px solid #c03020; }
.rule { height: 2px; border: none; background: black; width: 80%; margin: 1em auto; }
.panel-bg { background: #f8f9fa; }

/* Forms */
.field-group { margin-bottom: 1rem; padding: 1rem; border: 1px solid #ddd; border-radius: 4px; }
.admin-input { width: 100%; padding: 0.5rem; margin-top: 0.25rem; box-sizing: border-box; }
.admin-select { width: 100%; padding: 0.5rem; margin-top: 0.25rem; }
.admin-textarea { min-height: 300px; }
.admin-input-narrow { width: 80px; padding: 0.25rem; }

/* Admin statistics */
.admin-panel { margin: 2rem 0; border: 1px solid #ddd; }
.stat-row { display: flex; gap: 2rem; margin: 1rem 0; flex-wrap: wrap; }
.stat-box { background: #f8f9fa; padding: 1rem; border-radius: 8px; text-align: center; min-width: 120px; }
.stat-value { font-size: 2rem; font-weight: bold; }
.stat-value--blue { color: #007bff; }
.stat-value--green { color: #28a745; }
.stat-value--purple { color: #6f42c1; }
.stat-label { font-size: 0.9em; color: #666; margin-top: 0.5rem; }

/* Admin tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.admin-th { padding: 12px 8px; border-bottom: 2px solid #ddd; }
.admin-td { padding: 8px; border-bottom: 1px solid #eee; }
.admin-empty { padding: 1rem; text-align: center; color: #999; }

/* Campaign / recalculation status */
.status-banner { padding: 1rem; margin-bottom: 1rem; border-radius: 4px; background: #f8f9fa; border: 1px solid #ddd; }
.status-info { font-size: 0.9em; color: #666; margin-top: 0.25rem; }
.task-info { font-size: 0.9em; color: #666; margin-top: 5px; }
.progress-bar-container { width: 100%; height: 20px; background-color: #f0f0f0; border-radius: 10px; margin: 10px 0; }
.progress-bar { width: 0%; height: 100%; background-color: #4CAF50; border-radius: 10px; transition: width 0.3s ease; }
