/******************************************************************************
 * AEGIS — HUD theme layer for Admidio
 *
 * Loaded AFTER admidio.css. EVERYTHING here is scoped under
 * `body:has(.aeg-hud)` so it only affects pages whose content carries the
 * `.aeg-hud` marker (the login page now; the system-message / access-denied
 * page later). The authenticated application chrome is deliberately left
 * untouched until that pass is approved.
 *
 * Reversible: switch the Admidio theme back to `simple`, or remove this file
 * plus its <link>/<script> from index.tpl / index.reduced.tpl.
 *****************************************************************************/

/* ---- Scope tokens + immersive backdrop --------------------------------- */
body:has(.aeg-hud) {
    --aeg-bg-0:        #05090f;
    --aeg-bg-1:        #0a121c;
    --aeg-panel:       rgba(15, 26, 39, 0.62);
    --aeg-panel-2:     rgba(11, 20, 31, 0.78);
    --aeg-edge:        rgba(120, 176, 214, 0.28);
    --aeg-edge-bright: #57d6ef;
    --aeg-cyan:        #3fbdf0;
    --aeg-cyan-soft:   #7fd6ef;
    --aeg-steel:       #5c7fa0;
    --aeg-text:        #dce8f4;
    --aeg-text-dim:    #8ca4bb;
    --aeg-muted:       #64809a;
    --aeg-amber:       #f5a623;
    --aeg-amber-soft:  #ffca6b;
    --aeg-danger:      #ff5b52;

    --aeg-ui-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
                   "Helvetica Neue", Arial, sans-serif;
    --aeg-mono-font: ui-monospace, "SFMono-Regular", "JetBrains Mono",
                     "Cascadia Code", Menlo, Consolas, monospace;

    --bs-primary: var(--aeg-cyan);
    --bs-primary-rgb: 63, 189, 240;
    --bs-body-color: var(--aeg-text);
    --bs-link-color: var(--aeg-cyan-soft);
    --bs-link-hover-color: #ffffff;
    --bs-focus-ring-color: rgba(63, 189, 240, 0.45);
    --bs-border-color: var(--aeg-edge);

    color: var(--aeg-text);
    font-family: var(--aeg-ui-font);
    min-height: 100vh;
    background:
        radial-gradient(1200px 700px at 50% -10%, rgba(38, 92, 130, 0.30), transparent 60%),
        radial-gradient(900px 900px at 85% 110%, rgba(20, 60, 92, 0.25), transparent 55%),
        linear-gradient(180deg, var(--aeg-bg-1) 0%, var(--aeg-bg-0) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Hide the full application chrome on HUD (login/message) pages ----------- */
body:has(.aeg-hud) #adm_main_navbar,
body:has(.aeg-hud) #adm_sidebar,
body:has(.aeg-hud) .admidio-breadcrumb,
body:has(.aeg-hud) #adm_imprint,
body:has(.aeg-hud) > .admidio-content .admidio-content-header,
body:has(.aeg-hud) .admidio-content-header {
    display: none !important;
}
body:has(.aeg-hud) .container-fluid,
body:has(.aeg-hud) .container-fluid > .row,
body:has(.aeg-hud) .admidio-content-col {
    display: block;
    width: 100%;
    max-width: 100%;
    flex: none;
    padding: 0;
    margin: 0;
}

/* Faint HUD grid + slow holographic ring behind everything --------------- */
body:has(.aeg-hud)::before {
    content: "";
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(rgba(90, 150, 190, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 150, 190, 0.05) 1px, transparent 1px);
    background-size: 46px 46px, 46px 46px;
    -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
            mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}
body:has(.aeg-hud)::after {
    content: "";
    position: fixed; left: 50%; top: 42%;
    width: min(78vw, 760px); aspect-ratio: 1; translate: -50% -50%;
    pointer-events: none; z-index: 0; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 6%, rgba(63, 189, 240, 0.10) 8%, transparent 12% 100%);
    -webkit-mask: radial-gradient(circle, transparent 61%, #000 62% 74%, transparent 75%);
            mask: radial-gradient(circle, transparent 61%, #000 62% 74%, transparent 75%);
    opacity: 0.8;
    animation: aeg-ring-spin 60s linear infinite;
}

/* ---- Content shell ------------------------------------------------------ */
body:has(.aeg-hud) #adm_content.admidio-content {
    position: relative; z-index: 1;
    max-width: 560px;
    margin: clamp(2.5rem, 8vh, 6rem) auto 3rem;
    padding: 0 1.25rem;
    animation: aeg-rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* Agency emblem + kicker -------------------------------------------------- */
.aeg-brand { display: flex; flex-direction: column; align-items: center; gap: 0.85rem; margin-bottom: 1.4rem; text-align: center; }
.aeg-emblem { width: 84px; height: 84px; filter: drop-shadow(0 0 10px rgba(63, 189, 240, 0.35)); animation: aeg-emblem-in 0.9s ease both; }
/* Raster brand seal (di_logo.png): circular crop on its black field + a soft
   cyan halo and thin edge-ring so it reads as an integrated HUD emblem. */
.aeg-emblem-logo {
    width: 120px; height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(120, 176, 214, 0.35),
                0 0 28px -6px rgba(63, 189, 240, 0.55);
    filter: drop-shadow(0 0 12px rgba(63, 189, 240, 0.35));
}
.aeg-kicker { font-family: var(--aeg-mono-font); font-size: 0.72rem; letter-spacing: 0.42em; text-transform: uppercase; color: var(--aeg-cyan-soft); padding-left: 0.42em; }

/* ---- Glass panel with HUD corner brackets ------------------------------ */
.aeg-panel {
    position: relative;
    background: linear-gradient(180deg, var(--aeg-panel) 0%, var(--aeg-panel-2) 100%);
    border: 1px solid var(--aeg-edge);
    border-radius: 16px;
    clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
    backdrop-filter: blur(14px) saturate(115%);
    -webkit-backdrop-filter: blur(14px) saturate(115%);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.75),
                0 0 0 1px rgba(63, 189, 240, 0.08) inset,
                0 1px 0 rgba(255, 255, 255, 0.05) inset;
    padding: 2rem 2rem 1.75rem;
    overflow: hidden;
}
.aeg-panel::before {
    content: ""; position: absolute; top: 0; left: 22px; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--aeg-edge-bright) 30%, var(--aeg-edge-bright) 70%, transparent);
    opacity: 0.7;
}
.aeg-panel::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(127, 214, 239, 0.10) 47%, rgba(127, 214, 239, 0.02) 55%, transparent 70%);
    transform: translateX(-120%);
    animation: aeg-sweep 7s ease-in-out 1.2s infinite;
}
.aeg-panel > .aeg-corners { position: absolute; inset: 9px; pointer-events: none; z-index: 2; }
.aeg-panel > .aeg-corners span { position: absolute; width: 18px; height: 18px; border: 1.5px solid var(--aeg-edge-bright); opacity: 0.65; }
.aeg-corners span.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.aeg-corners span.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.aeg-corners span.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.aeg-corners span.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* Panel heading strip ----------------------------------------------------- */
.aeg-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--aeg-edge); }
.aeg-panel-title { font-size: 1.15rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--aeg-text); margin: 0; }
.aeg-panel-title .bi { color: var(--aeg-cyan); margin-right: 0.5rem; }
.aeg-status { font-family: var(--aeg-mono-font); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--aeg-amber-soft); white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; }
.aeg-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--aeg-amber); box-shadow: 0 0 8px 1px var(--aeg-amber); animation: aeg-blink 2.4s ease-in-out infinite; }

