:root {
    --km-ink: #172033;
    --km-muted: #667085;
    --km-border: #dfe3e8;
    --km-surface: #ffffff;
    --km-background: #f2f4f7;
    --km-primary: #176b9b;
    --km-primary-dark: #0e557f;
    --km-success: #16845b;
    --bs-border-radius: .45rem;
    --bs-border-radius-sm: .35rem;
    --bs-border-radius-lg: .65rem;
}

body {
    min-height: 100vh;
    background: var(--km-background);
    color: var(--km-ink);
}

.card {
    border-color: var(--km-border);
    border-radius: .65rem;
    box-shadow: 0 6px 22px rgba(23, 32, 51, .06);
}

.btn {
    min-height: 44px;
    padding: .6rem 1rem;
    border-radius: .45rem;
    font-weight: 650;
}

.btn-primary {
    --bs-btn-bg: var(--km-primary);
    --bs-btn-border-color: var(--km-primary);
    --bs-btn-hover-bg: var(--km-primary-dark);
    --bs-btn-hover-border-color: var(--km-primary-dark);
    --bs-btn-active-bg: var(--km-primary-dark);
    --bs-btn-active-border-color: var(--km-primary-dark);
}

.btn-success {
    --bs-btn-bg: var(--km-success);
    --bs-btn-border-color: var(--km-success);
    --bs-btn-hover-bg: #116b4a;
    --bs-btn-hover-border-color: #116b4a;
}

.form-control,
.form-select {
    min-height: 46px;
    border-color: #cbd1d8;
    border-radius: .4rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--km-primary);
    box-shadow: 0 0 0 .2rem rgba(23, 107, 155, .14);
}

.form-label {
    margin-bottom: .4rem;
    color: #354052;
    font-size: .93rem;
    font-weight: 650;
}

.submission-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background-color: var(--km-background);
    background-image:
        radial-gradient(circle at 10% 0, rgba(23, 107, 155, .07), transparent 30rem),
        url("../images/submission-pattern-vqVlh5I.svg");
    background-repeat: no-repeat, repeat;
    background-size: auto, 360px 360px;
}

.submission-shell {
    max-width: 980px;
}

main.submission-shell {
    width: 100%;
}

.submission-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .75rem .9rem;
    border: 1px solid var(--km-border);
    border-radius: .65rem;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 6px 22px rgba(23, 32, 51, .05);
    backdrop-filter: blur(3px);
}

.submission-toolbar h1 {
    margin: 0;
    color: #263246;
    font-size: clamp(1.35rem, 2.8vw, 1.8rem);
    font-weight: 750;
    letter-spacing: -.02em;
}

.submission-toolbar__actions {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.submission-toolbar__actions .btn:not(:hover):not(:focus-visible) {
    background: #f8fafb;
}

.submission-toolbar__flag {
    display: inline-block;
    width: 1.55rem;
    height: 1rem;
    margin-right: .15rem;
    border: 1px solid rgba(23, 32, 51, .18);
    border-radius: .15rem;
    box-shadow: 0 1px 2px rgba(23, 32, 51, .12);
    object-fit: cover;
}

.submission-wizard,
.confirmation-card {
    overflow: hidden;
    border: 1px solid var(--km-border);
    border-radius: .75rem;
    background: var(--km-surface);
    box-shadow: 0 14px 40px rgba(23, 32, 51, .08);
}

.wizard-progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin: 0;
    padding: 1.2rem 1.5rem;
    border: 1px solid var(--km-border);
    border-bottom: 0;
    border-radius: .75rem .75rem 0 0;
    background: #f8fafb;
}

.submission-wizard > .wizard-progress {
    border: 0;
    border-bottom: 1px solid var(--km-border);
    border-radius: 0;
}

.wizard-progress__step {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #7b8492;
    font-size: .9rem;
    font-weight: 650;
}

.wizard-progress__step:not(:last-child)::after {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: calc(2rem + .65rem);
    width: calc(100% - 2rem);
    height: 2px;
    background: #dfe3e8;
    content: '';
}

.wizard-progress__number {
    display: inline-flex;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 2px solid #c8ced6;
    border-radius: 50%;
    background: #ffffff;
    color: #667085;
}

.wizard-progress__label {
    position: relative;
    z-index: 1;
    margin-left: -.3rem;
    padding: 0 .3rem;
    background: #f8fafb;
}

.wizard-progress__step.is-active {
    color: var(--km-primary-dark);
}

