/* ==========================================================================
   MangoDent — "Enamel" auth experience
   Standalone stylesheet. Does not depend on Metronic.

   Light is the default. Dark follows the same `mangodent-theme` preference the
   platform's topbar toggle writes, so the front door matches the app.
   ========================================================================== */

:root {
    /* ---- Brand constants ---- */
    --md-enamel-300: #5eead4;
    --md-enamel-500: #14b8a6;
    --md-enamel-700: #0d9488;
    --md-enamel-900: #0f766e;
    --md-glaze: #ccfbf1;

    --md-font-display: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
    --md-font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
    --md-font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

    --md-ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* ---- LIGHT (default) ---- */
    --md-canvas: #e7f2f0;
    --md-console-bg:
        radial-gradient(90% 55% at 50% 0%, rgba(20, 184, 166, 0.09) 0%, transparent 62%),
        #f3faf9;
    --md-theatre-bg:
        radial-gradient(120% 90% at 18% 8%, rgba(94, 234, 212, 0.38) 0%, transparent 58%),
        radial-gradient(100% 80% at 92% 96%, rgba(20, 184, 166, 0.26) 0%, transparent 60%),
        linear-gradient(145deg, #e4f3f0 0%, #dcefeb 45%, #cfe7e3 100%);

    --md-aurora-a: rgba(20, 184, 166, 0.26);
    --md-aurora-b: rgba(13, 148, 136, 0.22);
    --md-grid: rgba(13, 148, 136, 0.09);

    --md-heading: #02181c;
    --md-text: #12383a;
    --md-text-dim: #4a6b6a;
    --md-text-faint: #6d8b89;

    --md-glass: rgba(255, 255, 255, 0.84);
    --md-glass-edge: rgba(13, 148, 136, 0.2);
    --md-glass-edge-strong: rgba(13, 148, 136, 0.5);
    --md-hairline: rgba(13, 148, 136, 0.22);

    --md-input-bg: #ffffff;
    --md-input-bg-focus: #ffffff;
    --md-autofill: #ffffff;

    --md-accent: var(--md-enamel-700);
    --md-accent-hover: var(--md-enamel-900);
    --md-accent-grad: linear-gradient(115deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%);
    --md-on-accent: #ffffff;
    --md-accent-wash: rgba(13, 148, 136, 0.08);
    --md-accent-wash-strong: rgba(13, 148, 136, 0.16);
    --md-btn-glow: 0 12px 26px -14px rgba(13, 148, 136, 0.8);
    --md-btn-glow-hover: 0 18px 34px -16px rgba(13, 148, 136, 0.9);

    --md-card-shadow:
        0 18px 44px -26px rgba(2, 40, 44, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --md-sheen: linear-gradient(
        90deg,
        transparent 8%,
        rgba(13, 148, 136, 0.35) 38%,
        rgba(94, 234, 212, 0.9) 50%,
        rgba(13, 148, 136, 0.35) 62%,
        transparent 92%
    );
    --md-mark-glow: drop-shadow(0 16px 36px rgba(13, 148, 136, 0.35));

    --md-danger: #be123c;
    --md-danger-wash: rgba(225, 29, 72, 0.09);
    --md-danger-edge: rgba(225, 29, 72, 0.3);
    --md-ok-text: #0f766e;
    --md-ok-wash: rgba(13, 148, 136, 0.1);
    --md-ok-edge: rgba(13, 148, 136, 0.32);

    color-scheme: light;
}

/* ---- DARK (follows the platform's topbar toggle) ---- */
:root[data-md-theme="dark"] {
    --md-canvas: #02080a;
    --md-console-bg:
        radial-gradient(90% 60% at 50% 0%, rgba(20, 184, 166, 0.1) 0%, transparent 60%),
        #02080a;
    --md-theatre-bg:
        radial-gradient(120% 90% at 18% 8%, rgba(20, 184, 166, 0.16) 0%, transparent 55%),
        radial-gradient(100% 80% at 92% 96%, rgba(13, 148, 136, 0.2) 0%, transparent 58%),
        linear-gradient(145deg, #08181c 0%, #051216 45%, #02080a 100%);

    --md-aurora-a: rgba(94, 234, 212, 0.22);
    --md-aurora-b: rgba(13, 148, 136, 0.26);
    --md-grid: rgba(94, 234, 212, 0.05);

    --md-heading: #ffffff;
    --md-text: #e6f6f3;
    --md-text-dim: #8fb4b1;
    --md-text-faint: #6d9793;

    --md-glass: rgba(11, 34, 40, 0.55);
    --md-glass-edge: rgba(94, 234, 212, 0.16);
    --md-glass-edge-strong: rgba(94, 234, 212, 0.38);
    --md-hairline: rgba(94, 234, 212, 0.18);

    --md-input-bg: rgba(2, 8, 10, 0.55);
    --md-input-bg-focus: rgba(2, 8, 10, 0.75);
    --md-autofill: #061a1e;

    --md-accent: var(--md-enamel-300);
    --md-accent-hover: var(--md-glaze);
    --md-accent-grad: linear-gradient(115deg, #5eead4 0%, #14b8a6 45%, #0d9488 100%);
    --md-on-accent: #01100f;
    --md-accent-wash: rgba(94, 234, 212, 0.08);
    --md-accent-wash-strong: rgba(94, 234, 212, 0.16);
    --md-btn-glow: 0 12px 30px -12px rgba(20, 184, 166, 0.85);
    --md-btn-glow-hover: 0 18px 38px -14px rgba(20, 184, 166, 0.95);

    --md-card-shadow:
        0 26px 70px -24px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --md-sheen: linear-gradient(
        90deg,
        transparent 8%,
        rgba(94, 234, 212, 0.75) 38%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(94, 234, 212, 0.75) 62%,
        transparent 92%
    );
    --md-mark-glow: drop-shadow(0 18px 50px rgba(20, 184, 166, 0.45));

    --md-danger: #fb7185;
    --md-danger-wash: rgba(251, 113, 133, 0.1);
    --md-danger-edge: rgba(251, 113, 133, 0.35);
    --md-ok-text: #ccfbf1;
    --md-ok-wash: rgba(20, 184, 166, 0.1);
    --md-ok-edge: rgba(20, 184, 166, 0.35);

    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.md-auth {
    margin: 0;
    background: var(--md-canvas);
    color: var(--md-text);
    font-family: var(--md-font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.md-auth a {
    color: var(--md-accent);
    text-decoration: none;
    transition: color 0.2s var(--md-ease);
}

.md-auth a:hover {
    color: var(--md-accent-hover);
}

.md-auth :focus-visible {
    outline: 2px solid var(--md-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.md-shell {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   Theatre — the ambient half
   -------------------------------------------------------------------------- */

.md-theatre {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
    padding: 40px 52px;
    overflow: hidden;
    background: var(--md-theatre-bg);
    border-right: 1px solid var(--md-glass-edge);
}

/* Drifting aurora, tinted with the enamel gradient */
.md-theatre::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(closest-side, var(--md-aurora-a), transparent 70%) 22% 30% / 55% 55% no-repeat,
        radial-gradient(closest-side, var(--md-aurora-b), transparent 70%) 78% 72% / 60% 60% no-repeat;
    filter: blur(28px);
    animation: md-drift 26s var(--md-ease) infinite alternate;
    pointer-events: none;
}

/* Faint clinical grid, so the glass has something to refract */
.md-theatre::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--md-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--md-grid) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(90% 70% at 50% 45%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(90% 70% at 50% 45%, #000 20%, transparent 78%);
    pointer-events: none;
}

@keyframes md-drift {
    from {
        transform: translate3d(-3%, -2%, 0) scale(1);
    }
    to {
        transform: translate3d(4%, 3%, 0) scale(1.08);
    }
}

.md-theatre > * {
    position: relative;
    z-index: 2;
}

/* --------------------------------------------------------------------------
   Signature — the diagnostic ring
   -------------------------------------------------------------------------- */

.md-diagnostic {
    display: grid;
    place-items: center;
    align-self: center;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 40vh;
    aspect-ratio: 1;
    transition: transform 0.4s var(--md-ease);
}

.md-diagnostic > * {
    grid-area: 1 / 1;
}

.md-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px dashed var(--md-glass-edge-strong);
    opacity: 0.75;
    animation: md-spin 90s linear infinite;
}

.md-ring--mid {
    width: 78%;
    height: 78%;
    opacity: 0.55;
    animation-duration: 62s;
    animation-direction: reverse;
}

.md-ring--inner {
    width: 56%;
    height: 56%;
    opacity: 0.4;
    animation-duration: 120s;
}

/* A single tick that orbits the outer ring — the "scan" */
.md-ring--outer {
    position: relative;
}

.md-ring--outer::after {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: var(--md-enamel-500);
    box-shadow: 0 0 14px 3px var(--md-glass-edge-strong);
}

@keyframes md-spin {
    to {
        transform: rotate(360deg);
    }
}

.md-diagnostic__mark {
    width: 46%;
    height: auto;
    filter: var(--md-mark-glow);
    animation: md-breathe 7s ease-in-out infinite;
}

/* The badge reads on a light field; the bare glyph glows on a dark one. */
.md-diagnostic__mark--dark {
    display: none;
}

:root[data-md-theme="dark"] .md-diagnostic__mark--light {
    display: none;
}

:root[data-md-theme="dark"] .md-diagnostic__mark--dark {
    display: block;
}

@keyframes md-breathe {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.035);
        opacity: 1;
    }
}

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

.md-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--md-heading);
}

.md-lockup:hover {
    color: var(--md-heading);
}

.md-lockup__mark {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    filter: drop-shadow(0 4px 14px rgba(13, 148, 136, 0.3));
}

.md-lockup__word {
    font-family: var(--md-font-display);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
}

.md-lockup__word em {
    font-style: normal;
    color: var(--md-accent);
}

.md-lockup__sub {
    display: block;
    margin-top: 4px;
    font-family: var(--md-font-mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--md-text-faint);
}

/* --------------------------------------------------------------------------
   Theatre copy
   -------------------------------------------------------------------------- */

.md-theatre__copy {
    max-width: 36ch;
}

.md-theatre__title {
    margin: 0 0 12px;
    font-family: var(--md-font-display);
    font-size: clamp(1.65rem, 2.1vw, 2.2rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--md-heading);
}

.md-theatre__title em {
    font-style: normal;
    background: linear-gradient(115deg, var(--md-enamel-500), var(--md-enamel-900));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.md-theatre__lede {
    margin: 0;
    color: var(--md-text-dim);
    font-size: 15px;
    max-width: 38ch;
}

/* Mono readout strip — the instrument panel footer */
.md-readout {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    padding-top: 22px;
    border-top: 1px dashed var(--md-hairline);
    font-family: var(--md-font-mono);
}

.md-readout__item dt {
    margin: 0 0 4px;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--md-text-faint);
}

.md-readout__item dd {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-accent);
}

.md-theatre__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12.5px;
    color: var(--md-text-faint);
}

.md-theatre__foot a {
    color: var(--md-text-dim);
}

.md-theatre__foot nav {
    display: flex;
    gap: 20px;
}

/* --------------------------------------------------------------------------
   Console — the form half
   -------------------------------------------------------------------------- */

.md-console {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    background: var(--md-console-bg);
}

.md-console__inner {
    width: 100%;
    max-width: 432px;
}

/* Mobile-only brand band */
.md-console__brand {
    display: none;
    justify-content: center;
    margin-bottom: 32px;
}

/* --------------------------------------------------------------------------
   Glass card
   -------------------------------------------------------------------------- */

.md-card {
    position: relative;
    padding: 38px 36px 34px;
    border-radius: 22px;
    background: var(--md-glass);
    border: 1px solid var(--md-glass-edge);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
    box-shadow: var(--md-card-shadow);
    animation: md-rise 0.7s var(--md-ease) both;
}

/* Enamel sheen along the top edge — lifted from the mark's glaze highlight */
.md-card::before {
    content: "";
    position: absolute;
    inset: -1px -1px auto;
    height: 1px;
    border-radius: 22px 22px 0 0;
    background: var(--md-sheen);
}

@keyframes md-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.md-card__head {
    margin-bottom: 28px;
}

.md-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    font-family: var(--md-font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--md-accent);
}

/* Miniature of the diagnostic ring, reused as the eyebrow bullet */
.md-eyebrow::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px dashed var(--md-accent);
    animation: md-spin 6s linear infinite;
}