/* ---- Form controls ------------------------------------------------------ */
body:has(.aeg-hud) .admidio-form-group { margin-bottom: 1.15rem; }
body:has(.aeg-hud) .form-label,
body:has(.aeg-hud) form label {
    font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--aeg-text-dim); font-weight: 500; margin-bottom: 0.4rem;
}
body:has(.aeg-hud) .form-control,
body:has(.aeg-hud) .form-select {
    background: rgba(6, 13, 21, 0.72);
    border: 1px solid var(--aeg-edge);
    border-radius: 9px; color: var(--aeg-text);
    padding: 0.7rem 0.85rem; font-family: var(--aeg-ui-font);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
body:has(.aeg-hud) .form-control::placeholder { color: var(--aeg-muted); }
body:has(.aeg-hud) .form-control:hover,
body:has(.aeg-hud) .form-select:hover { border-color: rgba(120, 176, 214, 0.5); }
body:has(.aeg-hud) .form-control:focus,
body:has(.aeg-hud) .form-select:focus {
    background: rgba(8, 17, 27, 0.9);
    border-color: var(--aeg-edge-bright);
    box-shadow: 0 0 0 3px rgba(63, 189, 240, 0.22), 0 0 18px -4px rgba(63, 189, 240, 0.5);
    outline: none;
}
body:has(.aeg-hud) .form-check-input { background-color: rgba(6, 13, 21, 0.8); border: 1px solid var(--aeg-edge); }
body:has(.aeg-hud) .form-check-input:checked { background-color: var(--aeg-cyan); border-color: var(--aeg-cyan); }
body:has(.aeg-hud) .form-check-label { text-transform: none; letter-spacing: normal; font-size: 0.9rem; color: var(--aeg-text-dim); }

/* ---- Buttons ------------------------------------------------------------ */
body:has(.aeg-hud) .btn-primary,
body:has(.aeg-hud) #adm_button_login {
    position: relative; width: 100%; margin-top: 0.4rem; padding: 0.75rem 1rem;
    /* Admidio adds .offset-sm-3 (margin-left:25%) to the submit button, which
       pushes a full-width button against the right edge. Cancel that offset so
       the button spans the panel. */
    margin-left: 0 !important; margin-right: 0 !important;
    border: 1px solid var(--aeg-edge-bright); border-radius: 10px;
    background: linear-gradient(180deg, rgba(63, 189, 240, 0.22), rgba(38, 118, 158, 0.28));
    color: #eaf7fd; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.82rem;
    box-shadow: 0 0 0 1px rgba(63, 189, 240, 0.12) inset, 0 10px 30px -12px rgba(63, 189, 240, 0.6);
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
body:has(.aeg-hud) .btn-primary:hover,
body:has(.aeg-hud) #adm_button_login:hover {
    background: linear-gradient(180deg, rgba(83, 209, 255, 0.34), rgba(48, 138, 178, 0.4));
    box-shadow: 0 0 0 1px rgba(127, 214, 239, 0.4) inset, 0 14px 36px -12px rgba(63, 189, 240, 0.8);
    transform: translateY(-1px);
}
body:has(.aeg-hud) .btn-primary:active,
body:has(.aeg-hud) #adm_button_login:active { transform: translateY(0); }
body:has(.aeg-hud) .btn-secondary {
    background: transparent; border: 1px solid var(--aeg-edge); color: var(--aeg-cyan-soft);
    border-radius: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem;
}
body:has(.aeg-hud) .btn-secondary:hover { border-color: var(--aeg-edge-bright); color: #fff; background: rgba(63, 189, 240, 0.08); }

/* Registration hint card -------------------------------------------------- */
body:has(.aeg-hud) #registration_card.card {
    margin-top: 1.5rem !important; background: rgba(9, 17, 27, 0.6);
    border: 1px solid var(--aeg-edge); border-radius: 12px; color: var(--aeg-text-dim);
}
body:has(.aeg-hud) #registration_card .card-body { text-align: center; }