.wizard-progress__step.is-active .wizard-progress__number {
    border-color: var(--km-primary);
    background: var(--km-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(23, 107, 155, .12);
}

.wizard-progress__step.is-complete .wizard-progress__number {
    border-color: var(--km-success);
    background: var(--km-success);
    color: #ffffff;
}

.wizard-progress__step.is-complete::after {
    background: var(--km-success);
}

.wizard-panel {
    padding: clamp(1.35rem, 4vw, 3rem);
}

.wizard-title-image {
    /*height: clamp(130px, 21vw, 195px);*/
    margin: clamp(-3rem, -4vw, -1.35rem) clamp(-3rem, -4vw, -1.35rem) 1.5rem;
    overflow: hidden;
    border-bottom: 1px solid var(--km-border);
}

.wizard-title-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 44%;
}

.wizard-enhanced .wizard-panel[hidden] {
    display: none !important;
}

.wizard-panel__icon,
.confirmation-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 1rem;
    border-radius: .65rem;
    background: rgba(23, 107, 155, .1);
    color: var(--km-primary);
    font-size: 1.5rem;
}

.wizard-warning-heading {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.wizard-panel__icon--warning {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    border: 1px solid #f2c94c;
    border-radius: 50%;
    background: #fff4c2;
    color: #9a6700;
    font-size: 1.35rem;
    font-weight: 800;
}

.wizard-panel h1.wizard-warning-title {
    color: #b42318;
    font-size: clamp(1.35rem, 2.6vw, 1.7rem);
    letter-spacing: -.015em;
}

.wizard-panel__kicker,
.submission-summary__eyebrow,
.program-item__eyebrow {
    margin: 0 0 .35rem;
    color: var(--km-primary-dark);
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.wizard-panel__kicker--footer {
    margin: 1.5rem 0 0;
    text-align: right;
}

.wizard-panel__kicker--footer + .wizard-actions {
    margin-top: .45rem;
}

.wizard-panel h1,
.confirmation-card h1 {
    margin: 0;
    font-size: clamp(1.65rem, 3.3vw, 2.25rem);
    font-weight: 750;
    letter-spacing: -.025em;
}

.wizard-panel__intro {
    margin: .65rem 0 1.5rem;
    color: var(--km-muted);
    font-size: 1.05rem;
}

.wizard-panel__intro--with-language-switch {
    margin-bottom: .65rem;
}

.wizard-panel__intro--with-language-switch a {
    margin-left: .25rem;
    font-weight: 600;
}

.wizard-edit-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin: 0 0 1.5rem;
    color: var(--km-muted);
    font-size: 1.05rem;
}

.wizard-edit-hint a {
    font-weight: 650;
}

.notice-box {
    padding: 1.15rem 1.25rem;
    border-left: 4px solid var(--km-primary);
    border-radius: .45rem;
    background: #eef6fa;
}

.notice-box li + li {
    margin-top: .65rem;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #edf0f3;
}

.wizard-actions--end {
    justify-content: flex-end;
}

.details-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

.details-section {
    min-width: 0;
    padding: 1.2rem;
    border: 1px solid var(--km-border);
    border-radius: .55rem;
    background: #fbfcfd;
}

.details-section legend {
    float: none;
    width: auto;
    margin-bottom: 1rem;
    color: #263246;
    font-size: 1.05rem;
    font-weight: 750;
}

.details-section legend i {
    margin-right: .3rem;
    color: var(--km-primary);
}

.details-section__note {
    margin: .25rem 0 0;
    color: #7b8492;
    font-size: .82rem;
}

.program-item {
    padding: 1.25rem;
    border: 1px solid var(--km-border);
    border-radius: .6rem;
    background: #fbfcfd;
}

.program-item + .program-item {
    margin-top: 1rem;
}

.program-item__header,
.submission-summary__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.program-item__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 750;
}

.upload-field {
    padding: 1rem;
    border: 1px dashed #aeb9c5;
    border-radius: .5rem;
    background: #ffffff;
}

.upload-field__label {
    margin-bottom: .15rem;
    font-weight: 750;
}

.upload-field__help {
    margin-bottom: .65rem;
    color: var(--km-muted);
    font-size: .9rem;
}

.dropzone-container {
    min-height: 82px !important;
    border-radius: .4rem !important;
}

.add-program {
    width: 100%;
    margin-top: 1rem;
    border-style: dashed;
}