.md-card__title {
    margin: 0 0 8px;
    font-family: var(--md-font-display);
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.12;
    color: var(--md-heading);
}

.md-card__sub {
    margin: 0;
    font-size: 14px;
    color: var(--md-text-dim);
}

.md-card__note {
    margin-bottom: 22px;
}

/* Breathing room where a field group runs straight into the submit button */
.md-gap {
    height: 8px;
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */

.md-field {
    margin-bottom: 18px;
}

.md-field__label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--md-font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--md-text-dim);
}

.md-field__control {
    position: relative;
}

.md-input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--md-font-body);
    font-size: 15px;
    color: var(--md-text);
    background: var(--md-input-bg);
    border: 1px solid var(--md-glass-edge);
    border-radius: 12px;
    transition:
        border-color 0.2s var(--md-ease),
        box-shadow 0.2s var(--md-ease),
        background-color 0.2s var(--md-ease);
    appearance: none;
}

.md-input::placeholder {
    color: var(--md-text-faint);
}

.md-input:hover {
    border-color: var(--md-glass-edge-strong);
}

.md-input:focus {
    outline: none;
    background: var(--md-input-bg-focus);
    border-color: var(--md-glass-edge-strong);
    box-shadow: 0 0 0 4px var(--md-accent-wash);
}

