:root {
    --app-bg: #f3f6f2;
    --app-surface: #ffffff;
    --app-surface-soft: #eef5ee;
    --app-ink: #172018;
    --app-muted: #647067;
    --app-border: #dce4dc;
    --app-primary: #1f6b3a;
    --app-primary-dark: #15502b;
    --app-primary-soft: #e4f2e7;
    --app-warning: #995d17;
    --app-danger: #b42318;
    --app-shadow: 0 16px 35px rgba(24, 39, 28, .08);
}

html {
    position: relative;
    min-height: 100%;
}

body.app-shell {
    min-height: 100vh;
    margin: 0;
    color: var(--app-ink);
    background:
        radial-gradient(circle at top right, rgba(52, 121, 96, .12), transparent 26%),
        linear-gradient(180deg, #f8fbf8 0%, var(--app-bg) 100%);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: 0;
}

body.app-shell a {
    color: var(--app-primary);
}

body.app-shell a:hover,
body.app-shell a:focus {
    color: var(--app-primary-dark);
}

.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

.app-page-shell {
    min-height: calc(100vh - 105px);
    overflow-x: hidden;
}

.app-content-shell {
    max-width: 1180px;
    padding-top: 28px;
    padding-bottom: 32px;
}

.app-shell--embedded {
    background: #fff;
}

.app-shell--embedded .app-content-shell {
    padding-top: 12px;
}

.app-shell--login .app-content-shell {
    max-width: 900px;
}

.login-shell {
    min-height: 100vh;
    padding: 28px 0 56px;
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.login-brand img {
    width: min(210px, 48vw);
    height: auto;
    border-radius: 8px;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 8px 26px rgba(20, 37, 23, .06);
    backdrop-filter: blur(12px);
}

.app-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 96px;
    gap: 20px;
}

.app-topbar__brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.app-brand-logo {
    display: block;
    max-width: 360px;
    max-height: 76px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.app-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.app-topbar__account {
    min-width: 0;
    margin-left: auto;
    text-align: right;
}

.app-topbar__account-name {
    color: var(--app-ink);
    font-weight: 800;
    line-height: 1.25;
}

.app-topbar__account-email {
    color: var(--app-muted);
    font-size: .9rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-ink);
    font-weight: 600;
    text-decoration: none;
}

.app-link:hover,
.app-link:focus {
    background: var(--app-primary-soft);
    text-decoration: none;
}

.app-link--muted {
    color: var(--app-muted);
}

.app-footer {
    margin-top: 32px;
    border-top: 1px solid var(--app-border);
    background: rgba(255, 255, 255, .56);
}

.app-footer__inner {
    min-height: 42px;
}

.app-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
}

.application-hero {
    padding: 26px 30px;
    margin-bottom: 24px;
}

.application-hero h1,
.response-heading h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.16;
    font-weight: 700;
    letter-spacing: 0;
}

.application-subtitle,
.response-heading p,
.application-meta,
.application-card-description {
    color: var(--app-muted);
}

.application-message {
    margin-top: 16px;
    font-size: 1rem;
    line-height: 1.55;
}

.application-category-name {
    margin: 0 0 10px;
    color: var(--app-primary-dark);
    font-size: clamp(1.25rem, 2.4vw, 1.8rem);
    font-weight: 800;
    line-height: 1.2;
}

.application-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.auth-home {
    max-width: 680px;
    margin: 0 auto;
    padding: 32px;
    text-align: center;
}

.auth-home h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    line-height: 1.18;
    font-weight: 800;
}

.auth-home__actions {
    justify-content: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--app-primary);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.application-section {
    margin-top: 24px;
}

.section-title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.section-title-row h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 700;
}

.app-card-list {
    display: grid;
    gap: 14px;
}

.application-list-row,
.category-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.application-list-row--stacked {
    align-items: start;
}

.application-list-row--stacked .application-submissions {
    grid-column: 1 / -1;
    width: 100%;
}

