:root {
    color-scheme: light;
    --ink: #102a43;
    --muted: #61788f;
    --line: #d7e5f1;
    --paper: #ffffff;
    --canvas: #f5f8fb;
    --primary: #1268b3;
    --primary-dark: #083b73;
    --primary-soft: #eaf4fc;
    --accent: #f0b429;
    --accent-soft: #fff6da;
    --warn: #c47f17;
    --info: #2f80c5;
}

html,
body {
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        linear-gradient(180deg, #eef7fd 0, #ffffff 17rem, var(--canvas) 17rem),
        var(--canvas);
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

.content {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.eyebrow {
    margin: 0 0 .35rem;
    color: var(--primary);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 780px;
    font-size: clamp(2rem, 3.7vw, 3.6rem);
    line-height: 1.02;
    color: #092f5b;
}

h2 {
    font-size: 1.1rem;
}

.lead {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.05rem;
}

.login-shell {
    position: relative;
    width: 100vw;
    min-height: calc(100vh - 4.25rem);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: grid;
    align-items: center;
    padding: 3rem max(1rem, calc((100vw - 1280px) / 2));
    background:
        linear-gradient(90deg, rgba(7, 38, 72, .86) 0%, rgba(7, 38, 72, .64) 45%, rgba(7, 38, 72, .22) 100%),
        var(--cover-image, linear-gradient(135deg, #eef7fd 0%, #ffffff 100%));
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.login-shell::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 7rem;
    background: linear-gradient(180deg, rgba(245, 248, 251, 0), #f5f8fb);
    pointer-events: none;
}

.cover-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.cover-video + .login-panel {
    z-index: 1;
}

.login-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 2.25rem;
    align-items: center;
    width: min(100%, 1280px);
    margin: 0 auto;
}

.login-panel > div:first-child {
    padding: 1rem 0;
    color: #ffffff;
}

.login-panel h1 {
    color: #ffffff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .24);
}

.login-panel .lead {
    color: rgba(255, 255, 255, .88);
}

.service-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    max-width: 760px;
    margin-top: 1.35rem;
}

.service-strip div {
    min-height: 5.2rem;
    padding: .95rem;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
}

.service-strip strong {
    display: block;
    margin-bottom: .3rem;
    color: #0a4c86;
    font-size: 1rem;
}

.service-strip span {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}

.cover-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    max-width: 520px;
    margin-top: 1.6rem;
}

.cover-gallery img {
    width: 100%;
    height: 8rem;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(18, 104, 179, .22);
    box-shadow: 0 18px 40px rgba(15, 45, 80, .12);
}

.public-events-section {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 0 2.5rem;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 1.35rem;
}

.section-heading h2 {
    margin-bottom: .35rem;
    color: #092f5b;
    font-size: clamp(1.55rem, 2.4vw, 2.2rem);
}

.section-heading p {
    color: var(--muted);
}

.public-events-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}

.public-event-card {
    display: flex;
    flex-direction: column;
    flex: 0 1 calc((100% - 2rem) / 3);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(12, 48, 87, .07);
}

.public-event-card img,
.event-image-placeholder {
    width: 100%;
    height: 12.5rem;
}

.public-event-card img {
    display: block;
    object-fit: cover;
}

.event-image-placeholder {
    display: grid;
    place-items: center;
    color: #0a4c86;
    background:
        linear-gradient(135deg, rgba(18, 104, 179, .12), rgba(240, 180, 41, .16)),
        #f7fbff;
    font-weight: 900;
}

.public-event-card > div:last-child {
    display: grid;
    align-content: start;
    flex: 1;
    padding: 1rem;
}

.event-badge {
    display: inline-flex;
    margin-bottom: .65rem;
    padding: .3rem .5rem;
    border-radius: 6px;
    color: #0a4c86;
    background: var(--primary-soft);
    font-size: .75rem;
    font-weight: 900;
}

.public-event-card h3 {
    margin-bottom: .45rem;
    color: #102a43;
    font-size: 1.05rem;
}

.public-event-card p {
    margin-bottom: .35rem;
    color: #40536a;
    font-weight: 800;
}

.public-event-card small {
    color: var(--muted);
    font-weight: 700;
}

.empty-public-events {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #ffffff;
}

.site-footer {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1rem;
    width: 100vw;
    margin: 1rem calc(50% - 50vw) -2rem;
    padding: 1.5rem max(1rem, calc((100vw - 1280px) / 2));
    color: #d9e8f6;
    background: #083b73;
}

.site-footer div {
    display: grid;
    gap: .25rem;
}

.site-footer strong {
    color: #ffffff;
}

.site-footer span {
    color: #b8cde1;
    font-size: .86rem;
    font-weight: 700;
}

.login-card,
.form-panel,
.alerts-panel,
.schedule-panel,
.metric {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(12, 48, 87, .07);
}

.login-card,
.form-panel,
.alerts-panel {
    padding: 1.35rem;
}

.login-card {
    border-top: 5px solid var(--primary);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
}

.login-helper {
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: .9rem;
}

label {
    display: grid;
    gap: .4rem;
    margin-bottom: .85rem;
    color: #25364c;
    font-size: .9rem;
    font-weight: 700;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.checkbox-field input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--primary);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #c9d8e7;
    border-radius: 6px;
    padding: .72rem .78rem;
    color: var(--ink);
    background: #fbfdff;
}

textarea {
    resize: vertical;
}

input[type="file"] {
    padding: .58rem;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: .75rem;
    border: 0;
    border-radius: 5px;
    padding: .55rem .8rem;
    color: #ffffff;
    background: var(--primary);
    cursor: pointer;
    font-weight: 800;
}

.file-helper {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: -.35rem 0 .9rem;
    color: var(--muted);
    font-size: .82rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(15, 95, 168, .16);
    border-color: var(--primary);
}

.primary-action,
.secondary-action,
.danger-action,
.ghost-action {
    min-height: 2.65rem;
    border-radius: 6px;
    padding: .65rem .9rem;
    cursor: pointer;
    font-weight: 800;
}

.primary-action {
    width: 100%;
    color: #fff;
    background: linear-gradient(180deg, #1774bf, var(--primary));
}

.primary-action:hover {
    background: var(--primary-dark);
}

.secondary-action {
    color: #0a4c86;
    background: #eaf4fc;
    border: 1px solid #cfe3f5;
}

.danger-action {
    color: #8a1f11;
    background: #fdebe7;
    border: 1px solid #f4c4bc;
}

.danger-action:hover {
    color: #ffffff;
    background: #b42318;
}

.full-action {
    width: 100%;
}

.ghost-action {
    color: var(--ink);
    background: #edf3f8;
    text-align: left;
}

.demo-users {
    display: grid;
    gap: .5rem;
    margin-top: 1rem;
}

.demo-users small {
    color: var(--muted);
}

.workspace-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding: 1.35rem;
    border: 1px solid #d4e5f4;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #ffffff 0%, #eef7fd 100%);
    box-shadow: 0 14px 32px rgba(12, 48, 87, .07);
}

.user-pill {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .55rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    white-space: nowrap;
}

.user-pill span {
    padding-left: .5rem;
    font-weight: 800;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric {
    padding: 1rem;
    border-top: 4px solid var(--primary);
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.metric strong {
    display: block;
    margin-top: .25rem;
    font-size: 2rem;
    color: #092f5b;
}

.app-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1rem;
    align-items: start;
}

.schedule-panel {
    padding: 1.15rem;
}

.panel-heading {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.panel-note {
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: .9rem;
}

.panel-heading select {
    max-width: 230px;
}

.timeline {
    display: grid;
    gap: .75rem;
}

.event-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #dbe6f1;
    border-left: 5px solid var(--venue-color);
    border-radius: 8px;
    background: #fcfdff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.event-row:hover {
    border-color: #b8d5ed;
    box-shadow: 0 10px 24px rgba(12, 48, 87, .08);
    transform: translateY(-1px);
}

.event-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
}

.event-actions .secondary-action,
.event-actions .danger-action,
.event-actions .ghost-action {
    min-height: 2.35rem;
    padding: .5rem .65rem;
}

.date-box {
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--primary-soft);
    aspect-ratio: 1;
    color: #0a4c86;
}

