/* Extracted from base.html so the browser can cache it instead of
   re-downloading it inside every page. Order is unchanged. */

html, body {
            margin: 0;
            padding: 0;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background:
                radial-gradient(circle at 15% 5%, rgba(255, 60, 255, 0.14), transparent 24%),
                radial-gradient(circle at 88% 6%, rgba(124, 58, 237, 0.18), transparent 30%),
                linear-gradient(180deg, #050008, #07000d 58%, #030005);
            color: #ffffff;
        }

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

        * {
            min-width: 0;
        }

        img,
        picture,
        video,
        canvas,
        svg {
            max-width: 100%;
        }

        img,
        video {
            height: auto;
        }

        a:not(.btn):not(.btn-primary):not(.btn-secondary) { text-decoration: none; color: inherit; }

        .site-header {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            align-items: center;
            gap: 0.8rem 1.4rem;
            padding: 0.65rem 1.25rem 0.75rem;
            background:
                radial-gradient(circle at 15% 0, rgba(255, 60, 255, 0.15), transparent 34%),
                linear-gradient(180deg, rgba(0, 0, 0, 0.94), rgba(5, 0, 8, 0.84));
            border-bottom: 1px solid rgba(255, 60, 255, 0.22);
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58), 0 0 34px rgba(124, 58, 237, 0.18);
            backdrop-filter: blur(12px);
            position: sticky;
            top: 0;
            z-index: 50;
        }

        .brand { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }

        .brand-mark {
            display: flex; align-items: center; justify-content: center;
            width: 54px; height: 54px; flex: 0 0 54px;
        }

        .brand-logo {
            width: 54px; height: 54px; object-fit: contain;
            display: block;
            filter: drop-shadow(0 6px 14px rgba(76, 56, 140, 0.22));
        }

        .brand-text { display: flex; flex-direction: column; line-height: 1.1; }

        .brand-title {
            font-size: 1.35rem;
            font-weight: 800;
            letter-spacing: 0.2px;
            color: #ffffff;
            text-transform: uppercase;
            text-shadow: 0 0 12px rgba(255, 255, 255, 0.34), 0 0 22px rgba(255, 60, 255, 0.72);
        }

        .brand-tagline { font-size: 0.8rem; color: #e9d5ff; }

        .main-nav {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 0.18rem;
            min-width: 0;
            flex-wrap: wrap;
        }

        .nav-group {
            display: flex;
            align-items: center;
            gap: 0.18rem;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
        }

        .nav-group-account {
            background: transparent;
            border-color: transparent;
        }

        .main-nav a {
            display: inline-flex; align-items: center; justify-content: center;
            min-height: 38px;
            padding: 0.42rem 0.58rem;
            border-radius: 0;
            font-size: 0.86rem;
            font-weight: 800;
            color: #e9d5ff;
            white-space: nowrap;
            transition: color 0.15s ease, border-color 0.15s ease;
            border-bottom: 2px solid transparent;
        }

        .main-nav a:hover {
            color: #ffffff;
            border-bottom-color: #ff3cff;
        }

        .main-nav .nav-emphasis {
            background: transparent;
            color: #ffffff;
        }

        .main-nav .nav-emphasis:hover {
            background: transparent;
            color: #ffffff;
        }

        .main-nav .nav-auth-link {
            border: 1px solid rgba(255, 60, 255, 0.35);
            padding: 0.4rem 0.95rem;
        }

        .main-nav a.nav-active {
            color: #ffffff;
            font-weight: 600;
            background: rgba(255, 60, 255, 0.12);
        }

        .page-main {
            max-width: none;
            margin: 1.5rem 0 2.5rem;
            padding: 0 1rem;
        }

        input,
        select,
        textarea,
        button {
            max-width: 100%;
            font: inherit;
        }

        input,
        select,
        textarea {
            min-height: 44px;
        }

        .logout-form { display: inline; margin: 0; padding: 0; }

        .logout-button {
            display: inline-flex; align-items: center; justify-content: center;
            min-height: 38px;
            padding: 0.42rem 0.58rem; border-radius: 0;
            font-size: 0.86rem; color: #e9d5ff;
            font-weight: 800;
            white-space: nowrap;
            border: none;
            border-bottom: 2px solid transparent;
            background: transparent;
            cursor: pointer;
        }

        .logout-button:hover {
            background: transparent;
            color: #ffffff;
            border-bottom-color: #ff3cff;
        }

        .btn,
        .btn-primary,
        .btn-secondary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.5rem 1.1rem;
            border-radius: 999px;
            border: 1px solid transparent;
            font-size: 0.95rem;
            cursor: pointer;
            text-decoration: none;
            transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.15s ease, border-color 0.15s ease;
            max-width: 100%;
            white-space: normal;
            text-align: center;
        }

        .btn-primary,
        .btn {
            background: linear-gradient(135deg, #9900ff, #d946ef);
            border-color: rgba(255, 216, 255, 0.72);
            color: white;
            box-shadow: 0 0 18px rgba(255, 60, 255, 0.38);
        }

        .btn-primary:hover,
        .btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 0 28px rgba(255, 60, 255, 0.58);
        }

        .btn-secondary {
            background: transparent;
            border-color: rgba(255, 60, 255, 0.42);
            color: #e9d5ff;
        }

        .btn-secondary:hover {
            background: rgba(255, 60, 255, 0.1);
        }

        .site-footer {
            text-align: center;
            padding: 1.8rem 0.75rem 2.2rem;
            font-size: 0.8rem;
            color: #e9d5ff;
            background: linear-gradient(180deg, rgba(5, 0, 8, 0.96), rgba(0, 0, 0, 0.98));
            border-top: 1px solid rgba(255, 60, 255, 0.22);
        }

        .footer-social {
            display: flex;
            justify-content: center;
            gap: 1.2rem;
            margin-bottom: 0.8rem;
        }

        .social-btn {
            width: 60px;
            height: 60px;
            border-radius: 999px;
            background:
                radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.16), transparent 36%),
                rgba(5, 0, 8, 0.78);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 18px rgba(217, 70, 239, 0.42), inset 0 0 14px rgba(217, 70, 239, 0.1);
        }

        .social-icon-vector {
            width: 30px;
            height: 30px;
            display: block;
            overflow: visible;
            filter: drop-shadow(0 0 5px currentColor);
        }

        .social-btn-facebook { color: #7db1ff !important; }
        .social-btn-instagram { color: #ff83dc !important; }
        .social-btn-tiktok { color: #72f7ff !important; }
        .social-btn-email { color: #d8a7ff !important; }

        .footer-text {
            margin-top: 0.4rem;
            font-size: 0.88rem;
            color: #e9d5ff;
        }

        /* page wide white card wrapper */
        .content-card.page-shell {
            background:
                linear-gradient(180deg, rgba(5, 0, 8, 0.86), rgba(12, 0, 20, 0.94)),
                url("/static/dna_portal/witch_lab_page_header_web.webp") center top / cover no-repeat;
            border-radius: 10px;
            padding: 1.5rem 1.75rem;
            box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 60, 255, 0.12);
            border: 1px solid rgba(255, 60, 255, 0.34);
            overflow-wrap: anywhere;
            color: #ffffff;
        }

        table {
            max-width: 100%;
        }

        /* prevent double cards if a page template already uses its own content card */
        .page-shell > .content-card {
            background: transparent;
            border: 0;
            box-shadow: none;
            padding: 0;
        }
        /* ===============================
   MOBILE HEADER UPGRADE
   =============================== */

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

body {
    overflow-x: hidden;
}

/* Safe area padding for iPhone */
.site-header {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
}

/* Hamburger button */
.mobile-menu-btn {
    display: none;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 60, 255, 0.42);
    background: rgba(255, 60, 255, 0.1);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}



/* Mobile panel */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 90;
}

.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(85vw, 360px);
    height: 100vh;
    background: linear-gradient(180deg, rgba(8, 0, 16, 0.98), rgba(5, 0, 8, 0.98));
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-nav-links {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-section {
    display: grid;
    gap: 0.42rem;
}

.mobile-nav-heading {
    padding: 0 0.35rem;
    color: #c77dff;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mobile-nav-links a,
.mobile-nav-links button {
    border-radius: 7px;
    padding: 0.62rem 0.78rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 800;
    background: rgba(217, 70, 239, 0.1);
    border: 1px solid rgba(217, 70, 239, 0.28);
    cursor: pointer;
    width: 100%;
    color: #e9d5ff;
}

.mobile-nav-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-open .mobile-nav-panel {
    display: flex;
    transform: translateX(0);
}

.mobile-nav-open body {
    overflow: hidden;
}

/* MOBILE BREAKPOINT */
@media (max-width: 1180px) {

    .site-header {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .brand-tagline {
        display: none;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .brand {
        gap: 0.55rem;
    }

    .brand-mark,
    .brand-logo {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .brand-title {
        font-size: 1.05rem;
        line-height: 1.05;
    }

    .mobile-menu-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.9rem;
    }

    .page-main {
        margin: 0.75rem 0 1.5rem;
        padding: 0 0.55rem;
    }

    .content-card.page-shell {
        border-radius: 12px;
        padding: 1rem 0.8rem;
    }

    .content-card.page-shell > .content-card {
        margin-left: 0;
        margin-right: 0;
    }

    .page-title {
        font-size: 1.45rem;
        line-height: 1.15;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .btn,
    .btn-primary,
    .btn-secondary,
    button {
        min-height: 44px;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        white-space: normal;
    }

    .footer-social {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}