.application-list-main h3,
.category-list-main h3 {
    margin: 0 0 6px;
    font-size: 1.16rem;
    line-height: 1.3;
}

.application-card-description {
    margin: 0;
    line-height: 1.5;
}

.application-list-actions,
.category-list-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 190px;
}

.application-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    font-size: .93rem;
}

.application-submissions {
    margin-top: 18px;
}

.application-submissions h4 {
    margin: 0;
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.application-submission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--app-border);
}

.application-submission-main p {
    margin: 0;
    color: var(--app-text);
    font-weight: 700;
    line-height: 1.4;
}

.application-submission-actions {
    min-width: 220px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: #f7f9f7;
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge--submitted {
    border-color: #b9dfc4;
    background: var(--app-primary-soft);
    color: var(--app-primary-dark);
}

.status-badge--progress {
    border-color: #bbd3e6;
    background: #e8f2f8;
    color: #24516f;
}

.status-badge--initiated {
    border-color: #efd0a2;
    background: #fff3df;
    color: var(--app-warning);
}

.app-btn,
.btn.app-btn,
.submit-navigation .btn {
    min-height: 42px;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 700;
    letter-spacing: 0;
}

.btn-primary.app-btn,
.submit-navigation .btn-primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

.btn-primary.app-btn:hover,
.btn-primary.app-btn:focus,
.submit-navigation .btn-primary:hover,
.submit-navigation .btn-primary:focus {
    border-color: var(--app-primary-dark);
    background: var(--app-primary-dark);
    color: #fff;
}

a.btn-primary.app-btn,
a.btn-primary.app-btn:visited,
a.btn-primary.app-btn:hover,
a.btn-primary.app-btn:focus {
    color: #fff;
}

.btn-outline-secondary.app-btn,
.submit-navigation .btn-outline-secondary {
    border-color: var(--app-border);
    color: var(--app-ink);
    background: var(--app-surface);
}

.app-alert {
    border-radius: 8px;
    text-align: center;
}

.confirmation-shell {
    display: flex;
    justify-content: center;
    padding: 28px 0 56px;
}

.confirmation-card {
    width: min(780px, 100%);
    padding: 34px;
    text-align: center;
}

.confirmation-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
    border-radius: 50%;
    border: 1px solid #b9dfc4;
    background: var(--app-primary-soft);
}

.confirmation-status span {
    display: block;
    width: 28px;
    height: 16px;
    border-bottom: 4px solid var(--app-primary);
    border-left: 4px solid var(--app-primary);
    transform: rotate(-45deg) translate(1px, -2px);
}

.confirmation-copy {
    max-width: 620px;
    margin: 0 auto;
}

.confirmation-eyebrow {
    margin: 0 0 8px;
    color: var(--app-primary-dark);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.confirmation-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    font-weight: 800;
}

.confirmation-lead {
    margin: 14px 0 0;
    color: var(--app-muted);
    font-size: 1.1rem;
    line-height: 1.55;
}

.confirmation-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin: 28px 0 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-border);
    text-align: left;
}

.confirmation-summary div {
    min-width: 0;
    padding: 16px;
    background: #fbfdfb;
}

