:root {
    color-scheme: light;
    font-family: system-ui, sans-serif;
    color: #302028;
    background: #fffaf7;
    --berry: #691b36;
    --muted: #6e5961;
    --border: #ead9da;
}

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

.page {
    width: min(100% - 3rem, 65rem);
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    width: fit-content;
    padding: 2rem 0;
    font-size: .95rem;
    color: inherit;
    text-decoration: none;
}

.brand:hover strong { text-decoration: underline; }
.brand-mark { color: var(--berry); flex: none; }
.brand span { display: block; color: var(--muted); font-size: .83rem; }

.layout {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
    grid-template-areas: "event card" "certificate card";
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 1.25rem;
}

.event {
    grid-area: event;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 1.35rem;
    padding: 2rem;
    background: linear-gradient(125deg, #621632, #832b48);
    color: #fff7f3;
}

.event::before {
    content: "";
    position: absolute;
    z-index: -1;
    right: -7rem;
    bottom: -13rem;
    width: 23rem;
    height: 23rem;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, #f4bcc422 0 1px, transparent 1px 13px);
}

.eyebrow, figcaption {
    margin: 0;
    font-size: .74rem;
    font-weight: 750;
    letter-spacing: .095em;
    text-transform: uppercase;
}

.eyebrow { color: #ffd1d3; }

h1, h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.04;
}

h1 { margin: .95rem 0 1.4rem; font-size: clamp(2.4rem, 5.5vw, 4.3rem); }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); color: var(--berry); }

.event-date { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }
.event-date svg { flex: none; }

.card, .certificate {
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    background: #fff;
}

.card { grid-area: card; padding: clamp(1.4rem, 3.8vw, 2.35rem); }
.card p { margin: .7rem 0 1.4rem; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.card strong { color: #302028; }

.certificate { grid-area: certificate; margin: 0; padding: 1.05rem; }
figcaption { margin-bottom: .75rem; color: var(--berry); }
.certificate img { display: block; width: 100%; height: auto; border-radius: .45rem; }

form { display: grid; gap: 1rem; }
.field { display: grid; gap: .4rem; }
label { font-weight: 650; font-size: .9rem; }

input {
    width: 100%;
    min-height: 2.85rem;
    padding: .65rem .85rem;
    font: inherit;
    color: inherit;
    background: #fffcfa;
    border: 1px solid #d9c4c9;
    border-radius: .65rem;
}

input::placeholder { color: #7a666c; }
input[aria-invalid="true"] { border-color: #9f243b; }
.hint, .field-error { font-size: .8rem; }
.hint { color: var(--muted); }
.field-error, .card .notice { color: #8e1f36; }
.card .notice { padding: .7rem .8rem; border-radius: .55rem; background: #fff0f1; }
.card .notice-success { color: #296141; background: #edf5ee; }

.button {
    display: inline-flex;
    min-height: 3rem;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    border: 0;
    border-radius: .65rem;
    padding: .7rem 1.05rem;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    background: var(--berry);
    color: #fff;
}

form .button { margin-top: .3rem; width: 100%; justify-content: space-between; }
.button:hover { background: #4c1327; }
.button svg { flex: none; }
:focus-visible { outline: 3px solid #9e3856; outline-offset: 3px; }

.success-mark {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: #edf5ee;
    color: #296141;
}

.text-link { display: table; margin-top: 1.1rem; color: var(--berry); text-underline-offset: .2em; }
footer { padding: 1.4rem 0 2rem; font-size: .8rem; color: var(--muted); }

.installer { max-width: 38rem; padding-bottom: 2rem; }
.installer h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); color: var(--berry); }
.installer-connection { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5rem, 7rem); gap: .8rem; }

.admin-page { padding-bottom: 2rem; }
.admin-header, .admin-section-header, .admin-actions, .admin-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.admin-intro h1 { margin: .65rem 0; font-size: clamp(2.25rem, 5.5vw, 3.6rem); }
.admin-intro p:last-child { margin: 0; line-height: 1.5; }
.admin-section { margin-top: 1.25rem; }
.admin-section h2 { font-size: clamp(1.65rem, 3vw, 2rem); }
.admin-filters {
    grid-template-columns: repeat(2, minmax(8.5rem, 1fr)) minmax(9rem, 1.5fr) auto;
    align-items: end;
    margin-top: 1rem;
}

.admin-filters select {
    width: 100%;
    min-height: 2.85rem;
    border: 1px solid #d9c4c9;
    border-radius: .65rem;
    padding: .65rem .85rem;
    background: #fffcfa;
    color: inherit;
    font: inherit;
}

.admin-actions { justify-content: flex-start; }
.admin-actions .button { width: auto; margin: 0; }
.admin-secondary { border: 1px solid var(--border); background: #fff; color: var(--berry); }
.admin-secondary:hover { background: #fff0f1; }
.admin-reset summary { width: fit-content; cursor: pointer; color: var(--berry); font-weight: 650; }
.admin-reset form { max-width: 26rem; margin-top: 1rem; }
.admin-reset .admin-danger { justify-content: center; background: #8e1f36; }
.admin-reset .admin-danger:hover { background: #6f182a; }
.admin-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0 0; }
.admin-metrics .card { padding: 1.15rem; }
.admin-metrics dt { color: var(--muted); font-size: .85rem; font-weight: 650; }
.admin-metrics dd { margin: .35rem 0 0; color: var(--berry); font: 700 2.25rem Georgia, serif; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; margin-top: 1rem; border-collapse: collapse; text-align: left; font-size: .9rem; }
.admin-table :is(th, td) { padding: .75rem .6rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.admin-table thead { background: #fff4f3; color: var(--berry); }
.admin-table tbody th { font-weight: 650; }
.admin-group-table tr > :last-child { text-align: right; }
.admin-table .nowrap { white-space: nowrap; }
.admin-pagination { margin-top: 1rem; justify-content: center; font-size: .9rem; color: var(--muted); }
.admin-pagination a { color: var(--berry); }

@media (max-width: 58rem) {
    .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 44rem) {
    .page { width: min(100% - 2rem, 32rem); }
    .brand { padding: 1.2rem 0; }
    .layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "event" "card" "certificate";
        grid-template-rows: auto;
        gap: 1rem;
    }
    .event { padding: 1.35rem; }
    h1 br { display: none; }
    .admin-filters { grid-template-columns: minmax(0, 1fr); }
    .admin-table-wrap .admin-table { min-width: 38rem; }
}