.spin {
    display: inline-block;
    animation: km-spin .9s linear infinite;
}

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

.confirmation-card {
    border-radius: 0 0 .75rem .75rem;
}

.confirmation-card__header {
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border-bottom: 1px solid #d7e9e1;
    background: #eef8f4;
    text-align: center;
}

.confirmation-card__icon {
    border-radius: 50%;
    background: var(--km-success);
    color: #ffffff;
}

.confirmation-card__header p:last-child {
    margin: .65rem 0 0;
    color: #456156;
}

.confirmation-card__header-description {
    margin: .65rem 0 0;
    color: #456156;
}

.confirmation-card__header-actions {
    margin-top: 1rem;
}

.submission-summary {
    padding: clamp(1.35rem, 4vw, 2.5rem);
}

.submission-summary h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 750;
}

.submission-code {
    max-width: 360px;
    padding: .65rem .8rem;
    border: 1px solid var(--km-border);
    border-radius: .45rem;
    background: #f7f9fb;
    text-align: right;
}

.submission-code span,
.submission-code strong {
    display: block;
}

.submission-code span {
    color: var(--km-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.submission-code strong {
    font-size: .88rem;
    overflow-wrap: anywhere;
}

.summary-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 2rem;
    border-top: 1px solid #edf0f3;
}

.summary-details > div {
    padding: .85rem 0;
    border-bottom: 1px solid #edf0f3;
}

.summary-details dt {
    color: var(--km-muted);
    font-size: .82rem;
    font-weight: 650;
}

.summary-details dd {
    margin: .15rem 0 0;
    font-weight: 650;
}

.submitted-programs h3 {
    margin-bottom: .8rem;
    font-size: 1.1rem;
    font-weight: 750;
}

.submitted-program {
    display: flex;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--km-border);
    border-radius: .5rem;
    background: #fbfcfd;
}

.submitted-program + .submitted-program {
    margin-top: .65rem;
}

.submitted-program__number {
    display: flex;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e7f2f8;
    color: var(--km-primary-dark);
    font-weight: 750;
}

.submitted-program__content strong,
.submitted-program__content span {
    display: block;
}

.submitted-program__content span {
    color: var(--km-muted);
    font-size: .9rem;
}

.submitted-program__content p {
    margin: .45rem 0 0;
}

.confirmation-card__footer {
    padding: 1.25rem clamp(1.35rem, 4vw, 2.5rem);
    border-top: 1px solid var(--km-border);
    background: #f8fafb;
    text-align: center;
}

.confirmation-card__footer .wizard-panel__kicker--footer {
    margin-top: 0;
    margin-bottom: .65rem;
}

.manage-card h2 {
    margin: 0;
    font-size: 1.2rem;
}

.manage-list {
    display: grid;
    gap: 1rem;
}

.manage-submission {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid var(--km-border);
    border-radius: .55rem;
    background: #fbfcfd;
}

.manage-submission p {
    margin: .25rem 0 0;
    color: var(--km-muted);
    font-size: .9rem;
}

.manage-submission__actions,
.manage-footer {
    display: flex;
    justify-content: center;
    gap: .65rem;
}

.manage-submission__actions--stacked {
    align-items: center;
    flex-direction: column;
}

.manage-delete-form {
    margin: 0;
    text-align: center;
}

.manage-delete-link {
    color: #b02a37;
    font-size: .9rem;
    text-decoration: underline;
    text-underline-offset: .15em;
}

.manage-delete-link:hover,
.manage-delete-link:focus-visible {
    color: #842029;
}

.manage-program {
    align-items: center;
}

