/* FUTURE standalone pages - sign-in, 2FA, account redirect, impersonation
   hand-off and the 403/404 error pages. These render outside any Filament
   panel, so they get their own small stylesheet on top of future-atmos.css
   (the night sky, the torus, the steel sweep) instead of the full panel
   theme. */

:root {
    --mn-font-body: 'Onest', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mn-font-display: 'Unbounded', 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mn-ink: 236, 240, 248;
    --mn-ink-muted: 156, 168, 198;
    /* Dark ink for anything sitting on a lit-blue fill (buttons, avatars). */
    --mn-ink-on-primary: 6, 10, 24;
    --mn-surface: 12, 16, 30;
    --mn-hairline: rgba(var(--mn-primary-2), 0.14);
}

* { box-sizing: border-box; }

html {
    height: 100%;
    background-color: rgb(var(--mn-concrete-950));
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--mn-font-body);
    color: rgb(var(--mn-ink));
    background: transparent;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: rgba(var(--mn-accent), 0.55); color: #fff; }

/* ---------- Centered card pages ---------- */

.mn-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 7rem;
}

.mn-card {
    position: relative;
    width: 100%;
    max-width: 25rem;
    padding: 2.25rem 2rem 2.75rem;
    border-radius: 1.75rem;
    overflow: hidden;
    isolation: isolate;
    text-align: center;
    border: 1px solid var(--mn-hairline);
    background: linear-gradient(170deg, rgba(20, 26, 46, 0.8), rgba(var(--mn-surface), 0.9) 55%, rgba(4, 6, 12, 0.94));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow:
        inset 0 1px 0 rgba(var(--mn-primary-2), 0.16),
        0 30px 70px -26px rgba(0, 0, 0, 0.85),
        0 0 60px -30px rgba(var(--mn-primary), 0.28);
    animation: mn-rise 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* A hairline of iris light across the top edge - steel catching the
   dusk... */
.mn-card::before {
    content: '';
    position: absolute;
    inset: 0 12% auto;
    height: 1px;
    z-index: -1;
    background: var(--mn-iris);
    opacity: 0.75;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}

/* ...and a line of light script drifting along the bottom one. */
.mn-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 3.25rem;
    z-index: -1;
    pointer-events: none;
    background:
        var(--mn-band) repeat-x 0 100% / 400px 70%,
        var(--mn-band-deep) repeat-x 140px 100% / 400px 100%;
    opacity: 0.4;
    animation: mn-card-swell 22s linear infinite;
}

@keyframes mn-card-swell {
    from { background-position: 0 100%, 140px 100%; }
    to { background-position: -400px 100%, 540px 100%; }
}

@keyframes mn-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Brand ---------- */

.mn-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.mn-brand .mn-mark {
    margin-top: 1.25rem;
}

.mn-brand .mn-mark img {
    display: block;
    height: 4rem;
    width: auto;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(var(--mn-chrome-mid), 0.22));
}

/* The wordmark: the logo's wide, evenly spaced capitals in steel. The
   tracking also trails the last letter, so the end margin takes it back. */
.mn-name {
    font-family: var(--mn-font-display);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.44em;
    margin-inline-end: -0.44em;
    text-transform: uppercase;
    line-height: 1;
    background: linear-gradient(100deg, rgb(var(--mn-chrome-hi)) 8%, rgb(var(--mn-chrome)) 30%, rgb(var(--mn-chrome-lo)) 56%, rgb(var(--mn-chrome)) 78%, rgb(var(--mn-chrome-hi)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mn-title {
    margin: 0 0 0.5rem;
    font-family: var(--mn-font-display);
    font-weight: 400;
    font-size: 1.1875rem;
    line-height: 1.35;
}

.mn-hint {
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgb(var(--mn-ink-muted));
}

/* ---------- Forms ---------- */

.mn-field { margin-bottom: 1.125rem; text-align: start; }

.mn-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgb(var(--mn-ink-muted));
}

.mn-input-wrap { position: relative; }

.mn-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font: inherit;
    font-size: 0.9375rem;
    color: #fff;
    border-radius: 0.875rem;
    border: 1px solid var(--mn-hairline);
    background: rgba(4, 6, 14, 0.6);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mn-input::placeholder { color: rgba(var(--mn-ink-muted), 0.6); }

.mn-input:focus {
    outline: none;
    border-color: rgb(var(--mn-primary));
    background: rgba(var(--mn-primary), 0.06);
    box-shadow: 0 0 0 4px rgba(var(--mn-primary), 0.12), 0 0 26px -10px rgba(var(--mn-primary-2), 0.45);
}

.mn-input--code {
    text-align: center;
    font-family: var(--mn-font-display);
    font-size: 1.375rem;
    letter-spacing: 0.35em;
    padding-inline-start: calc(1rem + 0.35em);
}

.mn-input--with-toggle { padding-inline-end: 2.875rem; }

.mn-eye {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: flex;
    padding: 0.375rem;
    border: 0;
    background: none;
    color: rgb(var(--mn-ink-muted));
    cursor: pointer;
}

.mn-eye:hover { color: #fff; }
.mn-eye svg { width: 1.25rem; height: 1.25rem; }
.mn-eye .icon-hide { display: none; }
.mn-eye[data-visible="true"] .icon-show { display: none; }
.mn-eye[data-visible="true"] .icon-hide { display: block; }

.mn-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.25rem 0 1.75rem;
    font-size: 0.875rem;
    color: rgb(var(--mn-ink-muted));
    cursor: pointer;
    user-select: none;
}

.mn-check input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: rgb(var(--mn-primary));
    cursor: pointer;
}

.mn-error {
    margin-bottom: 1.125rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.875rem;
    font-size: 0.8125rem;
    text-align: start;
    color: rgb(252, 165, 165);
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.28);
}

