:root {
    color-scheme: light;
    --canvas: #f5f3f7;
    --card: #fff;
    --ink: #302039;
    --muted: #65596c;
    --edge: #d8c9de;
    --accent: #684375;
    --accent-hover: #53335e;
    --button-ink: #fff;
    --subtle: #f4edf6;
    --shadow: #2c173413;
    --field: #fff;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #17111c;
    --card: #251c2c;
    --ink: #f5eaf7;
    --muted: #d4c1da;
    --edge: #56415f;
    --accent: #e1c7e6;
    --accent-hover: #f3dff5;
    --button-ink: #281c2d;
    --subtle: #33253d;
    --shadow: #08020c50;
    --field: #211828;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --canvas: #17111c;
        --card: #251c2c;
        --ink: #f5eaf7;
        --muted: #d4c1da;
        --edge: #56415f;
        --accent: #e1c7e6;
        --accent-hover: #f3dff5;
        --button-ink: #281c2d;
        --subtle: #33253d;
        --shadow: #08020c50;
        --field: #211828;
    }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body.fmg-client-page { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.6 system-ui, sans-serif; }
.fmg-client-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.fmg-client-page a { color: var(--accent); }
.fmg-client-page h1, .fmg-client-page h2 { margin: 0 0 10px; font: 400 clamp(32px, 4vw, 48px)/1.12 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.fmg-client-page p { margin: 0 0 19px; color: var(--muted); }
.fmg-client-header { min-height: 66px; padding: 12px clamp(20px, 5vw, 74px); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--edge); }
.fmg-client-brand { font-size: 17px; font-weight: 700; letter-spacing: .23em; text-decoration: none; }
/* v2.2.2: restore the header control sizing on the standalone client login.
   The event view loads client-area.css, but the entry view does not. Without
   these rules the language SVG keeps its intrinsic size and breaks the header. */
.fmg-client-tools { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.fmg-client-page--entry .fmg-client-language {
    box-sizing: border-box;
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--edge);
    border-radius: 50%;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}
