/* =========================================================
   TOKENS & BASE
   ========================================================= */

:root {
    --bg: #0f0f0f;
    --surface: rgba(18, 18, 18, 0.94);
    --surface-soft: rgba(255, 255, 255, 0.03);
    --text: #ffffff;
    --muted: #d7d7d7;
    --border: rgba(255, 255, 255, 0.14);
    --accent: #fff500;
    --accent-text: #111111;
    --container: 1240px;
    --header-height: 72px;
    --radius: 20px;
    --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.28);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Roboto, Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("/assets/img/mdr-background.png");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

main {
    min-height: calc(100vh - var(--header-height));
}

/* =========================================================
   LAYOUT & NAVIGATION
   ========================================================= */

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.site-header-public,
.site-header-dashboard {
    background: rgba(0, 0, 0, 0.94);
}

.header-inner {
    position: relative;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo,
.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img,
.site-logo img,
.footer-logo img {
    display: block;
    width: auto;
}

.logo,
.site-logo {
    padding: 10px 0;
}

.logo img,
.site-logo img {
    height: 36px;
}

.nav-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle-lines {
    width: 18px;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle-lines span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.site-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    padding-top: 12px;
}

.site-nav.is-open {
    display: block;
}

.site-nav-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(10, 10, 10, 0.98);
    box-shadow: var(--shadow-soft);
}

.site-nav-links,
.site-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-nav a,
.site-nav button {
    font-size: 15px;
    line-height: 1.25;
}

.site-nav a {
    display: block;
    padding: 10px 0;
}

.site-nav a.is-active {
    color: var(--accent);
}

.site-nav .button {
    width: 100%;
}

.site-nav-dashboard .site-nav-links a {
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.site-nav-live,
.site-nav-logout {
    display: inline-flex;
    align-items: center;
}

.site-nav-live {
    color: var(--accent);
}

/* =========================================================
   FLASH / TOAST
   ========================================================= */

.auth-flash {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 245, 0, 0.08);
    border: 1px solid rgba(255, 245, 0, 0.18);
    color: #fff;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.auth-flash-error {
    background: rgba(255, 84, 84, 0.12);
    border-color: rgba(255, 84, 84, 0.26);
}

.site-toast-stack {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    left: 16px;
    z-index: 1200;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.auth-flash-toast {
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0 28px;
    color: #cfcfcf;
    font-size: 15px;
}

.site-footer-public,
.site-footer-dashboard {
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.footer-logo img {
    height: 34px;
}

.footer-copy {
    margin: 0;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.footer-nav a {
    color: #cfcfcf;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--accent);
}

@media (min-width: 768px) {
    .site-toast-stack {
        top: calc(var(--header-height) + 16px);
        left: 24px;
        width: min(420px, calc(100vw - 48px));
    }

    .container {
        width: min(calc(100% - 48px), var(--container));
    }

    .logo img,
    .site-logo img {
        height: 40px;
    }

    .footer-inner {
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .nav-toggle {
        display: none;
    }

    .site-nav {
        position: static;
        display: block;
        padding-top: 0;
        margin-left: auto;
    }

    .site-nav-panel {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .site-nav-links {
        flex-direction: row;
        align-items: center;
        gap: 22px;
        min-width: 0;
    }

    .site-nav-actions {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .site-nav a {
        padding: 0;
        text-transform: uppercase;
    }

    .site-nav .button {
        width: auto;
    }

    .site-footer {
        padding: 24px 0;
    }

    .footer-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .footer-brand {
        gap: 10px;
    }
}
/* Flash message close button */
.auth-flash {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.auth-flash > span {
    min-width: 0;
}

.auth-flash button[aria-label="Close"] {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.auth-flash button[aria-label="Close"]:hover,
.auth-flash button[aria-label="Close"]:focus-visible {
    border-color: rgba(255, 245, 0, 0.5);
    background: rgba(255, 245, 0, 0.14);
    color: #fff500;
    transform: translateY(-1px);
    outline: none;
}
