:root {
    --bg: #f6f8fb;
    --surface: #fff;
    --soft: #f3f5f9;
    --text: #111827;
    --muted: #6b7280;
    --border: #d9dee8;
    --brand: #1f5fa8;
    --nav: #8b1e1e;
    --green: #16a34a;
    --warn: #9a3412;
    --good: #166534;
    --shadow: 0 8px 24px rgba(16,24,40,.08)
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Arial,sans-serif;
    background: var(--bg);
    color: var(--text)
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px;
    text-align: center
}

.logo {
    font-size: 30px;
    font-weight: 800
}

.tag {
    font-size: 13px;
    color: var(--muted)
}

nav {
    background: var(--nav);
    color: #fff;
    padding: 10px 24px
}

.nav-inner {
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

    .nav-links a {
        color: #fff;
        text-decoration: none;
        border: 1px solid rgba(255,255,255,.2);
        border-radius: 999px;
        padding: 9px 12px;
        font-size: 13px;
        background: rgba(255,255,255,.12)
    }

.page {
    max-width: 1200px;
    margin: auto;
    padding: 24px
}

.hero {
    min-height: 410px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg,#225b2f,#3d8d4c 45%,#7dbd63);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 32px;
    position: relative;
    overflow: hidden
}

    .hero:before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.25)
    }

    .hero > div {
        position: relative;
        max-width: 780px
    }

    .hero h1 {
        font-size: 42px;
        margin: 10px 0
    }

    .hero p {
        font-size: 17px;
        line-height: 1.5
    }

.pill {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.15);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green)
}

.btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 11px 18px;
    font-weight: 800;
    cursor: pointer;
    background: #fff
}

.btn-primary {
    background: #111;
    color: #fff
}

    .btn-primary:disabled {
        background: #9ca3af;
        color: #e5e7eb;
        cursor: not-allowed;
        opacity: .75
    }

.btn-outline {
    color: var(--brand);
    border-color: var(--brand)
}

.btn-cancel {
    border-color: var(--border)
}

.info {
    margin-top: 18px;
    background: #fff9db;
    border: 1px solid #f2e5a9;
    color: #5b4b07;
    border-radius: 16px;
    padding: 16px
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.55);
    z-index: 1000;
    padding: 24px;
    overflow: auto
}

    .modal.open {
        display: block
    }

.dialog {
    max-width: 1060px;
    margin: auto;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0,0,0,.18);
    overflow: hidden
}

.modal-head, .footer {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 16px
}

.modal-head {
    background: linear-gradient(180deg,var(--soft),var(--surface))
}

    .modal-head h2 {
        margin: 0;
        font-size: 23px
    }

    .modal-head p, .footer-note {
        font-size: 13px;
        color: var(--muted);
        line-height: 1.45
    }

.close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 24px;
    cursor: pointer
}

.tabs {
    display: flex;
    gap: 10px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap
}

.tab {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--soft);
    padding: 9px 14px;
    font-weight: 800;
    cursor: pointer
}

    .tab.active {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand)
    }

.body {
    padding: 22px 24px
}

.panel {
    display: none
}

    .panel.active {
        display: block
    }

.summary {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 12px;
    margin-bottom: 18px
}

.card, .section {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--soft);
    padding: 14px
}

.label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase
}

.value {
    font-size: 22px;
    font-weight: 900;
    margin-top: 6px
}

    .value.warn {
        color: var(--warn)
    }

.note {
    font-size: 12px;
    color: var(--muted)
}

.section {
    margin-top: 18px
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center
}

.section h3 {
    margin: 0;
    font-size: 17px
}

.badge {
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800
}

    .badge.warn {
        background: #fff7ed;
        color: var(--warn);
        border: 1px solid #fed7aa
    }

.cap-block {
    background: #fff7ed;
    border-color: #fed7aa;
    color: var(--warn);
    font-weight: 800
}

.grid {
    display: grid;
    grid-template-columns: repeat(12,1fr);
    gap: 14px
}

.field {
    grid-column: span 12;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.s2 {
    grid-column: span 2
}

.s3 {
    grid-column: span 3
}

.s4 {
    grid-column: span 4
}

.s6 {
    grid-column: span 6
}

.field label, .group-label {
    font-size: 13px;
    font-weight: 800
}

.hint {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
    margin: 0 0 4px 0;
    font-weight: 600
}

.control {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cdd5df;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px
}

textarea.control {
    min-height: 86px
}

.control[readonly] {
    background: var(--soft)
}

.choice {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 42px;
    border: 1px solid #cdd5df;
    border-radius: 12px;
    background: #fff;
    padding: 8px 10px
}

.money {
    display: flex;
    gap: 8px;
    align-items: center
}

    .money span {
        font-weight: 900;
        color: var(--muted)
    }

.req {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    margin-top: 8px
}

    .req.units {
        grid-template-columns: 1.3fr .75fr .85fr 1fr
    }

.unit-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px
}