/* Node / session readout -------------------------------------------------- */
.aeg-readout { margin-top: 1.15rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem; font-family: var(--aeg-mono-font); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--aeg-muted); }
.aeg-readout b { color: var(--aeg-cyan-soft); font-weight: 500; }
.aeg-readout .aeg-sep { color: var(--aeg-edge); }

/* ---- Alerts: the single amber accent ----------------------------------- */
body:has(.aeg-hud) .form-alert,
body:has(.aeg-hud) .alert {
    display: block; margin-top: 1.1rem; padding: 0.8rem 1rem 0.8rem 2.6rem; position: relative;
    background: rgba(45, 30, 8, 0.55); border: 1px solid rgba(245, 166, 35, 0.55);
    border-left: 3px solid var(--aeg-amber); border-radius: 9px; color: var(--aeg-amber-soft);
    font-size: 0.86rem; letter-spacing: 0.02em;
}
body:has(.aeg-hud) .form-alert::before,
body:has(.aeg-hud) .alert::before {
    content: "\F33A"; font-family: "bootstrap-icons"; position: absolute; left: 0.85rem; top: 0.8rem; color: var(--aeg-amber);
}
body:has(.aeg-hud) .form-alert.aeg-rescan { animation: aeg-alert-in 0.35s ease both; }
.aeg-panel.aeg-denied { border-color: rgba(245, 166, 35, 0.6); animation: aeg-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
.aeg-panel.aeg-denied::before { background: linear-gradient(90deg, transparent, var(--aeg-amber) 30%, var(--aeg-amber) 70%, transparent); }
.aeg-panel.aeg-denied .aeg-rescan-line {
    position: absolute; left: 0; right: 0; height: 2px; top: 0;
    background: linear-gradient(90deg, transparent, var(--aeg-amber), transparent);
    box-shadow: 0 0 12px 1px var(--aeg-amber); animation: aeg-rescan-sweep 1.4s ease-in-out 3; z-index: 3;
}

/* ---- System-message / ACCESS DENIED page ------------------------------- */
body:has(.aeg-hud) .aeg-msg-body .lead {
    font-size: 1rem; line-height: 1.6; color: var(--aeg-text);
    margin: 0.25rem 0 0; white-space: pre-line;
}
body:has(.aeg-hud) .aeg-msg-actions {
    display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center;
    margin-top: 1.6rem;
}
/* keep the message action buttons a sensible width (not stretched full-width) */
body:has(.aeg-hud) .aeg-msg-actions .btn-primary,
body:has(.aeg-hud) .aeg-msg-actions .btn-secondary {
    width: auto; min-width: 9rem; margin-top: 0;
}
body:has(.aeg-hud) .aeg-msg-actions .btn.admidio-margin-bottom { margin-bottom: 0; }

/* Amber escalation applied by aegis-hud.js when the text is a denial -------- */
.aeg-msg-panel.aeg-denied {
    border-color: rgba(245, 166, 35, 0.6);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(245, 166, 35, 0.18) inset,
                0 0 44px -6px rgba(245, 166, 35, 0.35);
}
.aeg-msg-panel.aeg-denied [data-aeg-title] { color: var(--aeg-amber-soft); letter-spacing: 0.2em; }
.aeg-msg-panel.aeg-denied [data-aeg-title] .bi { color: var(--aeg-amber); animation: aeg-lock-pulse 2s ease-in-out infinite; }
.aeg-msg-panel.aeg-denied [data-aeg-status] { color: var(--aeg-amber-soft); }
.aeg-msg-panel.aeg-denied [data-aeg-status]::before { background: var(--aeg-amber); box-shadow: 0 0 8px 1px var(--aeg-amber); }
.aeg-msg-panel.aeg-denied .aeg-panel-head { border-bottom-color: rgba(245, 166, 35, 0.35); }
/* the re-scanning line loops continuously on the denied message page */
.aeg-msg-panel.aeg-denied .aeg-rescan-line { animation-iteration-count: infinite; }
.aeg-message:has(.aeg-msg-denied) .aeg-kicker { color: var(--aeg-amber-soft); }
@keyframes aeg-lock-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---- Authenticating overlay -------------------------------------------- */
.aeg-auth-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; background: rgba(6, 13, 21, 0.68); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 5; border-radius: inherit; }
.aeg-panel.aeg-authenticating .aeg-auth-overlay { display: flex; }
.aeg-spinner { width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(63, 189, 240, 0.18); border-top-color: var(--aeg-cyan); border-right-color: var(--aeg-cyan-soft); animation: aeg-ring-spin 0.9s linear infinite; }
.aeg-auth-label { font-family: var(--aeg-mono-font); font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--aeg-cyan-soft); }
.aeg-auth-label::after { content: ""; animation: aeg-dots 1.4s steps(4, end) infinite; }