.date-box span {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1;
}

.date-box small {
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase;
}

.event-title-line {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    justify-content: space-between;
}

.event-title-line h3 {
    margin-bottom: .25rem;
    font-size: 1rem;
}

.event-title-line span {
    padding: .25rem .45rem;
    border-radius: 6px;
    color: #0a4c86;
    background: var(--primary-soft);
    font-size: .74rem;
    font-weight: 800;
}

.event-main p {
    margin-bottom: .2rem;
    color: #35475e;
}

.event-main small {
    color: var(--muted);
}

.side-stack {
    display: grid;
    gap: 1rem;
}

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

.form-message {
    margin: .85rem 0 0;
    padding: .75rem;
    border-radius: 6px;
    font-weight: 700;
}

.email-notice {
    margin: .7rem 0 0;
    padding: .7rem .75rem;
    border: 1px solid #cfe0f2;
    border-radius: 6px;
    color: #31506f;
    background: #f4f9fe;
    font-size: .86rem;
    font-weight: 700;
}

.form-message.success {
    color: #0b4f36;
    background: #e7f6ef;
}

.form-message.error {
    color: #7d2216;
    background: #fdebe7;
}

.alert-item {
    margin-bottom: .7rem;
    padding: .75rem;
    border-radius: 6px;
    background: #f7fbff;
    color: #25364c;
    border-left: 4px solid var(--primary);
}

.alert-item.warning {
    border-left-color: var(--warn);
}

.alert-item.info {
    border-left-color: var(--info);
}

.alert-item.success {
    border-left-color: var(--primary);
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8d6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}

@media (max-width: 1000px) {
    .login-panel,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .login-shell {
        background:
            linear-gradient(180deg, rgba(7, 38, 72, .84) 0%, rgba(7, 38, 72, .62) 58%, rgba(7, 38, 72, .35) 100%),
            var(--cover-image, linear-gradient(135deg, #eef7fd 0%, #ffffff 100%));
        background-size: cover;
        background-position: center;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-events-grid {
        display: flex;
    }

    .public-event-card {
        flex-basis: calc((100% - 1rem) / 2);
    }
}

@media (max-width: 640px) {
    .content {
        padding: 1rem !important;
    }

    .cover-gallery {
        grid-template-columns: 1fr;
    }

    .service-strip {
        grid-template-columns: 1fr;
    }

    .public-events-grid,
    .site-footer {
        grid-template-columns: 1fr;
    }

    .public-event-card {
        flex-basis: 100%;
    }

    .cover-gallery img {
        height: 10rem;
    }

    .workspace-header,
    .panel-heading,
    .event-title-line {
        flex-direction: column;
        align-items: stretch;
    }

    .metrics-grid,
    .form-columns {
        grid-template-columns: 1fr;
    }

    .event-row {
        grid-template-columns: 58px minmax(0, 1fr);
        align-items: start;
    }

    .event-actions,
    .event-row .secondary-action,
    .event-row .danger-action,
    .event-row .ghost-action {
        grid-column: 1 / -1;
        width: 100%;
    }
}