.unit-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase
}

.liability-list, .income-list {
    display: grid;
    gap: 10px
}

.liability-row, .income-row {
    display: grid;
    grid-template-columns: 220px 1fr 1fr;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px
}

.liability-label, .income-label {
    font-size: 13px;
    font-weight: 800
}

    .liability-label small, .income-label small {
        display: block;
        font-size: 11px;
        font-weight: 600;
        color: var(--muted);
        margin-top: 3px
    }

.liability-row.full, .income-row.full {
    grid-template-columns: 220px 1fr
}

.liability-row.is-hidden, .income-row.is-hidden, .field.is-hidden, .hidden {
    display: none !important
}

.footer {
    border-top: 1px solid var(--border);
    border-bottom: 0;
    align-items: center
}

.footer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.success {
    background: #ecfdf3;
    border: 1px solid #a7f3d0;
    color: var(--good);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 18px
}

@media(max-width:900px) {
    .summary {
        grid-template-columns: repeat(2,1fr)
    }

    .s2, .s3, .s4, .s6 {
        grid-column: span 12
    }

    .req, .req.units, .liability-row, .liability-row.full, .income-row, .income-row.full {
        grid-template-columns: 1fr
    }

    .footer {
        flex-direction: column;
        align-items: stretch
    }
}

@media(max-width:650px) {
    .summary {
        grid-template-columns: 1fr
    }

    .hero h1 {
        font-size: 32px
    }

    .modal {
        padding: 10px
    }
}

/* Alignment refinements */
.field {
    justify-content: flex-start
}

.grid.align-row .field {
    min-height: 72px
}

    .grid.align-row .field label {
        min-height: 16px
    }

.grid.align-row .control, .grid.align-row .choice {
    margin-top: auto
}

.compact-row .field {
    min-height: 64px
}

    .compact-row .field label {
        min-height: 16px
    }

.compact-row .control, .compact-row .choice {
    margin-top: auto
}


.request-builder {
    display: grid;
    gap: 12px
}

.request-row {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px
}

.request-top {
    display: grid;
    grid-template-columns: 1fr 1fr 140px;
    gap: 12px;
    align-items: end
}

.category-choice {
    align-items: flex-start
}

.request-detail {
    display: grid;
    grid-template-columns: repeat(12,1fr);
    gap: 12px;
    margin-top: 12px
}

    .request-detail .field {
        grid-column: span 4
    }

        .request-detail .field.wide {
            grid-column: span 8
        }

        .request-detail .field.full {
            grid-column: span 12
        }

.request-total {
    font-weight: 900;
    font-size: 16px;
    text-align: right
}

.request-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px
}

@media(max-width:900px) {
    .request-top, .request-detail {
        grid-template-columns: 1fr
    }

        .request-detail .field, .request-detail .field.wide, .request-detail .field.full {
            grid-column: span 1
        }

    .request-total {
        text-align: left
    }
}


.burden-box {
    grid-column: span 12;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    margin-top: 4px
}

.burden-grid {
    display: grid;
    grid-template-columns: repeat(12,1fr);
    gap: 12px
}

    .burden-grid .field {
        grid-column: span 3
    }

        .burden-grid .field.wide {
            grid-column: span 6
        }

.resolution-note {
    font-size: 12px;
    font-weight: 800;
    margin-top: 8px
}

@media(max-width:900px) {
    .burden-grid {
        grid-template-columns: 1fr
    }

        .burden-grid .field, .burden-grid .field.wide {
            grid-column: span 1
        }
}

.payment-info-box {
    background: #fff;
    border-color: #cdd5df;
    padding: 14px
}

    .payment-info-box > strong {
        display: block;
        margin-bottom: 4px
    }

    .payment-info-box > .hint {
        margin-bottom: 12px
    }

    .payment-info-box .burden-grid {
        align-items: start
    }

    .payment-info-box .field {
        grid-column: span 6;
        min-height: auto
    }

        .payment-info-box .field.full, .payment-info-box .payment-payee-field, .payment-info-box .payment-w9-field {
            grid-column: span 12
        }

    .payment-info-box .choice {
        align-items: stretch;
        gap: 8px;
        background: #f8fafc;
        padding: 6px
    }

        .payment-info-box .choice label {
            display: flex;
            align-items: center;
            gap: 7px;
            min-height: 34px;
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: #fff;
            line-height: 1.25
        }

    .payment-info-box .field.full .choice label {
        flex: 1 1 180px
    }

    .payment-info-box .payment-method-field .choice label, .payment-info-box .payment-provider-field .choice label {
        flex: 1 1 90px
    }

    .payment-info-box .attachment-upload {
        background: #fff
    }

    /* [2026-09-03 KLS] Item 1 - the "Other" payee's mailing address, nested under the payee name
       field so both show/hide together in togglePaymentDependency(). */
    .payee-address-fields {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px
    }

        .payee-address-fields input {
            flex: 1 1 140px
        }

