/* ==========================================================================
   Midnight storefront theme
   Applied through <html data-theme-style="midnight">. Keeps the admin's
   primary/accent colours and reworks every surface, glow and motion.
   ========================================================================== */

html[data-theme-style="midnight"] {
    --ink: #f4eeff;
    --muted: #b9a9d9;
    --surface: #1b1030;
    --surface-soft: #12031f;
    --line: #34214f;
    --brand-soft: rgba(176, 122, 255, .15);
    --shadow-sm: 0 6px 22px rgba(4, 0, 12, .55);
    --shadow-md: 0 22px 54px rgba(4, 0, 12, .68);
    --mx-stage: #150726;
    --mx-edge: rgba(180, 130, 255, .28);
    --mx-beam: rgba(232, 52, 162, .38);
    --mx-link: color-mix(in srgb, var(--brand-primary) 45%, #ffffff);
    --mx-btn: color-mix(in srgb, var(--brand-primary) 82%, #000000);
    --mx-btn-2: color-mix(in srgb, var(--brand-accent) 82%, #000000);
}

/* Base surfaces */
html[data-theme-style="midnight"] body {
    background-color: var(--surface-soft);
    background-image:
        radial-gradient(900px 520px at 8% -6%, rgba(124, 58, 237, .32), transparent 62%),
        radial-gradient(760px 460px at 96% 4%, var(--mx-beam), transparent 64%),
        radial-gradient(700px 500px at 50% 108%, rgba(56, 189, 248, .12), transparent 60%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--ink);
}
/* Kept at element-level specificity so component classes (.btn, .category-card, .footer-link) still win. */
html:where([data-theme-style="midnight"]) a { color: var(--mx-link); }
html:where([data-theme-style="midnight"]) a:hover { color: color-mix(in srgb, var(--mx-link), #ffffff 22%); }
html[data-theme-style="midnight"] ::selection { background: color-mix(in srgb, var(--brand-accent) 55%, #000); color: #fff; }

/* Buttons */
html[data-theme-style="midnight"] .btn-primary {
    --bs-btn-bg: var(--mx-btn);
    --bs-btn-border-color: transparent;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--mx-btn-2);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--mx-btn);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: var(--mx-btn);
    --bs-btn-disabled-color: #fff;
    background-image: linear-gradient(120deg, var(--mx-btn), var(--mx-btn-2));
    box-shadow: 0 10px 30px color-mix(in srgb, var(--brand-accent) 42%, transparent), 0 0 0 1px var(--mx-edge) inset;
}
html[data-theme-style="midnight"] .btn-primary:hover { box-shadow: 0 16px 40px color-mix(in srgb, var(--brand-accent) 55%, transparent), 0 0 0 1px var(--mx-edge) inset; }
html[data-theme-style="midnight"] .btn-outline-primary {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--mx-edge);
    --bs-btn-hover-bg: var(--brand-soft);
    --bs-btn-hover-border-color: var(--brand-accent);
    --bs-btn-hover-color: var(--ink);
    background: rgba(255, 255, 255, .02);
}
html[data-theme-style="midnight"] .btn-soft { background: var(--brand-soft); color: var(--mx-link); border-color: var(--mx-edge); }
html[data-theme-style="midnight"] .btn-soft:hover { background: color-mix(in srgb, var(--brand-soft), var(--brand-accent) 14%); color: #fff; }
html[data-theme-style="midnight"] .btn-light { background: #fff; color: #17062b; border: 0; }

/* Forms */
html[data-theme-style="midnight"] .form-control,
html[data-theme-style="midnight"] .form-select { background: #170c28; border-color: var(--line); color: var(--ink); }
html[data-theme-style="midnight"] .form-control::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
html[data-theme-style="midnight"] .form-control:focus,
html[data-theme-style="midnight"] .form-select:focus { background: #1a0e2e; color: var(--ink); border-color: var(--brand-accent); box-shadow: 0 0 0 .22rem rgba(180, 130, 255, .18); }
html[data-theme-style="midnight"] .input-group-text { background: #170c28; border-color: var(--line); color: var(--muted); }

/* Cards, tables, chips */
html[data-theme-style="midnight"] .card,
html[data-theme-style="midnight"] .feature-card,
html[data-theme-style="midnight"] .category-card,
html[data-theme-style="midnight"] .service-card,
html[data-theme-style="midnight"] .stat-card,
html[data-theme-style="midnight"] .stat-strip,
html[data-theme-style="midnight"] .hero-card,
html[data-theme-style="midnight"] .hero-mini-stat,
html[data-theme-style="midnight"] .quick-action,
html[data-theme-style="midnight"] .chat-bubble,
html[data-theme-style="midnight"] .auth-card,
html[data-theme-style="midnight"] .dropdown-menu {
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 42%), var(--surface);
    border-color: var(--line);
}
html[data-theme-style="midnight"] .dropdown-item { color: var(--ink); }
html[data-theme-style="midnight"] .dropdown-item:hover { background: var(--brand-soft); color: #fff; }
html[data-theme-style="midnight"] .category-card:hover,
html[data-theme-style="midnight"] .service-card:hover,
html[data-theme-style="midnight"] .feature-card:hover,
html[data-theme-style="midnight"] .stat-card:hover { border-color: var(--mx-edge); box-shadow: 0 18px 44px rgba(4, 0, 12, .6), 0 0 26px color-mix(in srgb, var(--brand-accent) 26%, transparent); }
html[data-theme-style="midnight"] .price-pill,
html[data-theme-style="midnight"] .chip { background: rgba(255, 255, 255, .05); border-color: var(--line); color: var(--muted); }
html[data-theme-style="midnight"] .badge.text-bg-light { background: var(--brand-soft) !important; color: var(--ink) !important; }
html[data-theme-style="midnight"] .accordion-button { background: var(--surface); color: var(--ink); }
html[data-theme-style="midnight"] .accordion-button:not(.collapsed) { background: var(--brand-soft); color: #fff; box-shadow: none; }
html[data-theme-style="midnight"] .accordion-body { color: var(--muted); }
html[data-theme-style="midnight"] .info-banner { color: var(--ink); border-color: var(--mx-edge); background: var(--brand-soft); }
html[data-theme-style="midnight"] .empty-state .empty-icon { background: rgba(255, 255, 255, .05); color: var(--muted); }
html[data-theme-style="midnight"] .progress { background: rgba(255, 255, 255, .08); }
html[data-theme-style="midnight"] .stat-icon { background: var(--brand-soft); color: var(--mx-link); }
html[data-theme-style="midnight"] .stat-icon.success { background: rgba(16, 185, 129, .18); color: #4ade80; }
html[data-theme-style="midnight"] .stat-icon.warning { background: rgba(245, 158, 11, .18); color: #fbbf24; }
html[data-theme-style="midnight"] .stat-icon.danger { background: rgba(239, 68, 68, .18); color: #f97b7b; }
html[data-theme-style="midnight"] .stat-icon.violet { background: rgba(180, 130, 255, .18); color: #c9aaff; }

/* Navigation */
html[data-theme-style="midnight"] .public-nav { background: rgba(18, 4, 31, .74); border-bottom-color: var(--mx-edge); backdrop-filter: blur(16px); }
html[data-theme-style="midnight"] .brand-lockup,
html[data-theme-style="midnight"] .brand-lockup:hover { color: var(--ink); }
html[data-theme-style="midnight"] .brand-mark { box-shadow: 0 10px 26px color-mix(in srgb, var(--brand-accent) 45%, transparent); }
html[data-theme-style="midnight"] .nav-public-link { color: var(--muted); }
html[data-theme-style="midnight"] .nav-public-link:hover,
html[data-theme-style="midnight"] .nav-public-link.active { color: #fff; background: var(--brand-soft); }

/* Footer */
html[data-theme-style="midnight"] .public-footer { background: #0d0117; border-top-color: var(--mx-edge); box-shadow: 0 -1px 0 rgba(232, 52, 162, .22); }
html[data-theme-style="midnight"] .public-footer h6 { color: var(--ink); }
html[data-theme-style="midnight"] .footer-link { color: var(--muted); }
html[data-theme-style="midnight"] .footer-link:hover { color: #fff; }
html[data-theme-style="midnight"] .icon-btn { background: rgba(255, 255, 255, .05); border-color: var(--line); color: var(--muted); }
html[data-theme-style="midnight"] .icon-btn:hover { color: #fff; border-color: var(--mx-edge); background: var(--brand-soft); }

/* Panel + auth chrome */
html[data-theme-style="midnight"] .app-body,
html[data-theme-style="midnight"] .auth-body { background-color: var(--surface-soft); }
html[data-theme-style="midnight"] .app-sidebar { background: #150726; border-right-color: var(--line); }
html[data-theme-style="midnight"] .app-topbar { background: rgba(21, 7, 38, .82); }
html[data-theme-style="midnight"] .sidebar-link { color: var(--muted); }
html[data-theme-style="midnight"] .sidebar-link:hover, html[data-theme-style="midnight"] .sidebar-link.active { color: #fff; }
html[data-theme-style="midnight"] .auth-aside { background: radial-gradient(760px 460px at 18% 8%, var(--mx-beam), transparent 60%), linear-gradient(150deg, #1b1030, #0d0117 70%); }
html[data-theme-style="midnight"] .auth-aside::after { opacity: .22; }
html[data-theme-style="midnight"] .code-block { background: #0d0117; border: 1px solid var(--line); }

/* ==========================================================================
   Midnight hero
   ========================================================================== */
.mx-hero { position: relative; overflow: hidden; padding: 92px 0 78px; }
.mx-hero::before {
    content: ""; position: absolute; inset: -20% -10% auto; height: 620px; pointer-events: none;
    background: radial-gradient(520px 320px at 78% 30%, color-mix(in srgb, var(--brand-accent) 40%, transparent), transparent 70%);
    filter: blur(6px);
}
.mx-hero > .container { position: relative; z-index: 2; }
.mx-pill {
    display: inline-flex; align-items: center; gap: .5rem; padding: .42rem .85rem; border-radius: 100px;
    border: 1px solid var(--mx-edge); background: rgba(255, 255, 255, .05); color: #fff;
    font-size: .74rem; font-weight: 700; letter-spacing: .04em; box-shadow: 0 0 22px rgba(180, 130, 255, .18);
}
.mx-title { font-size: clamp(2.5rem, 5.4vw, 4.4rem); line-height: 1.02; letter-spacing: -.05em; margin: 1.2rem 0 1rem; color: var(--ink); }
.mx-title .mx-grad {
    background: linear-gradient(100deg, var(--mx-link), color-mix(in srgb, var(--brand-accent) 70%, #ff7ad9) 60%, #ff5fb0);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mx-lead { color: var(--muted); font-size: 1.04rem; line-height: 1.75; max-width: 600px; }
.mx-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; font-size: .78rem; color: var(--muted); }
.mx-trust span { display: inline-flex; align-items: center; gap: 8px; }
.mx-trust i { color: var(--mx-link); font-size: 1rem; }
.mx-kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.mx-kpi { min-width: 128px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.mx-kpi strong { display: block; font-size: 1.3rem; letter-spacing: -.04em; color: var(--ink); }
.mx-kpi span { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.mx-stat-disclosure { margin: 12px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.mx-stat-disclosure i { color: var(--mx-link); }

/* Stage: mascot + orbiting social icons */
.mx-stage { position: relative; display: grid; place-items: center; min-height: 420px; }
.mx-stage::before {
    content: ""; position: absolute; width: min(420px, 88%); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--brand-accent) 55%, transparent), transparent 62%);
    filter: blur(30px); opacity: .8;
}
.mx-mascot { position: relative; z-index: 2; width: min(330px, 74%); height: auto; display: block; filter: drop-shadow(0 26px 44px rgba(6, 0, 16, .8)); }
.mx-orbit { position: absolute; z-index: 3; width: min(430px, 96%); aspect-ratio: 1; border-radius: 50%; list-style: none; margin: 0; padding: 0; animation: mx-spin 34s linear infinite; }
.mx-orbit::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--mx-edge); opacity: .7; }
.mx-orbit-item { position: absolute; top: 50%; left: 50%; width: 0; height: 0; transform: rotate(var(--angle, 0deg)) translate(var(--mx-orbit-r, 208px)) rotate(calc(-1 * var(--angle, 0deg))); }
.mx-orbit-icon {
    position: absolute; top: -21px; left: -21px; width: 42px; height: 42px; border-radius: 14px;
    display: grid; place-items: center; font-size: 1.12rem; color: #fff; text-decoration: none;
    background: linear-gradient(150deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04)), var(--mx-stage);
    border: 1px solid var(--mx-edge); box-shadow: 0 12px 26px rgba(5, 0, 14, .7);
    animation: mx-spin 34s linear infinite reverse;
}
.mx-orbit-icon:hover { color: #fff; border-color: color-mix(in srgb, var(--brand-accent) 70%, #fff); box-shadow: 0 0 24px color-mix(in srgb, var(--brand-accent) 60%, transparent); }
@keyframes mx-spin { to { transform: rotate(360deg); } }

/* Floating service card over the stage */
.mx-float { position: absolute; z-index: 4; bottom: 4%; left: 0; width: min(268px, 78%); padding: 14px 16px; border-radius: 16px;
    background: rgba(21, 7, 38, .86); border: 1px solid var(--mx-edge); box-shadow: var(--shadow-md); backdrop-filter: blur(10px);
    animation: mx-bob 6s ease-in-out infinite; }
.mx-float-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.mx-live { display: inline-flex; align-items: center; gap: 6px; color: #7dffb8; }
.mx-live i { width: 7px; height: 7px; border-radius: 50%; background: #7dffb8; box-shadow: 0 0 10px #7dffb8; animation: mx-pulse 1.8s ease-in-out infinite; }
.mx-float-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .82rem; color: var(--ink); }
.mx-float-row i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--mx-link); font-size: .95rem; flex-shrink: 0; }
.mx-float-row small { display: block; color: var(--muted); font-size: .7rem; }
@keyframes mx-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes mx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Marquee */
.mx-marquee { padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .035); }
.mx-marquee .marquee-chip { color: var(--ink); font-size: .84rem; }
.mx-marquee .marquee-chip i { color: var(--mx-link); font-size: 1.25rem; }

/* Section headings */
.mx-eyebrow { font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mx-link); }
.mx-h2 { font-size: clamp(1.8rem, 3.1vw, 2.6rem); letter-spacing: -.045em; color: var(--ink); }
.mx-step { position: relative; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); height: 100%; }
.mx-step::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 3px 0 0 3px; background: linear-gradient(180deg, var(--brand-primary), var(--brand-accent)); }
.mx-step-num { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; font-weight: 800; letter-spacing: .12em; color: var(--mx-link); }
.mx-step h3 { font-size: 1.02rem; margin: 10px 0 8px; color: var(--ink); }
.mx-step p { color: var(--muted); font-size: .82rem; line-height: 1.65; margin: 0; }

/* CTA */
.mx-cta { position: relative; overflow: hidden; border-radius: 26px; padding: clamp(28px, 4vw, 52px); text-align: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 74%, #05010c), color-mix(in srgb, var(--brand-accent) 78%, #05010c));
    box-shadow: 0 30px 70px rgba(6, 0, 16, .7), inset 0 0 0 1px var(--mx-edge); color: #fff; }
.mx-cta::after { content: ""; position: absolute; inset: -40% 30% auto; height: 260px; background: radial-gradient(closest-side, rgba(255, 255, 255, .3), transparent); opacity: .5; }
.mx-cta > * { position: relative; z-index: 1; }
.mx-cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); letter-spacing: -.05em; color: #fff; }
.mx-cta p { color: #fff; opacity: .95; }

/* Social rail glow variant */
html[data-theme-style="midnight"] .social-rail-title { color: var(--ink); }
html[data-theme-style="midnight"] .social-orb { background: rgba(21, 7, 38, .88); border-color: var(--mx-edge); color: #fff; box-shadow: 0 10px 24px rgba(5, 0, 14, .6); }
html[data-theme-style="midnight"] .social-orb:hover, html[data-theme-style="midnight"] .social-orb:focus-visible { background: var(--brand-soft); color: #fff; border-color: var(--mx-link); }
html[data-theme-style="midnight"] .social-orb-label { background: #fff; color: #17062b; }

@media (max-width: 991.98px) {
    .mx-hero { padding: 56px 0 46px; }
    .mx-stage { min-height: 340px; margin-top: 26px; }
    .mx-orbit { width: min(320px, 92%); }
    .mx-orbit-item { transform: rotate(var(--angle, 0deg)) translate(var(--mx-orbit-r, 150px)) rotate(calc(-1 * var(--angle, 0deg))); }
    .mx-float { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mx-orbit, .mx-orbit-icon, .mx-float, .mx-live i { animation: none; }
}