/* ---- Keyframes ---------------------------------------------------------- */
@keyframes aeg-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes aeg-emblem-in { from { opacity: 0; transform: scale(0.82) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes aeg-sweep { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }
@keyframes aeg-ring-spin { to { transform: rotate(360deg); } }
@keyframes aeg-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes aeg-alert-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes aeg-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes aeg-rescan-sweep { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes aeg-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---- Accessibility: honour reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
    body:has(.aeg-hud) *,
    body:has(.aeg-hud) *::before,
    body:has(.aeg-hud) *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    body:has(.aeg-hud)::after { animation: none; }
    .aeg-spinner { animation: aeg-ring-spin 0.9s linear infinite; }
}

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 576px) {
    body:has(.aeg-hud) #adm_content.admidio-content { margin-top: 2rem; }
    .aeg-panel { padding: 1.5rem 1.25rem; }
    .aeg-panel-head { flex-direction: column; gap: 0.4rem; }
}


/******************************************************************************
 * AEGIS — SIGN-IN CHROME (travel-key pass, 2026-08-13)
 *
 * Brings the travel key's unlock-screen language onto the sign-in page: the
 * gold seal ring, the survey grid, the scanline, and a short boot readout.
 *
 * Scoped to `.aeg-login` only. The message / access-denied page shares
 * `.aeg-hud` and is deliberately left alone, and nothing here touches the
 * form: no field, label, button or layout rule is redefined below.
 *
 * All decoration is pointer-events: none and aria-hidden in the template, so
 * it cannot sit in front of an input or reach a screen reader.
 *****************************************************************************/

.aeg-login { position: relative; z-index: 0; }

/* Survey grid, faded out towards the edges so it never fights the panel. */
.aeg-login::before {
    content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background-image:
        linear-gradient(rgba(87, 214, 239, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(87, 214, 239, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, #000 32%, transparent 100%);
            mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, #000 32%, transparent 100%);
}

/* Slow scanline. */
.aeg-login::after {
    content: ""; position: fixed; left: 0; right: 0; height: 150px;
    z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(87, 214, 239, 0.045), transparent);
    animation: aeg-login-scan 9s linear infinite;
}
@keyframes aeg-login-scan { from { top: -150px; } to { top: 100%; } }

/* ---- Seal rings --------------------------------------------------------- */
/* The emblem is 120px and sits at the top of .aeg-brand, so the rings are
   centred on 60px down rather than on the flex box's own middle. */
.aeg-brand { position: relative; }
.aeg-brand::before,
.aeg-brand::after {
    content: ""; position: absolute; left: 50%; top: 60px;
    border-radius: 50%; pointer-events: none;
}
.aeg-brand::before {
    width: 152px; height: 152px; margin: -76px 0 0 -76px;
    border: 1px dashed rgba(255, 215, 138, 0.32);
    animation: aeg-seal-ring 46s linear infinite;
}
.aeg-brand::after {
    width: 180px; height: 180px; margin: -90px 0 0 -90px;
    border: 1px solid rgba(87, 214, 239, 0.14);
    border-top-color: rgba(87, 214, 239, 0.42);
    border-bottom-color: rgba(87, 214, 239, 0.42);
    animation: aeg-seal-ring 32s linear infinite reverse;
}
@keyframes aeg-seal-ring { to { transform: rotate(360deg); } }

/* Gold edge on the seal, sitting on its own dark field. */
.aeg-login .aeg-emblem-logo {
    box-shadow: 0 0 0 1px rgba(255, 215, 138, 0.5),
                0 0 0 7px rgba(5, 9, 15, 0.92),
                0 0 34px -6px rgba(63, 189, 240, 0.55);
}

/* Gold rule under the kicker, matching the travel key's divider. */
.aeg-login .aeg-kicker { position: relative; padding-bottom: 1.1rem; }
.aeg-login .aeg-kicker::after {
    content: ""; position: absolute; bottom: 0; left: 50%;
    width: 300px; max-width: 74vw; height: 1px; transform: translateX(-50%);
    background: linear-gradient(90deg, transparent,
                rgba(120, 176, 214, 0.28) 18%, rgba(255, 215, 138, 0.75) 50%,
                rgba(120, 176, 214, 0.28) 82%, transparent);
}

/* Corner brackets pick up the gold so the panel agrees with the seal. */
.aeg-login .aeg-corners span { border-color: rgba(255, 215, 138, 0.55); }

/* ---- Boot readout ------------------------------------------------------- */
.aeg-boot {
    margin: 1.15rem auto 0;
    max-width: 320px;
    font-family: var(--aeg-mono-font);
    font-size: 0.64rem;
    line-height: 2;
    letter-spacing: 0.1em;
    color: var(--aeg-muted);
    pointer-events: none;
}
.aeg-boot div { opacity: 0; animation: aeg-boot-in 0.4s ease forwards; }
.aeg-boot div:nth-child(1) { animation-delay: 0.55s; }
.aeg-boot div:nth-child(2) { animation-delay: 0.95s; }
.aeg-boot div:nth-child(3) { animation-delay: 1.35s; }
.aeg-boot .ok { color: var(--aeg-cyan); }
.aeg-boot .wait { color: var(--aeg-amber-soft); }
@keyframes aeg-boot-in { to { opacity: 1; } }

/* Anyone who has asked for less movement gets a still page. */
@media (prefers-reduced-motion: reduce) {
    .aeg-login::after,
    .aeg-brand::before,
    .aeg-brand::after { animation: none; }
    .aeg-boot div { opacity: 1; animation: none; }
}

@media (max-width: 576px) {
    .aeg-brand::after { display: none; }
    .aeg-boot { display: none; }
}

/* ---------------------------------------------------------------------------
 * God's Eye shell — embedded panel polish.
 *
 * When a tool page is opened as an ?iframe=1 panel inside aegis.php it renders
 * through index.reduced.tpl (no navbar). These rules only tighten spacing and
 * paint the panel dark so it sits flush inside the shell stage; they change no
 * behaviour and apply only to reduced (embedded) pages.
 * ------------------------------------------------------------------------- */
body.admidio-reduced {
    background: #05070d;
}
body.admidio-reduced #adm_content.admidio-content {
    padding: 12px 16px 22px;
    margin-top: 0;
    max-width: none;
}
body.admidio-reduced .admidio-content-header {
    margin: 2px 0 10px;
}
/* the shell already labels the active tool; keep the in-panel back-link subtle */
body.admidio-reduced #adm_back_link {
    font-size: .74rem;
    opacity: .7;
}

/* ---------------------------------------------------------------------------
 * Login simplification (Director, 2026-08-27): narrower card, and drop the
 * continuous holographic ring + entrance animations to ease resource use.
 * Scoped to .aeg-login so the system-message / access-denied page keeps its
 * own treatment.
 * ------------------------------------------------------------------------- */
body:has(.aeg-login) #adm_content.admidio-content {
    max-width: 420px;
    margin-top: clamp(2rem, 7vh, 4.5rem);
    animation: none;
}
body:has(.aeg-login)::after { display: none !important; }           /* no spinning ring */
body:has(.aeg-login)::before { background-size: 62px 62px, 62px 62px; opacity: .55; }
.aeg-login .aeg-emblem, .aeg-login .aeg-emblem-logo { animation: none; }
.aeg-login .aeg-panel { max-width: 400px; margin-left: auto; margin-right: auto; }