/* The scan line: sweeps once beneath the field when it takes focus */
.md-field__control::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--md-accent), transparent);
    transform: scaleX(0);
    opacity: 0;
    transition: transform 0.45s var(--md-ease), opacity 0.45s var(--md-ease);
}

.md-field__control:focus-within::after {
    transform: scaleX(1);
    opacity: 1;
}

.md-input:-webkit-autofill,
.md-input:-webkit-autofill:hover,
.md-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--md-text);
    -webkit-box-shadow: inset 0 0 0 1000px var(--md-autofill);
    caret-color: var(--md-text);
}

.md-input.is-invalid {
    border-color: var(--md-danger-edge);
}

.md-field__error {
    display: block;
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--md-danger);
}

/* Password visibility toggle */
.md-reveal {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--md-text-faint);
    background: none;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: color 0.2s var(--md-ease), background-color 0.2s var(--md-ease);
}

.md-reveal:hover {
    color: var(--md-accent);
    background: var(--md-accent-wash);
}

.md-reveal svg {
    width: 18px;
    height: 18px;
}

.md-field__control:has(.md-reveal) .md-input {
    padding-right: 48px;
}

/* --------------------------------------------------------------------------
   Meta row + actions
   -------------------------------------------------------------------------- */

.md-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 24px;
    font-size: 13.5px;
}

