:root {
    --smartkey-gold: #f6c43d;
    --smartkey-gold-bright: #ffe36c;
    --smartkey-ink: #03050a;
    --smartkey-panel: rgba(3, 5, 10, 0.94);
}

.smartkey-brand-surface {
    background: var(--smartkey-panel);
    border: 1px solid rgba(246, 196, 61, 0.28);
    box-shadow: 0 14px 38px rgba(3, 5, 10, 0.3), 0 0 28px rgba(246, 196, 61, 0.12);
}

.smartkey-app-logo,
.smartkey-header-logo,
.smartkey-splash-logo {
    display: block;
    height: auto;
    object-fit: contain;
}

.smartkey-app-logo {
    width: clamp(7.5rem, 30vw, 11rem);
    aspect-ratio: 1;
    border-radius: 22%;
}

.smartkey-header-logo {
    width: min(100%, 18rem);
    max-height: 5.25rem;
}

.smartkey-mini-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 24%;
}

.smartkey-app-header {
    min-height: 76px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-bottom: 1px solid rgba(246, 196, 61, 0.18);
    background: linear-gradient(135deg, rgba(3, 5, 10, 0.98), rgba(17, 20, 27, 0.94));
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.025), 0 12px 28px rgba(3,5,10,.16);
}

.smartkey-app-header .smartkey-header-logo {
    width: min(100%, 205px);
    max-height: 56px;
    filter: drop-shadow(0 5px 14px rgba(246,196,61,.14));
}

.smartkey-app-header .smartkey-header-icon {
    display: none;
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(246,196,61,.24), 0 7px 18px rgba(0,0,0,.3);
}

#sidebar.sidebar-collapsed .smartkey-app-header {
    min-height: 70px;
    padding: 12px;
}

#sidebar.sidebar-collapsed .smartkey-app-header .smartkey-header-logo { display: none; }
#sidebar.sidebar-collapsed .smartkey-app-header .smartkey-header-icon { display: block; }

html[data-theme="light"] .smartkey-app-header {
    border-bottom-color: rgba(180, 126, 8, 0.2);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.06), 0 10px 24px rgba(15,23,42,.12);
}

@media (max-width: 380px) {
    .smartkey-app-header { min-height: 68px; padding: 10px 16px; }
    .smartkey-app-header .smartkey-header-logo { width: min(100%, 180px); max-height: 48px; }
}

.smartkey-loader {
    --loader-bg: #03050a;
    isolation: isolate;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, rgba(246, 196, 61, 0.12), transparent 30%), radial-gradient(circle at 10% 15%, rgba(255, 227, 108, 0.07), transparent 24%), linear-gradient(145deg, #020307 0%, var(--loader-bg) 45%, #0d0a03 100%);
}

.smartkey-loader::before {
    content: "";
    position: absolute;
    inset: -60%;
    z-index: -2;
    background: conic-gradient(from 0deg, transparent 0 37%, rgba(246, 196, 61, 0.14) 46%, transparent 55% 100%);
    animation: smartkey-aurora 7s linear infinite;
}

.smartkey-loader::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.2;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 70%);
    mask-image: radial-gradient(circle at center, black, transparent 70%);
}

.smartkey-loader-stage {
    position: relative;
    width: clamp(12rem, 45vw, 17rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.smartkey-loader-ring {
    position: absolute;
    inset: 3%;
    border-radius: 50%;
    border: 1px solid rgba(246, 196, 61, 0.16);
    animation: smartkey-ring-spin 5s linear infinite;
}

.smartkey-loader-ring::before,
.smartkey-loader-ring::after {
    content: "";
    position: absolute;
    border-radius: inherit;
}

.smartkey-loader-ring::before {
    inset: -2px;
    border-top: 2px solid var(--smartkey-gold-bright);
    border-right: 2px solid transparent;
    filter: drop-shadow(0 0 9px var(--smartkey-gold));
}

.smartkey-loader-ring::after {
    inset: 12%;
    border-left: 1px solid rgba(255,255,255,.45);
    border-bottom: 1px solid rgba(246,196,61,.35);
    animation: smartkey-ring-spin 2.8s linear infinite reverse;
}

.smartkey-loader-logo-wrap {
    position: relative;
    width: 72%;
    padding: 5%;
    border-radius: 26%;
    background: rgba(3, 5, 10, 0.82);
    box-shadow: 0 0 50px rgba(246,196,61,.24), inset 0 0 0 1px rgba(255,255,255,.08);
    animation: smartkey-logo-float 2.6s ease-in-out infinite;
}

.smartkey-loader-logo-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.24) 48%, transparent 70%);
    transform: translateX(-145%);
    animation: smartkey-logo-sheen 2.4s ease-in-out infinite;
    pointer-events: none;
}

.smartkey-loader-copy {
    margin-top: .4rem;
    color: #fff;
    text-align: center;
    letter-spacing: .08em;
}

.smartkey-loader-copy strong {
    display: block;
    font-size: clamp(1rem, 4vw, 1.35rem);
    font-weight: 800;
}

.smartkey-loader-copy span {
    display: block;
    margin-top: .45rem;
    color: var(--smartkey-gold);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .32em;
    text-transform: uppercase;
}

.smartkey-loader-progress {
    position: relative;
    width: min(13rem, 58vw);
    height: 3px;
    margin-top: 1.65rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.09);
}

.smartkey-loader-progress::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--smartkey-gold), #fff4b3, var(--smartkey-gold), transparent);
    animation: smartkey-progress 1.65s cubic-bezier(.65,0,.35,1) infinite;
    box-shadow: 0 0 14px rgba(246,196,61,.85);
}

@keyframes smartkey-aurora { to { transform: rotate(360deg); } }
@keyframes smartkey-ring-spin { to { transform: rotate(360deg); } }
@keyframes smartkey-logo-float { 0%,100% { transform: translateY(2px) scale(.98); } 50% { transform: translateY(-5px) scale(1.02); } }
@keyframes smartkey-logo-sheen { 0%,30% { transform: translateX(-145%); } 70%,100% { transform: translateX(145%); } }
@keyframes smartkey-progress { 0% { transform: translateX(-105%); } 100% { transform: translateX(105%); } }

@media (prefers-reduced-motion: reduce) {
    .smartkey-loader::before,
    .smartkey-loader-ring,
    .smartkey-loader-ring::after,
    .smartkey-loader-logo-wrap,
    .smartkey-loader-logo-wrap::after,
    .smartkey-loader-progress::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