/* Remove the "forgot password?" link from the login page (Director 2026-08-27).
   Core renders it into the login form; hidden here (theme-only, reversible). */
.aeg-login a[href*="password_reset"] { display: none !important; }

/* =======================================================================
   STANDARD, CENTRED LOGIN  (Director 2026-08-28: "nothing crazy")
   Scoped to .aeg-login so the message / access-denied HUD page is untouched.
   Fixes: page not centred, emblem graphics cropped, and field labels
   colliding with the input boxes (Admidio's horizontal form layout).
   ======================================================================= */
/* drop the decorative grid, spinning ring and scan-line */
body:has(.aeg-login)::before,
body:has(.aeg-login)::after { content: none !important; background: none !important; animation: none !important; }
.aeg-login::before,
.aeg-login::after { display: none !important; }
.aeg-login .aeg-auth-overlay { display: none !important; }

/* push the card WELL down from the top of the page. The login page has no
   #adm_content wrapper (body is just .admidio), so this must target .aeg-login
   itself, which is the actual container. */
.aeg-login { padding-top: clamp(3.5rem, 11vh, 8rem) !important; padding-bottom: 3rem; }

/* kill EVERY animation on the login page (no spinning/pulsing/sweeping bits) */
.aeg-login, .aeg-login *, .aeg-login *::before, .aeg-login *::after,
body:has(.aeg-login)::before, body:has(.aeg-login)::after { animation: none !important; }