.md-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--md-text-dim);
    cursor: pointer;
    user-select: none;
}

.md-check input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: none;
    width: 17px;
    height: 17px;
    margin: 0;
    background: var(--md-input-bg);
    border: 1px solid var(--md-glass-edge-strong);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.18s var(--md-ease), border-color 0.18s var(--md-ease);
}

.md-check input:hover {
    border-color: var(--md-accent);
}

.md-check input:checked {
    background: var(--md-accent-grad);
    border-color: transparent;
}

/* Checkmark */
.md-check input:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 5.5px;
    width: 4px;
    height: 8px;
    border: solid var(--md-on-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(42deg);
}

.md-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 22px;
    font-family: var(--md-font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--md-on-accent);
    background: var(--md-accent-grad);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--md-btn-glow);
    transition: transform 0.2s var(--md-ease), box-shadow 0.2s var(--md-ease);
}

/* Enamel sheen sweep on hover */
.md-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-18deg);
    transition: left 0.65s var(--md-ease);
}

.md-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--md-btn-glow-hover);
}

.md-btn:hover::after {
    left: 120%;
}

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

.md-btn__arrow {
    width: 17px;
    height: 17px;
    transition: transform 0.25s var(--md-ease);
}

.md-btn:hover .md-btn__arrow {
    transform: translateX(3px);
}