.fmg-client-page--entry .fmg-client-language svg {
    display: block;
    width: 22px;
    height: auto;
    max-width: 100%;
    border-radius: 2px;
}
.fmg-client-page--entry .fmg-client-theme { flex: 0 0 44px; }
.fmg-client-theme { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--edge); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; }
.fmg-client-theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fmg-client-sun, [data-theme="dark"] .fmg-client-moon { display: none; }
[data-theme="dark"] .fmg-client-sun { display: block; }
.fmg-client-entry { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); align-items: center; gap: clamp(20px, 7vw, 106px); padding: clamp(12px, 3vw, 48px); background: linear-gradient(125deg, var(--edge), var(--canvas) 65%); }
.fmg-client-entry-heading h1 { font-size: clamp(54px, 8vw, 102px); }
.fmg-client-entry-heading em { color: var(--accent); }
.fmg-client-entry-heading p, .fmg-client-page .fmg-client-eyebrow { margin-bottom: 12px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.fmg-client-card { padding: clamp(20px, 4vw, 40px); border: 1px solid var(--edge); border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 20px 55px var(--shadow); }
.fmg-client-entry-card { width: 100%; min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.fmg-client-icon { display: block; margin-bottom: 22px; }
.fmg-client-form { display: grid; gap: 16px; }
.fmg-client-form label { min-width: 0; display: grid; gap: 7px; font-size: 13px; font-weight: 650; }
.fmg-client-form input, .fmg-client-form textarea { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; background: var(--field); color: var(--ink); font: 400 16px/1.4 system-ui, sans-serif; }
.fmg-client-form textarea { resize: vertical; }
.fmg-client-button, .fmg-client-page a.fmg-client-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: var(--button-ink); text-decoration: none; font: 650 14px/1.35 system-ui, sans-serif; text-align: center; cursor: pointer; }
.fmg-client-button:hover, .fmg-client-page a.fmg-client-button:hover { background: var(--accent-hover); }
.fmg-client-button:disabled { opacity: .6; cursor: default; }
.fmg-client-button.fmg-client-secondary, .fmg-client-page a.fmg-client-secondary { background: var(--card); color: var(--accent); }
.fmg-client-button.fmg-client-secondary:hover, .fmg-client-page a.fmg-client-secondary:hover { background: var(--subtle); }
.fmg-client-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fmg-client-entry-card .fmg-client-actions a { overflow-wrap: anywhere; }
.fmg-client-back { display: inline-block; margin-top: 18px; text-underline-offset: 3px; }
.fmg-client-dashboard { max-width: 1100px; margin: 0 auto; padding: clamp(16px, 5vw, 64px); }
.fmg-client-event-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 12px; }
.fmg-client-details, .fmg-client-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 24px; }
.fmg-client-details div, .fmg-client-notes div { padding: 14px 16px; border: 1px solid var(--edge); border-radius: 12px; background: var(--subtle); }
.fmg-client-details dt, .fmg-client-notes dt { color: var(--muted); font-size: 13px; font-weight: 650; }
.fmg-client-details dd, .fmg-client-notes dd { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.fmg-client-notes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fmg-client-page .fmg-client-feedback { width: fit-content; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 10px; background: var(--subtle); color: var(--ink); }
.fmg-client-request { width: min(92vw, 540px); max-height: 90svh; }
.fmg-client-request:not(:modal)[open] { position: static; width: 100%; max-height: none; margin: 16px 0 0; }
.fmg-client-request::backdrop { background: #1a1124b8; }
@media (max-width: 780px) {
    .fmg-client-entry { grid-template-columns: minmax(0, 460px); align-content: center; justify-content: center; gap: 16px; padding: 28px 18px; }
    .fmg-client-entry-heading h1 { font-size: clamp(42px, 8vw, 60px); }
    .fmg-client-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 390px) {
    .fmg-client-details { grid-template-columns: minmax(0, 1fr); }
}

/* The entry/login, access-denied and archived screens always occupy exactly
   one viewport. Longer event dashboards retain normal document scrolling. */
.fmg-client-html--entry { height: 100%; overflow: hidden; }
.fmg-client-page--entry {
    position: relative;
    isolation: isolate;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: linear-gradient(125deg, var(--edge), var(--canvas) 65%);
}
.fmg-client-page--entry .fmg-client-header {
    min-height: 0;
    padding-top: max(9px, env(safe-area-inset-top));
    background: transparent;
    border-bottom: 0;
}
.fmg-client-page--entry .fmg-client-entry {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: transparent;
}
.fmg-client-page--entry .fmg-client-entry-heading,
.fmg-client-page--entry .fmg-client-entry-card { min-width: 0; }
.fmg-client-page--entry .fmg-client-entry-card { scrollbar-width: thin; }

@media (max-width: 780px) {
    .fmg-client-page--entry .fmg-client-entry {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: clamp(7px, 1.5dvh, 16px);
        padding: clamp(7px, 1.8dvh, 18px) 16px max(7px, env(safe-area-inset-bottom));
    }
    .fmg-client-page--entry .fmg-client-entry-heading,
    .fmg-client-page--entry .fmg-client-entry-card { width: min(100%, 460px); }
    .fmg-client-page--entry .fmg-client-entry-heading { flex: 0 0 auto; }
    .fmg-client-page--entry .fmg-client-entry-card { flex: 0 1 auto; }
    .fmg-client-page--entry .fmg-client-entry-heading p { margin-bottom: 3px; }
    .fmg-client-page--entry .fmg-client-entry-heading h1 { margin: 0; font-size: clamp(34px, 9vw, 58px); }
}

/* Compact landscape and short mobile screens: shrink whitespace and fields,
   not the viewport. Only the card itself may scroll as an accessibility fallback. */
@media (max-height: 740px) {
    .fmg-client-page--entry .fmg-client-header { padding-top: max(5px, env(safe-area-inset-top)); padding-bottom: 5px; }
    .fmg-client-page--entry :is(.fmg-client-theme, .fmg-client-language) { flex-basis: 36px; width: 36px; height: 36px; }
    .fmg-client-page--entry .fmg-client-entry { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
    .fmg-client-page--entry .fmg-client-card { padding: clamp(13px, 2.5vh, 22px); border-radius: 17px; }
    .fmg-client-page--entry .fmg-client-entry-card .fmg-client-icon { width: 26px; height: 26px; margin-bottom: 8px; }
    .fmg-client-page--entry .fmg-client-entry-card h2 { font-size: clamp(23px, 3.5vw, 32px); margin-bottom: 5px; }
    .fmg-client-page--entry .fmg-client-entry-card > p { margin-bottom: 9px; line-height: 1.35; }
    .fmg-client-page--entry .fmg-client-form { gap: 9px; }
    .fmg-client-page--entry .fmg-client-form label { gap: 3px; line-height: 1.25; }
    .fmg-client-page--entry .fmg-client-form input { min-height: 40px; padding: 8px 12px; }
    .fmg-client-page--entry .fmg-client-button { min-height: 40px; }
}
@media (max-height: 560px) {
    .fmg-client-page--entry .fmg-client-entry { gap: 6px; }
    .fmg-client-page--entry .fmg-client-entry-heading h1 { font-size: clamp(28px, 7vw, 44px); }
    .fmg-client-page--entry .fmg-client-entry-heading p { font-size: 10px; margin: 0; }
    .fmg-client-page--entry .fmg-client-card { padding: 12px; }
    .fmg-client-page--entry .fmg-client-form { gap: 7px; }
    .fmg-client-page--entry .fmg-client-entry-card .fmg-client-icon { margin-bottom: 4px; width: 22px; height: 22px; }
}

/* Keep the admin link, language button and theme switch on one row on phones. */
@media (max-width: 600px) {
    .fmg-client-page--entry .fmg-client-header { padding-inline: 12px; gap: 8px; }
    .fmg-client-page--entry .fmg-client-brand { font-size: 14px; letter-spacing: .13em; white-space: nowrap; }
    .fmg-client-page--entry .fmg-client-tools { gap: 6px; }
    .fmg-client-page--entry :is(.fmg-client-language, .fmg-client-theme) { flex-basis: 36px; width: 36px; height: 36px; }
    .fmg-client-page--entry .fmg-client-language svg { width: 22px; }
}
@media (max-width: 360px) {
    .fmg-client-page--entry .fmg-client-brand { font-size: 12px; letter-spacing: .08em; }
    .fmg-client-page--entry .fmg-client-header { padding-inline: 8px; gap: 5px; }
    .fmg-client-page--entry .fmg-client-tools { gap: 4px; }
    .fmg-client-page--entry .fmg-client-admin-link { font-size: 10px; padding: 5px; }
}
@media (max-width: 300px) {
    .fmg-client-page--entry .fmg-client-header { padding-inline: 6px; gap: 3px; }
    .fmg-client-page--entry .fmg-client-brand { font-size: 11px; letter-spacing: .04em; }
    .fmg-client-page--entry .fmg-client-tools { gap: 3px; }
    .fmg-client-page--entry :is(.fmg-client-theme, .fmg-client-language) { flex-basis: 32px; width: 32px; height: 32px; }
    .fmg-client-page--entry .fmg-client-admin-link { padding-inline: 4px; font-size: 9px; }
}

.fmg-client-entry-photo,
.fmg-client-page--photo::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.fmg-client-entry-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}
.fmg-client-entry-photo--login { object-position: 34% 14%; }
.fmg-client-entry-photo--denied { object-position: 49% 33%; }
.fmg-client-entry-photo--archived { object-position: 30% 14%; }
.fmg-client-page--photo::before {
    content: "";
    z-index: -1;
    background: linear-gradient(180deg, rgb(13 9 17 / .46), transparent 24%),
        linear-gradient(90deg, rgb(13 9 17 / .68), rgb(13 9 17 / .18) 68%);
}
.fmg-client-page--photo .fmg-client-brand,
.fmg-client-page--photo .fmg-client-entry-heading h1 { color: #fff; text-shadow: 0 2px 12px #100a18; }
.fmg-client-page--photo .fmg-client-entry-heading :is(p, em) { color: #f3def6; }
.fmg-client-page--photo .fmg-client-entry-heading p { text-shadow: 0 1px 5px #100a18; }
.fmg-client-page--photo .fmg-client-brand:focus-visible { outline-color: #fff; }
[data-theme="dark"] .fmg-client-page--photo::before {
    background: linear-gradient(180deg, rgb(10 7 14 / .45), transparent 24%),
        linear-gradient(90deg, rgb(10 7 14 / .78), rgb(10 7 14 / .39) 70%);
}

@media (max-width: 780px) {
    .fmg-client-page--photo .fmg-client-entry {
        justify-content: flex-end;
        padding-bottom: max(clamp(12px, 4dvh, 36px), env(safe-area-inset-bottom));
    }
    .fmg-client-entry-photo--login { object-position: 23% 14%; }
    .fmg-client-page--photo::before {
        background: linear-gradient(180deg, rgb(13 9 17 / .61), rgb(13 9 17 / .14) 20%, rgb(13 9 17 / .79) 88%);
    }
    [data-theme="dark"] .fmg-client-page--photo::before {
        background: linear-gradient(180deg, rgb(10 7 14 / .73), rgb(10 7 14 / .33) 20%, rgb(10 7 14 / .85) 88%);
    }
}
@media (max-width: 780px) and (max-height: 500px) {
    .fmg-client-page--photo .fmg-client-entry { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