/* circular emblem, with the whole logo FITTING INSIDE the circle (contain, not
   cover) so nothing is cropped; dark disc + inset so the round frame reads. */
.aeg-login .aeg-emblem,
.aeg-login .aeg-emblem-logo {
    width: 112px; height: 112px; border-radius: 50%; object-fit: contain;
    background: #05070c; padding: 7px;
    box-shadow: 0 0 0 1px rgba(120, 176, 214, 0.35), 0 0 24px -8px rgba(63, 189, 240, 0.5);
    animation: none; filter: none; }
/* emblem removed: the wordmark is now the top header */
.aeg-login .aeg-kicker { font-size: 1rem; letter-spacing: 0.22em; color: var(--aeg-cyan-soft);
    white-space: normal; text-align: center; line-height: 1.4; }
/* remove the decorative seal-rings that used to circle the emblem */
.aeg-login .aeg-brand::before,
.aeg-login .aeg-brand::after { content: none !important; display: none !important; }

/* calmer panel: no angled clip-path, no corner brackets */
.aeg-login .aeg-panel { clip-path: none; border-radius: 14px; max-width: 100%; }
.aeg-login .aeg-panel > .aeg-corners { display: none; }

/* STACK each field: label on its own line above a full-width input.
   Admidio renders form-group.row with a col-sm-3 label + col-sm-9 input; on a
   narrow panel that overlaps, so we force a standard vertical layout. */
.aeg-login .form-group.row { display: block; margin-left: 0; margin-right: 0; }
.aeg-login .form-group.row > label,
.aeg-login .form-group.row > .col-sm-3,
.aeg-login .form-group.row > .col-sm-9 {
    width: 100%; max-width: 100%; flex: 0 0 100%;
    padding-left: 0; padding-right: 0; text-align: left; display: block; }
.aeg-login .form-group.row > label { margin-bottom: 0.4rem; }