.manage-program .submitted-program__content {
    flex: 1 1 auto;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.home-action-card,
.information-card {
    border: 1px solid var(--km-border);
    border-radius: .75rem;
    background: var(--km-surface);
    box-shadow: 0 14px 40px rgba(23, 32, 51, .08);
}

.home-action-card {
    display: flex;
    min-height: 320px;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(1.5rem, 4vw, 2.4rem);
}

.home-action-card--standalone {
    width: 100%;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
}

.home-action-card__title-image {
    align-self: stretch;
    margin: clamp(-2.4rem, -4vw, -1.5rem) clamp(-2.4rem, -4vw, -1.5rem) 1.5rem;
}

.home-action-card__icon,
.information-card__icon {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: .6rem;
    background: #e7f2f8;
    color: var(--km-primary-dark);
    font-size: 1.35rem;
}

.home-action-card__heading {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.home-action-card__heading .home-action-card__icon {
    flex: 0 0 3rem;
    margin-bottom: 0;
}

.home-action-card__icon--manage {
    background: #e8f5ef;
    color: var(--km-success);
}

.home-action-card h1,
.home-action-card h2,
.information-card h1 {
    margin: 0;
    font-size: clamp(1.4rem, 2.8vw, 1.8rem);
    font-weight: 750;
    letter-spacing: -.02em;
}

.home-action-card h1,
.home-action-card h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}

.home-action-card > p {
    margin: .65rem 0 1.5rem;
    color: var(--km-muted);
    font-size: 1.0625rem;
    line-height: 1.55;
}

.event-entry-form {
    display: flex;
    width: 100%;
    gap: .65rem;
    margin-top: auto;
}

.event-entry-form__field {
    flex: 1 1 auto;
}

.event-entry-form__field .invalid-feedback,
.event-entry-form__field ul {
    margin-bottom: 0;
}

.home-access-form {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: .65rem;
    margin-top: auto;
}

.home-access-form__field {
    flex: 1 1 auto;
}

.information-card {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 3rem);
}

.information-card--wide {
    max-width: 820px;
}

.information-card--full,
.access-request-card {
    width: 100%;
    max-width: none;
}

.submission-footer {
    padding: 0 0 1.5rem;
    color: #7b8492;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.submission-footer a {
    color: var(--km-primary-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .15em;
}

.information-card__intro {
    margin: .65rem 0 1.75rem;
    color: var(--km-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.information-card__icon--warning {
    background: #fff4d6;
    color: #9a6700;
}

.information-card__heading {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.information-card__heading .information-card__icon {
    flex: 0 0 3rem;
    margin-bottom: 0;
}

.contact-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.contact-option {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem;
    border: 1px solid var(--km-border);
    border-radius: .55rem;
    background: #f8fafb;
    color: var(--km-ink);
    text-decoration: none;
}

.contact-option:hover,
.contact-option:focus-visible {
    border-color: var(--km-primary);
    background: #eef6fa;
    color: var(--km-primary-dark);
}

.contact-option > i {
    color: var(--km-primary);
    font-size: 1.25rem;
}

.contact-option small,
.contact-option span {
    display: block;
}

.contact-option small {
    color: var(--km-muted);
    font-size: .78rem;
    font-weight: 650;
}

.information-card__credit {
    margin: 2rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--km-border);
    color: var(--km-muted);
    font-size: 1rem;
    text-align: center;
}

.information-card__credit a {
    color: var(--km-primary-dark);
    font-weight: 700;
}

.access-request-next-step {
    margin: -1rem 0 1.75rem;
    color: var(--km-ink);
    font-weight: 650;
}

.maintenance-image {
    max-height: 400px;
    object-fit: cover;
}

@media (max-width: 767.98px) {
    .submission-page {
        min-height: 100vh;
    }

    .wizard-progress {
        gap: .2rem;
        padding: .9rem .75rem;
    }

    .wizard-progress__step {
        flex-direction: column;
        gap: .25rem;
        text-align: center;
    }

    .wizard-progress__step:not(:last-child)::after {
        top: 1rem;
        left: calc(50% + 1rem);
        width: calc(100% - 1.5rem);
    }

    .wizard-progress__label {
        font-size: .72rem;
    }

    .details-grid,
    .summary-details,
    .home-action-grid,
    .contact-options {
        grid-template-columns: 1fr;
    }

    .home-action-card {
        min-height: 0;
    }

    .wizard-actions {
        flex-direction: column-reverse;
    }

    .wizard-actions .btn {
        width: 100%;
    }

    .program-item__header,
    .submission-summary__heading,
    .manage-submission,
    .manage-program {
        flex-direction: column;
        align-items: stretch;
    }

    .remove-program,
    .submission-code,
    .manage-submission__actions,
    .manage-footer {
        width: 100%;
        text-align: left;
    }

    .manage-submission__actions,
    .manage-footer {
        flex-direction: column;
    }

    .manage-submission__actions--stacked {
        align-items: stretch;
    }

}

@media (max-width: 575.98px) {
    .submission-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .submission-toolbar__actions .btn {
        flex: 1 1 0;
    }

    .event-entry-form,
    .home-access-form {
        flex-direction: column;
    }

    .event-entry-form .btn,
    .home-access-form .btn,
    .home-access-form__field {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