/* ---------- Buttons ---------- */

.mn-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 0;
    border-radius: 0.875rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: rgb(var(--mn-ink-on-primary));
    cursor: pointer;
    /* Brushed silver: the face of the mark, lit from above. */
    background: linear-gradient(180deg, rgb(var(--mn-chrome-hi)) 0%, rgb(var(--mn-chrome)) 46%, rgb(var(--mn-chrome-mid)) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(var(--mn-chrome-lo), 0.5), 0 12px 28px -14px rgba(var(--mn-primary), 0.55);
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease, filter 200ms ease;
}

.mn-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(var(--mn-chrome-lo), 0.5), 0 16px 34px -14px rgba(var(--mn-primary), 0.6), 0 0 34px -14px rgba(var(--mn-primary-2), 0.5);
}

.mn-btn:active { transform: translateY(0); }

.mn-btn:focus-visible {
    outline: 2px solid rgb(var(--mn-primary-2));
    outline-offset: 3px;
}

.mn-btn + .mn-btn,
.mn-btn + form,
form + .mn-btn { margin-top: 0.75rem; }

.mn-btn--ghost {
    color: rgb(var(--mn-ink));
    background: rgba(var(--mn-primary-2), 0.04);
    box-shadow: inset 0 0 0 1px rgba(var(--mn-primary-2), 0.22);
}

.mn-btn--ghost:hover {
    background: rgba(var(--mn-primary-2), 0.1);
    box-shadow: inset 0 0 0 1px rgba(var(--mn-accent-bright), 0.5);
    filter: none;
}

.mn-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: rgb(var(--mn-ink-muted));
    text-decoration: none;
}

.mn-link:hover { color: rgb(var(--mn-primary-2)); }

/* ---------- Account (already signed in) ---------- */

.mn-account {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    text-align: start;
    border-radius: 1.125rem;
    border: 1px solid var(--mn-hairline);
    background: rgba(4, 6, 14, 0.55);
}

.mn-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-family: var(--mn-font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: rgb(var(--mn-ink-on-primary));
    background: linear-gradient(180deg, rgb(var(--mn-chrome-hi)), rgb(var(--mn-chrome-mid)));
    box-shadow: 0 0 0 3px rgba(var(--mn-primary), 0.14);
}

.mn-account-email { font-size: 0.9375rem; font-weight: 600; word-break: break-all; }
.mn-account-role { margin-top: 0.15rem; font-size: 0.8125rem; color: rgb(var(--mn-ink-muted)); }

/* ---------- Error pages ---------- */