/* The button style used on an anchor must beat the global link colour */
.md-auth a.md-btn {
    color: var(--md-on-accent);
    text-decoration: none;
}

.md-btn--ghost,
.md-auth a.md-btn--ghost {
    color: var(--md-accent);
    background: var(--md-accent-wash);
    border: 1px solid var(--md-glass-edge);
    box-shadow: none;
}

.md-btn--ghost:hover {
    background: var(--md-accent-wash-strong);
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Card footer + alerts
   -------------------------------------------------------------------------- */

.md-card__foot {
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px dashed var(--md-hairline);
    font-size: 13.5px;
    color: var(--md-text-dim);
    text-align: center;
}

.md-alert {
    display: flex;
    gap: 11px;
    margin-bottom: 22px;
    padding: 13px 15px;
    font-size: 13.5px;
    line-height: 1.5;
    border-radius: 12px;
    border: 1px solid;
}

.md-alert--ok {
    color: var(--md-ok-text);
    background: var(--md-ok-wash);
    border-color: var(--md-ok-edge);
}

.md-alert--bad {
    color: var(--md-danger);
    background: var(--md-danger-wash);
    border-color: var(--md-danger-edge);
}

.md-alert ul {
    margin: 0;
    padding-left: 18px;
}

.md-alert__icon {
    flex: none;
    width: 17px;
    height: 17px;
    margin-top: 2px;
}

/* Console footer, shown when the theatre is hidden */
.md-console__foot {
    display: none;
    margin-top: 28px;
    font-size: 12.5px;
    color: var(--md-text-faint);
    text-align: center;
}

.md-console__foot nav {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Landing gate — the public front door at /
   -------------------------------------------------------------------------- */

.md-gate {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 36px 40px;
    overflow: hidden;
    background: var(--md-theatre-bg);
}

.md-gate::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--md-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--md-grid) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: radial-gradient(80% 60% at 50% 40%, #000 15%, transparent 80%);
    -webkit-mask-image: radial-gradient(80% 60% at 50% 40%, #000 15%, transparent 80%);
    pointer-events: none;
}

.md-gate > * {
    position: relative;
    z-index: 2;
}

.md-gate__main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 0;
}

.md-diagnostic--sm {
    flex: none;
    width: min(230px, 46vw);
    max-height: none;
    margin-bottom: 30px;
}

.md-gate__title {
    margin: 0 0 16px;
    font-family: var(--md-font-display);
    font-size: clamp(2rem, 4.4vw, 3.2rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.035em;
    color: var(--md-heading);
    max-width: 16ch;
}

.md-gate__title em {
    font-style: normal;
    background: linear-gradient(115deg, var(--md-enamel-500), var(--md-enamel-900));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.md-gate__lede {
    margin: 0 0 34px;
    max-width: 52ch;
    color: var(--md-text-dim);
    font-size: 16px;
}

.md-gate__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.md-gate__actions .md-btn {
    width: auto;
    min-width: 190px;
}

.md-gate__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    align-items: baseline;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--md-text-faint);
}

.md-gate__foot a {
    color: var(--md-text-dim);
}

.md-gate__foot nav {
    display: flex;
    gap: 20px;
}

@media (max-width: 600px) {
    .md-gate {
        padding: 28px 20px;
    }

    .md-gate__foot {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .md-gate__actions .md-btn {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .md-theatre {
        padding: 36px 40px;
    }

    .md-console {
        padding: 40px 32px;
    }
}

@media (max-width: 920px) {
    .md-shell {
        grid-template-columns: 1fr;
    }

    .md-theatre {
        display: none;
    }

    .md-console {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 40px 20px 32px;
        background: var(--md-theatre-bg);
    }

    .md-console__brand,
    .md-console__foot {
        display: flex;
    }

    .md-console__foot {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .md-card {
        padding: 30px 22px 26px;
        border-radius: 18px;
    }

    .md-card__title {
        font-size: 1.6rem;
    }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .md-auth *,
    .md-auth *::before,
    .md-auth *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .md-theatre::before {
        animation: none;
    }
}