.confirmation-summary dt {
    margin-bottom: 5px;
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.confirmation-summary dd {
    margin: 0;
    color: var(--app-ink);
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.confirmation-message {
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
    color: var(--app-ink);
    line-height: 1.6;
    text-align: left;
}

.confirmation-message > :first-child {
    margin-top: 0;
}

.confirmation-message > :last-child {
    margin-bottom: 0;
}

.confirmation-actions {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

.app-loading {
    margin: 0;
    padding: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(23, 32, 24, .68);
    z-index: 30001;
    display: none;
}

.app-loading__indicator {
    position: absolute;
    color: #fff;
    margin: auto;
    left: 0;
    right: 0;
    top: 20%;
    text-align: center;
    z-index: 1;
}

.response-heading {
    margin-bottom: 18px;
    text-align: center;
}

.question-form {
    display: grid;
    gap: 18px;
}

.question-form > hr {
    display: none;
}

.subHeader,
.form-section-header {
    width: 100%;
    border-radius: 8px;
    padding: 18px 22px;
    border: 1px solid rgba(23, 32, 24, .08);
    text-align: center;
}

.form-section-header h2,
.subHeader h4 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.32;
}

.form-section-description {
    margin-top: 8px;
    color: rgba(23, 32, 24, .74);
    line-height: 1.45;
}

.section-progress {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    min-height: 34px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--app-surface-soft);
    color: var(--app-primary-dark);
    font-weight: 700;
}

.question-block {
    padding: 20px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(24, 39, 28, .05);
}

.question-row {
    align-items: flex-start;
    row-gap: 12px;
}

.question-label {
    color: var(--app-ink);
    font-weight: 600;
    line-height: 1.5;
}

.question-label .required-mark {
    color: var(--app-danger);
    margin-left: 3px;
}

.question-help {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: .9rem;
    font-weight: 400;
}

.question-input {
    padding-bottom: 0;
}

.question-input .form-control,
.question-input input[type='text'],
.question-input input[type='number'],
.question-input input[type='tel'],
.question-input input[type='date'],
.question-input select,
.question-input textarea {
    max-width: 100%;
    border-radius: 8px;
    border-color: #cfd9cf;
}

.question-input textarea.form-control {
    min-height: 132px;
    resize: vertical;
}

.question-input input[type='file'] {
    width: 100%;
    padding: 10px;
    border: 1px solid #cfd9cf;
    border-radius: 8px;
    background: #fff;
}

.question-input .form-control:focus,
.question-input input:focus,
.question-input select:focus,
.question-input textarea:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 .18rem rgba(31, 107, 58, .16);
}

.field-validation-error,
.textarea-length-validation,
.checkbox-required-validation,
.radio-required-validation,
.file-upload-validation {
    display: block;
    margin-top: 6px;
    font-size: .9rem;
}

.textarea-length-count {
    margin-top: 6px;
}

.input-validation-error,
.question-input .is-invalid,
.question-block.question-invalid {
    border-color: var(--app-danger);
}

.radio-group,
.checkbox-group {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
}

.radio-group--invalid,
.checkbox-group--invalid {
    border-color: var(--app-danger);
    background: rgba(180, 35, 24, .04);
}

.radio-group .form-check,
.checkbox-group .form-check {
    margin-bottom: 6px;
}

.radio-group .form-check:last-child,
.checkbox-group .form-check:last-child {
    margin-bottom: 0;
}

.question-block.question-invalid {
    box-shadow: 0 0 0 .18rem rgba(180, 35, 24, .12);
}

.submit-navigation {
    max-width: 100%;
    margin-top: 10px;
    padding: 18px 0 2px;
}

.submit-navigation__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.submit-navigation__end {
    margin-left: auto;
}

input,
select,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
}

input[type='checkbox'],
input[type='radio'] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
}

div.container-center {
    width: 100%;
}

@media (max-width: 768px) {
    .app-content-shell {
        padding-top: 18px;
    }

    .app-topbar__inner {
        min-height: 78px;
    }

    .app-brand-logo {
        max-width: 235px;
        max-height: 62px;
    }

    .app-link {
        min-height: 38px;
        padding: 7px 10px;
    }

    .app-topbar__account {
        display: none;
    }

    .application-hero,
    .application-list-row,
    .category-list-row,
    .question-block {
        padding: 16px;
    }

    .application-list-row,
    .category-list-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .application-submission-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .application-list-actions,
    .category-list-actions {
        justify-content: space-between;
        width: 100%;
        min-width: 0;
    }

    .confirmation-card {
        padding: 24px 18px;
    }

    .confirmation-summary {
        grid-template-columns: 1fr;
    }

    .confirmation-actions .btn {
        width: 100%;
    }

    .submit-navigation__inner {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .submit-navigation__inner .btn,
    .submit-navigation__end {
        width: 100%;
    }
}
