/* Shared layout and accessibility refinements for the BDS site. */
:root {
    --site-accent: #315fe8;
    --site-ink: #243047;
    --site-muted: #65738b;
    --site-surface: #fff;
    --site-border: rgba(125, 142, 170, .24);
    scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
body { min-width: 320px; }
img, svg, video, canvas, iframe { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }
input, select, textarea { min-width: 0; }
pre, code { overflow-wrap: anywhere; }
table { max-width: 100%; }

a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a, button { transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 3px;
    scroll-margin-top: 6rem;
}

.site-skip-link {
    position: fixed; z-index: 12000; top: 10px; left: 10px; transform: translateY(-160%);
    padding: .75rem 1rem; border-radius: .75rem; background: #17243a; color: #fff; font-weight: 700;
}
.site-skip-link:focus { transform: translateY(0); color: #fff; }

.site-scroll-progress { position: fixed; inset: 0 0 auto; z-index: 11000; height: 3px; pointer-events: none; background: transparent; }
.site-scroll-progress span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #05c7e8, #315fe8, #9a4dff); transform: scaleX(0); transform-origin: left center; }

.site-menu-backdrop { display: none; position: fixed; inset: 0; z-index: 5900; width: 100%; height: 100%; border: 0; background: rgba(10, 17, 30, .56); }
body.site-menu-open { overflow: hidden; }
body.site-menu-open .site-menu-backdrop { display: block; }
.admin-menu .mobile-toggle { display: none !important; }

.dashboard-content-shell { min-width: 0; overflow-x: clip; }
.dashboard-content-shell .row, .dashboard-content-shell [class*="col-"] { min-width: 0; }
.dashboard-content-shell .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dashboard-content-shell table:not(.table-responsive table) { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dashboard-content-shell canvas { max-width: 100% !important; }
.dashboard-content-shell h1, .dashboard-content-shell h2, .dashboard-content-shell h3, .dashboard-content-shell h4,
.dashboard-content-shell p, .dashboard-content-shell a, .dashboard-content-shell label, .dashboard-content-shell td,
.dashboard-content-shell th, .dashboard-content-shell .btn { overflow-wrap: anywhere; }

.site-footer { width: 100%; padding: 18px clamp(14px, 3vw, 38px); color: #78869e; font-size: .88rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; max-width: 1680px; margin: 0 auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--site-accent); text-decoration: underline; }
[data-bs-theme="dark"] .site-footer { color: #a8b3c5; }

.site-floating-contact, .site-back-to-top {
    position: fixed; z-index: 1000; right: 18px; display: inline-flex; align-items: center; justify-content: center;
    min-height: 46px; border: 0; border-radius: 999px; box-shadow: 0 8px 28px rgba(17, 32, 62, .2);
}
.site-floating-contact { bottom: 76px; gap: 9px; padding: 0 16px; background: var(--site-accent); color: #fff; font-weight: 700; text-decoration: none; }
.site-floating-contact:hover { background: #2149c4; color: #fff; transform: translateY(-2px); }
.site-back-to-top { bottom: 18px; width: 46px; height: 46px; color: #fff; background: #17243a; opacity: 0; visibility: hidden; transform: translateY(8px); cursor: pointer; }
.site-back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.site-back-to-top:hover { background: var(--site-accent); transform: translateY(-2px); }

.site-cookie-banner {
    position: fixed; z-index: 12000; right: 16px; bottom: 16px; left: 16px; display: flex; align-items: center; justify-content: space-between;
    gap: 18px; max-width: 880px; margin: 0 auto; padding: 18px; border: 1px solid var(--site-border); border-radius: 16px;
    background: var(--site-surface); color: var(--site-ink); box-shadow: 0 18px 60px rgba(13, 27, 51, .25);
}
.site-cookie-banner[hidden] { display: none !important; }
.site-cookie-banner p { margin: 5px 0 0; color: var(--site-muted); font-size: .92rem; }
.site-cookie-banner a { color: var(--site-accent); }
.site-cookie-banner__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.site-cookie-banner button { min-height: 42px; padding: 8px 13px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.site-button-primary { border: 1px solid var(--site-accent); background: var(--site-accent); color: #fff; }
.site-button-secondary { border: 1px solid var(--site-border); background: transparent; color: inherit; }

.site-message { position: fixed; z-index: 13000; top: 16px; right: 16px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 17px; border-radius: 12px; background: #17243a; color: #fff; box-shadow: 0 12px 36px rgba(0,0,0,.22); opacity: 0; visibility: hidden; transform: translateY(-8px); }
.site-message.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.site-message.is-error { background: #a82c38; }
.site-message.is-success { background: #14774e; }

.site-legal-page { max-width: 980px; margin: 0 auto; padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 38px); }
.site-legal-page h1 { margin-bottom: .4rem; font-size: clamp(2rem, 5vw, 3.25rem); }
.site-legal-page h2 { margin-top: 2rem; font-size: clamp(1.25rem, 3vw, 1.6rem); }
.site-legal-page p, .site-legal-page li { line-height: 1.7; }
.site-legal-page .site-updated { color: var(--site-muted); }
body[data-bs-theme="dark"] .site-legal-page { color: #e7ecf5; }
body[data-bs-theme="dark"] .site-legal-page .site-updated { color: #a8b3c5; }

.site-footer__settings { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.site-theme-toggle { position: fixed; z-index: 1000; right: 18px; bottom: 132px; min-height: 42px; padding: 0 14px; border: 1px solid var(--site-border); border-radius: 999px; background: var(--site-surface); color: var(--site-ink); box-shadow: 0 8px 28px rgba(17,32,62,.16); font-weight: 700; cursor: pointer; }
.site-theme-toggle:hover { border-color: var(--site-accent); color: var(--site-accent); transform: translateY(-2px); }
body[data-bs-theme="dark"] .site-theme-toggle { background: #1d2635; color: #e7ecf5; }
:root[data-bs-theme="dark"] { --site-ink: #e7ecf5; --site-muted: #a8b3c5; --site-surface: #1d2635; --site-border: rgba(213, 223, 240, .2); }
.nftmax-header { position: sticky; top: 0; z-index: 1035; }
.site-password-positioner { position: relative; }
.site-password-input { padding-right: 4.7rem !important; }
.site-password-toggle { position: absolute; right: 8px; z-index: 4; transform: translateY(-50%); min-width: 48px; min-height: 32px; padding: 4px 9px; border: 1px solid var(--site-border); border-radius: 8px; background: var(--site-surface); color: var(--site-ink); font-size: .82rem; font-weight: 700; cursor: pointer; }
.site-password-toggle--group { position: static; transform: none; min-height: 38px; border-radius: 0 8px 8px 0; }
details > summary { cursor: pointer; }
details > summary:focus-visible { outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
    .site-loading-indicator { animation: site-spin .8s linear infinite; }
}
@keyframes site-spin { to { transform: rotate(360deg); } }

@media (max-width: 1278px) {
    #dashboardNavigation {
        position: fixed !important; inset: 0 auto 0 0; z-index: 6000; width: min(86vw, 300px) !important;
        height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
        transform: translateX(-105%); visibility: hidden; transition: transform .24s ease, visibility .24s ease;
    }
    body.site-menu-open #dashboardNavigation { transform: translateX(0); visibility: visible; }
    #dashboardNavigation .admin-menu { min-height: 100%; }
    #dashboardNavigation .logo { position: relative; align-items: center; padding-right: 52px; }
    #dashboardNavigation.nftmax-close .mobile-toggle {
        position: absolute; top: 14px; right: 10px; z-index: 2; display: inline-flex !important;
        align-items: center; justify-content: center; width: 42px; height: 42px; min-width: 42px; padding: 0;
        border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.07);
        box-shadow: 0 6px 18px rgba(0,0,0,.18); cursor: pointer; transition: background .18s ease, transform .18s ease, border-color .18s ease;
    }
    #dashboardNavigation.nftmax-close .mobile-toggle:hover { background: rgba(130,92,255,.2); border-color: rgba(174,139,255,.55); transform: translateX(-2px); }
    #dashboardNavigation.nftmax-close .mobile-toggle img { display: block; width: 21px; height: auto; transform: rotate(180deg); }
    #dashboardNavigation.nftmax-close .mobile-toggle:focus-visible { outline: 3px solid #a78bfa !important; outline-offset: 3px; }
    .nftmax-smenu.nftmax-close .logo { margin: 0 0 20px; }
    .site-menu-backdrop { cursor: pointer; }
}
@media (max-width: 767px) {
    .site-footer__inner { align-items: flex-start; flex-direction: column; }
    .site-cookie-banner { right: 10px; bottom: 10px; left: 10px; align-items: stretch; flex-direction: column; gap: 12px; padding: 15px; }
    .site-cookie-banner__actions { display: grid; grid-template-columns: 1fr 1fr; }
    .site-cookie-banner button { padding-inline: 8px; }
    .site-floating-contact { right: 12px; bottom: 72px; min-height: 42px; padding: 0 13px; }
    .site-back-to-top { right: 12px; bottom: 14px; width: 42px; height: 42px; }
    .site-theme-toggle { right: 12px; bottom: 120px; }
    .dashboard-content-shell { width: 100%; }
    .nftmax-header__amount { min-width: 0; max-width: calc(100vw - 150px); }
    .nftmax-header__amount a { min-width: 0; overflow-wrap: anywhere; }
    .site-footer nav { gap: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
    .nftmax-smenu, .nftmax-header, .mode-toggle, .site-scroll-progress, .site-floating-contact,
    .site-back-to-top, .site-cookie-banner, .site-menu-backdrop, .site-footer nav, .site-message,
    .btn, button, .no-print { display: none !important; }
    html, body { max-width: none; overflow: visible !important; background: #fff !important; color: #000 !important; }
    .dashboard-content-shell { max-width: none; padding: 0; border: 0; box-shadow: none !important; overflow: visible; }
    a { color: #000 !important; text-decoration: underline; }
}