@media(max-width:900px) {
    .payment-info-box .field, .payment-info-box .field.full, .payment-info-box .payment-payee-field, .payment-info-box .payment-w9-field {
        grid-column: span 1
    }

    .payment-info-box .choice label {
        flex: 1 1 100%
    }
}


.summary.summary-three {
    grid-template-columns: repeat(3,minmax(180px,1fr));
    max-width: 860px
}

@media(max-width:900px) {
    .summary.summary-three {
        grid-template-columns: 1fr;
        max-width: none
    }
}

.attachment-list {
    display: grid;
    gap: 12px
}

.attachment-upload {
    display: grid;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px
}

    .attachment-upload label {
        font-size: 13px;
        font-weight: 800
    }

    .attachment-upload input[type=file] {
        padding: 9px;
        background: var(--soft)
    }

.attachment-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 6px 5px 10px;
    font-size: 12.5px;
    font-weight: 700
}

.attachment-remove {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 50%
}

    .attachment-remove:hover {
        background: #e7edf0;
        color: var(--text)
    }

.eligibility-warning {
    grid-column: span 12;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: var(--warn);
    border-radius: 14px;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45
}

/* Implementation view: open directly into the application instead of the former Region 5 workflow entry page. */
.modal {
    display: block;
    position: relative;
    inset: auto;
    background: var(--bg);
    z-index: auto;
    padding: 24px;
    overflow: visible;
    min-height: 100vh
}

    .modal.open {
        display: block
    }

.dialog {
    margin: 0 auto
}

@media(max-width:650px) {
    .modal {
        padding: 10px
    }
}

.compact-checklist {
    grid-column: span 12;
    display: grid;
    grid-template-columns: repeat(2,minmax(260px,1fr));
    gap: 6px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px
}

.compact-option {
    display: grid;
    gap: 5px;
    padding: 3px 0
}

    .compact-option > label {
        font-size: 13px;
        font-weight: 800;
        display: flex;
        gap: 8px;
        align-items: flex-start;
        line-height: 1.3
    }

.compact-detail {
    display: none;
    min-height: 38px;
    margin-left: 24px
}

.compact-option.active .compact-detail {
    display: block
}

@media(max-width:900px) {
    .compact-checklist {
        grid-template-columns: 1fr
    }
}

/* [2026-08-18 MKO] Glitch #538 - consumer e-signature on the public application, replacing the
   typed "Consumer Signature" text box. Hard-coded design-spec colors only (this page is public
   and standalone, outside the Theme table), so these belong here and not in Themes.css. */

.signature-field {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px
}

.signature-pad-wrap {
    position: relative;
    background: var(--surface);
    border: 1px solid #cdd5df;
    border-radius: 12px;
    padding: 8px 12px 22px
}

/* touch-action:none stops a drag on the canvas scrolling the page on tablets. */
.signature-canvas {
    display: block;
    width: 100%;
    height: 160px;
    touch-action: none;
    cursor: crosshair
}

.signature-baseline {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 14px;
    border-top: 1px solid #9aa5b5
}

.signature-meta {
    display: grid;
    grid-template-columns: repeat(12,1fr);
    gap: 14px;
    margin-top: 12px
}

.signature-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px
}

.signature-status {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--good);
    min-height: 16px
}

    .signature-status.is-error {
        color: var(--warn)
    }

/* Signed state: the pad is frozen and the whole application reads as locked. */
.is-signed-locked .signature-canvas {
    cursor: default
}

.is-signed-locked .signature-pad-wrap {
    background: var(--soft)
}

.is-signed-locked .control:disabled,
.is-signed-locked .control[disabled] {
    background: var(--soft);
    color: var(--text);
    opacity: 1
}

.signature-lock-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: var(--good);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 18px;
    font-weight: 700
}

@media(max-width:900px) {
    .signature-meta {
        grid-template-columns: 1fr
    }

    .signature-meta .field {
        grid-column: span 1
    }
}