.mn-code {
    display: block;
    margin: -0.25rem 0 0.5rem;
    font-family: var(--mn-font-display);
    font-weight: 300;
    font-size: 4.5rem;
    line-height: 1;
    letter-spacing: 0.12em;
    margin-inline-end: -0.12em;
    background: linear-gradient(176deg, rgb(var(--mn-chrome-hi)) 0%, rgb(var(--mn-chrome)) 26%, rgb(var(--mn-chrome-lo)) 52%, rgb(var(--mn-chrome)) 72%, rgb(var(--mn-chrome-hi)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 26px rgba(var(--mn-primary), 0.22));
}

/* ---------- Sign-in: split layout ---------- */

.mn-login {
    min-height: 100vh;
    display: flex;
}

.mn-login-form {
    flex: 1 1 46%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem 6rem;
    position: relative;
    background: linear-gradient(90deg, rgba(4, 6, 12, 0.86), rgba(4, 6, 12, 0.45));
    border-inline-end: 1px solid rgba(var(--mn-primary-2), 0.08);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mn-login-form-inner {
    width: 100%;
    max-width: 23rem;
    animation: mn-rise 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mn-login-form .mn-brand--inline {
    display: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
}

.mn-login-form .mn-brand--inline { align-items: center; }
.mn-login-form .mn-brand--inline .mn-mark { margin-top: 0; }
.mn-login-form .mn-brand--inline .mn-mark img { height: 2.6rem; }

.mn-login-heading {
    margin: 0 0 0.6rem;
    font-family: var(--mn-font-display);
    font-weight: 400;
    font-size: 1.75rem;
    line-height: 1.2;
}

.mn-login-sea {
    flex: 1 1 54%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

/* The room carries the ring in its lower right; on the sign-in page the
   hero holds the museum, so the room keeps only its sky. */
body:has(.mn-login) .mn-room .mn-torus {
    display: none;
}

.mn-hero {
    position: relative;
    text-align: center;
    animation: mn-rise 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mn-hero-stage {
    position: relative;
    width: clamp(30rem, 40vw, 46rem);
    aspect-ratio: 1600 / 1000;
    margin: 0 auto 1.75rem;
}

/* The ring's void sits right of and above the art's centre (the torus is
   drawn tilted, its opening off-centre the way the building's is): the mark
   and everything that glows around it are centred on the void, not on the
   box. */
.mn-hero-stage > :not(.mn-hero-torus, .mn-hero-beam) {
    position: absolute;
    left: 54%;
    top: 47.5%;
    translate: -50% -50%;
}

/* Orbits: the void's own ellipse drawn in light, rolling out from behind
   the mark across the ring, one after another. */
.mn-sonar {
    width: 44%;
    aspect-ratio: 720 / 400;
    border-radius: 50%;
    border: 1px solid rgba(var(--mn-lumen), 0.45);
    opacity: 0;
    rotate: -9deg;
    animation: mn-sonar-ring 7.5s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}

.mn-sonar:nth-child(3) { animation-delay: 2.5s; }
.mn-sonar:nth-child(4) { animation-delay: 5s; }

@keyframes mn-sonar-ring {
    0% { transform: scale(0.9); opacity: 0; }
    15% { opacity: 0.55; }
    100% { transform: scale(2.3); opacity: 0; }
}

/* The museum: the lit ring filling the stage, the mark standing in its
   void, and a beam of light travelling round the script windows - the
   same beam as the room's ring (.mn-torus-light in future-atmos.css). */
.mn-hero-torus {
    position: absolute;
    inset: 0;
    background: var(--mn-torus) center / contain no-repeat;
    opacity: 0.62;
}

.mn-hero-beam {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask: var(--mn-torus) center / contain no-repeat;
    mask: var(--mn-torus) center / contain no-repeat;
}

.mn-hero-beam::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 52%;
    width: 120%;
    aspect-ratio: 1;
    translate: -50% -50%;
    background: conic-gradient(transparent 0deg, rgba(var(--mn-lumen), 0.95) 26deg, rgba(var(--mn-lumen), 0.15) 56deg, transparent 72deg, transparent 360deg);
    animation: mn-turn 26s linear infinite;
}

/* The void, lit from inside. */
.mn-hero-glow {
    width: 44%;
    aspect-ratio: 720 / 400;
    rotate: -9deg;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(var(--mn-lumen), 0.13), rgba(var(--mn-primary), 0.04) 70%, transparent);
    filter: blur(6px);
}

.mn-hero .mn-mark img {
    display: block;

    width: clamp(9rem, 13.5vw, 15rem);
    height: auto;
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 34px rgba(var(--mn-chrome-mid), 0.28));
}

/* The logo's lockup: the ring, then FUTURE in wide capitals under it. */
.mn-hero-name {
    display: block;
    font-family: var(--mn-font-display);
    font-weight: 400;
    font-size: clamp(1.9rem, 3.3vw, 2.6rem);
    letter-spacing: 0.5em;
    margin-inline-end: -0.5em;
    text-transform: uppercase;
    line-height: 1;
    background: linear-gradient(100deg, rgb(var(--mn-chrome-hi)) 8%, rgb(var(--mn-chrome)) 30%, rgb(var(--mn-chrome-lo)) 56%, rgb(var(--mn-chrome)) 78%, rgb(var(--mn-chrome-hi)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* A hairline of iris light under the name - the horizon the ring stands on. */
.mn-hero-horizon {
    display: block;
    width: min(26rem, 80%);
    height: 1px;
    margin: 2.25rem auto 0;
    background: var(--mn-iris);
    opacity: 0.6;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}

@media (max-width: 880px) {
    .mn-login-sea { display: none; }
    body:has(.mn-login) .mn-room .mn-torus { display: block; }
    .mn-login-form { flex-basis: 100%; background: rgba(4, 6, 12, 0.35); border: 0; }
    .mn-login-form .mn-brand--inline { display: flex; margin-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .mn-card,
    .mn-card::after,
    .mn-login-form-inner,
    .mn-hero,
    .mn-hero-beam::before,
    .mn-sonar {
        animation: none !important;
    }
}
