/* =========================================================================
   Darkxcode Tools Panel Checker — Dashboard styles
   Loaded after Tailwind (CDN). Holds theme variables and custom components.

   Design language: "instrument panel". Graphite + paper surfaces, hairline
   rules, one warm signal accent (amber) reserved for primary action and live
   state. No multi-hue gradients, no blur orbs, no pill-everything.
   ========================================================================= */

:root {
    color-scheme: light;

    --app-bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --surface-raised: #ffffff;

    /* Text ramp — WCAG AA on #ffffff / #f8fafc (ratios noted). */
    --text-primary: #0f172a;    /* slate-900      17.8:1 */
    --text-secondary: #1e293b;  /* slate-800      15.2:1 */
    --text-body: #334155;       /* slate-700      10.1:1 — body copy */
    --text-muted: #475569;      /* slate-600       7.4:1 — labels, meta */
    --text-subtle: #5b6b82;     /* slate-500+      5.0–5.4:1 — smallest text only */
    --text-faint: #5b6b82;      /* placeholders   same ramp */
    --text-heading: var(--text-primary);
    --text: var(--text-secondary);

    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.18);

    --accent: #a25f08;
    --accent-2: #db9c2a;
    --accent-soft: rgba(162, 95, 8, 0.10);
    --accent-text: #834b06;     /* signal-700 on white — 6.6:1 */

    --focus-ring: rgba(162, 95, 8, 0.45);

    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -24px rgba(15, 23, 42, 0.28);
    --shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.04), 0 24px 48px -24px rgba(15, 23, 42, 0.28);
}

html.dark {
    color-scheme: dark;

    --app-bg: #0f172a;
    --surface: #111c33;
    --surface-soft: #16213a;
    --surface-raised: #15203a;

    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --text-subtle: #94a3b8;
    --text-faint: #94a3b8;
    --text-heading: #f1f5f9;
    --text: var(--text-primary);

    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.26);

    --accent: #db9c2a;
    --accent-2: #f3d79c;
    --accent-soft: rgba(219, 156, 42, 0.14);
    --accent-text: #f3d79c;

    --focus-ring: rgba(219, 156, 42, 0.55);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 24px 48px -28px rgba(0, 0, 0, 0.75);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 32px 56px -28px rgba(0, 0, 0, 0.85);
}

/* =========================================================================
   Light-mode contrast enforcement
   Tailwind CDN darkMode:'class' makes `dark:` utilities win over their
   unprefixed twins, so an unprefixed class authored for a dark surface
   (e.g. text-slate-100) silently stays light in light mode. These rules pin
   the common light-surface tokens back to the token ramp. Scoped to
   :root:not(.dark) so dark mode is untouched.
   ========================================================================= */

:root:not(.dark) body.app-body {
    color: var(--text-secondary);
}

:root:not(.dark) h1,
:root:not(.dark) h2,
:root:not(.dark) h3,
:root:not(.dark) h4,
:root:not(.dark) h5,
:root:not(.dark) h6,
:root:not(.dark) legend {
    color: var(--text-heading);
}

/* --- text ramp remap (light surfaces only) ------------------------------- */

:root:not(.dark) .text-slate-100,
:root:not(.dark) .text-gray-100,
:root:not(.dark) .text-slate-200,
:root:not(.dark) .text-gray-200 {
    color: var(--text-primary);
}

:root:not(.dark) .text-slate-300,
:root:not(.dark) .text-gray-300 {
    color: var(--text-secondary);
}

:root:not(.dark) .text-slate-400,
:root:not(.dark) .text-gray-400 {
    color: var(--text-subtle);
}

:root:not(.dark) .placeholder\:text-slate-400::placeholder,
:root:not(.dark) .placeholder\:text-gray-400::placeholder {
    color: var(--text-faint);
}

/* Form controls authored for dark surfaces keep legible text in light mode. */
:root:not(.dark) input,
:root:not(.dark) select,
:root:not(.dark) textarea,
:root:not(.dark) .topbar-search {
    color: var(--text-primary);
}

:root:not(.dark) input:disabled,
:root:not(.dark) select:disabled,
:root:not(.dark) textarea:disabled,
:root:not(.dark) input[readonly] {
    color: var(--text-muted);
    background-color: var(--surface-soft);
}

:root:not(.dark) input::placeholder,
:root:not(.dark) textarea::placeholder {
    color: var(--text-faint);
}

:root:not(.dark) select option {
    background-color: var(--surface);
    color: var(--text-primary);
}

/* --- surfaces ------------------------------------------------------------ */

:root:not(.dark) .bg-white {
    background-color: var(--surface);
}

:root:not(.dark) .bg-white\/85 {
    background-color: rgba(255, 255, 255, 0.92);
}

:root:not(.dark) .bg-slate-50 {
    background-color: var(--surface-soft);
}

:root:not(.dark) .border-slate-200 {
    border-color: var(--border-strong);
}

:root:not(.dark) .border-slate-200\/70,
:root:not(.dark) .border-slate-200\/80 {
    border-color: var(--border);
}

:root:not(.dark) .border-slate-300 {
    border-color: var(--border-strong);
}

/* --- overlays / dropdowns / modals / toasts ------------------------------ */

:root:not(.dark) .dx-overlay {
    background-color: rgba(15, 23, 42, 0.55);
}

:root:not(.dark) .dx-menu,
:root:not(.dark) .dx-modal,
:root:not(.dark) .dx-toast {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-lift);
}

/* Ensure anything that paints as an opaque dark block has readable text. */
:root:not(.dark) pre,
:root:not(.dark) pre *,
:root:not(.dark) pre[class*="text-"] {
    color: #e2e8f0 !important;
}

:root:not(.dark) input[type="file"] {
    color: var(--text-muted);
}

/* ---------------------------------------------------------------- base ---- */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body.app-body {
    min-height: 100vh;
    background-color: var(--app-bg);
    color: var(--text);
    font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 200ms ease, color 200ms ease;
}

[x-cloak] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------- custom scrollbar ---- */

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.4) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.4);
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 116, 139, 0.62);
}

/* ------------------------------------------------------------- topbar ---- */

.app-topbar {
    background-color: var(--surface);
    background-image: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

html:not(.dark) .app-topbar {
    background-color: rgba(255, 255, 255, 0.94);
    border-bottom-color: #e2e8f0;
}

html.dark .app-topbar {
    background-color: rgba(17, 28, 51, 0.86);
}

/* Public navbar: same tokens so it follows the selected mode. */
.app-navbar {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

html:not(.dark) .app-navbar {
    background-color: rgba(255, 255, 255, 0.94);
    border-bottom-color: #e2e8f0;
}

html.dark .app-navbar {
    background-color: rgba(15, 23, 42, 0.86);
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

.topbar-search {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.topbar-search::placeholder {
    color: var(--text-faint);
}

.topbar-search:focus {
    outline: none;
    border-color: rgba(162, 95, 8, 0.55);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    color: var(--text-muted);
    background: transparent;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.icon-button:hover {
    background: var(--accent-soft);
    border-color: var(--border);
    color: var(--text);
}

.icon-button:active {
    transform: scale(0.96);
}

/* ------------------------------------------------------------ sidebar ---- */

/* Grid tracks animate both directions without display:none cutting off close. */
.dx-mobile-nav {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 280ms ease, opacity 220ms ease, visibility 280ms;
}

.dx-mobile-nav.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
}

.dx-mobile-nav-inner { min-height: 0; overflow: hidden; }

#mobile-nav-toggle .nav-line {
    transform-origin: 12px 12px;
    transition: transform 280ms ease, opacity 180ms ease;
}
#mobile-nav-toggle[aria-expanded="true"] .nav-line-top { transform: translateY(5px) rotate(45deg); transform-origin: 12px 7px; }
#mobile-nav-toggle[aria-expanded="true"] .nav-line-middle { opacity: 0; }
#mobile-nav-toggle[aria-expanded="true"] .nav-line-bottom { transform: translateY(-5px) rotate(-45deg); transform-origin: 12px 17px; }

/* .icon-button sets display:inline-flex from this stylesheet, which loads after
   Tailwind and therefore beats .md:hidden / .lg:hidden. These ID rules restore
   the breakpoint behaviour (public navbar switches to hamburger below xl). */
@media (min-width: 1280px) {
    .dx-mobile-nav { display: none; }
    #mobile-nav-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dx-mobile-nav, #mobile-nav-toggle .nav-line { transition: none; }
}

.dx-sidebar {
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.dx-sidebar.is-open {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    #sidebar-toggle, #sidebar-close { display: none; }
    .dx-sidebar {
        transform: none !important;
    }
}

.dx-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.dx-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

body.dx-no-scroll {
    overflow: hidden;
}

.dx-sidebar-nav {
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.dx-sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.32);
}

/* --------------------------------------------------------- components ---- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    color: var(--text-secondary);
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

html:not(.dark) .card {
    border-color: #e2e8f0;
    color: #1e293b;
}

html:not(.dark) .card :where(h1, h2, h3, h4) {
    color: #0f172a;
}

.card-hover:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lift);
    transform: translateY(-2px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease,
        box-shadow 200ms ease, transform 200ms ease, filter 200ms ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    /* Signal amber with ink text — 8.4:1, and the only chromatic control on
       the page, which is what makes it read as the primary action. */
    color: #2b1804;
    background-color: #db9c2a;
    background-image: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 6px 16px -10px rgba(123, 76, 8, 0.9);
}

html.dark .btn-primary {
    color: #2b1804;
    background-color: #e9bd66;
    background-image: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 8px 20px -12px rgba(219, 156, 42, 0.85);
}

.btn-primary:hover {
    background-color: #e9bd66;
    filter: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 10px 20px -12px rgba(123, 76, 8, 0.95);
}

html.dark .btn-primary:hover {
    background-color: #f3d79c;
    filter: none;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--accent-soft);
    border-color: rgba(162, 95, 8, 0.4);
}

.btn-secondary {
    background: var(--surface-soft);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--accent-soft);
    border-color: rgba(162, 95, 8, 0.35);
}

.btn-danger {
    color: #ffffff;
    background-color: #be123c;
    background-image: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 6px 16px -10px rgba(159, 18, 57, 0.8);
}

.btn-danger:hover {
    background-color: #9f1239;
    filter: none;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1rem;
    letter-spacing: 0;
}

html:not(.dark) .badge {
    color: #475569;
    border-color: #e2e8f0;
}

.badge-accent {
    background: var(--accent-soft);
    border-color: rgba(162, 95, 8, 0.32);
    color: var(--accent-text);
}

html:not(.dark) .badge-accent {
    border-color: rgba(131, 75, 6, 0.28);
    color: #834b06;
}

.badge-success {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.3);
    color: #047857;
}

/*
 * Docs code switcher / tab navigation (cURL, PHP, Python, JavaScript).
 * Modern unified card with pill tabs on the left and copy button on the right.
 */
.docs-switcher {
    border: 1px solid #1e293b;
    border-radius: 0.75rem;
    background: #0d1117;
    overflow: hidden;
}

.docs-switcher__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.375rem 0.625rem;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid #1e293b;
}

.docs-switcher__tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.docs-switcher__tabs::-webkit-scrollbar {
    display: none;
}

.docs-switcher__tab {
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 120ms ease;
    white-space: nowrap;
}

.docs-switcher__tab:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.docs-switcher__tab:focus-visible {
    outline: 2px solid rgba(219, 156, 42, 0.7);
    outline-offset: -1px;
}

.docs-switcher__tab.is-active {
    color: #ffffff;
    background: #1e293b;
    border-color: rgba(219, 156, 42, 0.5);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.docs-switcher__panel {
    display: none;
}

.docs-switcher__panel.is-active {
    display: block;
}

/*
 * Tool tier tags (free / premium) used in the sidebar, tool headers and cards.
 */
.tier-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    padding: 0.1rem 0.4rem;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tier-free {
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.10);
    color: #047857;
}

html.dark .tier-free {
    color: #6ee7b7;
}

.tier-premium {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
}

html.dark .tier-premium {
    color: #fcd34d;
}

/* Long cost labels (CC Checker) wrap inside the card instead of overflowing. */
.tier-tag-wrap {
    white-space: normal;
    text-align: right;
}

html.dark .badge-success {
    color: #6ee7b7;
}

.badge-live {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.32);
    color: #047857;
}

html.dark .badge-live {
    color: #6ee7b7;
}

.badge-die {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.32);
    color: #e11d48;
}

html.dark .badge-die {
    color: #fda4af;
}

.badge-retry {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.34);
    color: #b45309;
}

html.dark .badge-retry {
    color: #fcd34d;
}

.badge-unknown {
    background: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.3);
    color: #475569;
}

html.dark .badge-unknown {
    color: #cbd5e1;
}

/* CVV — blue */
.badge-cvv {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.34);
    color: #1d4ed8;
}

html.dark .badge-cvv {
    color: #93c5fd;
}

/* CCN — white, in both themes */
.badge-ccn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

html.dark .badge-ccn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

/* Credit column of subscribers: used the plan, not credits. */
.badge-subscription {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.34);
    color: #1d4ed8;
}

html.dark .badge-subscription {
    color: #93c5fd;
}

/* `html:not(.dark) .badge` outranks a single class: restate the colours after it. */
html:not(.dark) .badge-cvv,
html:not(.dark) .badge-subscription {
    border-color: rgba(59, 130, 246, 0.34);
    color: #1d4ed8;
}

html:not(.dark) .badge-ccn {
    border-color: #cbd5e1;
    color: #0f172a;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}

html:not(.dark) .table-wrapper {
    border-color: #e2e8f0;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-wrapper thead th {
    position: sticky;
    top: 0;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

html:not(.dark) .table-wrapper thead th {
    background: #f1f5f9;
    border-bottom-color: #cbd5e1;
    color: #334155;
}

html.dark .table-wrapper thead th {
    background: rgba(51, 65, 85, 0.55);
    color: #cbd5e1;
}

.table-wrapper tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

html:not(.dark) .table-wrapper tbody td {
    color: #1e293b;
}

html:not(.dark) .table-wrapper tbody td :where(strong, b, code) {
    color: #0f172a;
}

.table-wrapper tbody tr:last-child td {
    border-bottom: 0;
}

.table-wrapper tbody tr {
    transition: background-color 200ms ease;
}

.table-wrapper tbody tr:hover {
    background: var(--accent-soft);
}

/* ---------------------------------------------------------- animations ---- */

/* Motion budget: transform + opacity only, so every entry animation stays on
   the compositor. No layout-triggering properties, no blur animation. */

@keyframes dx-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dx-slide-in {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Live-state pulse: a ring that expands and fades. Cheaper and calmer than
   animate-ping, and it does not fight the dot at its centre. */
@keyframes dx-signal-pulse {
    0% {
        opacity: 0.55;
        transform: scale(1);
    }

    70%,
    100% {
        opacity: 0;
        transform: scale(2.4);
    }
}

/* Loading sweep for progress rails — one transform on a fixed-width bar. */
@keyframes dx-sweep {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.dx-fade-in {
    animation: dx-fade-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dx-slide-in {
    animation: dx-slide-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dx-delay-1 { animation-delay: 60ms; }
.dx-delay-2 { animation-delay: 120ms; }
.dx-delay-3 { animation-delay: 180ms; }

.dx-live-dot {
    position: relative;
    display: inline-block;
    height: 0.375rem;
    width: 0.375rem;
    border-radius: 999px;
    background-color: #10b981;
}

.dx-live-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: inherit;
    animation: dx-signal-pulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.dx-sweep {
    position: relative;
    overflow: hidden;
}

.dx-sweep::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 50%;
    background: linear-gradient(90deg, transparent, rgba(219, 156, 42, 0.45), transparent);
    animation: dx-sweep 1.4s linear infinite;
}

/* --------------------------------------------------------- theme icons ---- */

.theme-icon-sun {
    display: none;
}

html.dark .theme-icon-sun {
    display: block;
}

html.dark .theme-icon-moon {
    display: none;
}

/* -------------------------------------------------------- accessibility ---- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* -------------------------------------------------------------- auth ---- */

.auth-shell {
    min-height: calc(100vh - 4rem);
}

.auth-panel-grid {
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.10) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(120% 90% at 15% 5%, #000 25%, transparent 72%);
    -webkit-mask-image: radial-gradient(120% 90% at 15% 5%, #000 25%, transparent 72%);
}

/* A single hairline marking the panel edge — the split comes from a rule,
   not from a gradient. */
.auth-panel {
    background-color: #0b1220;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.auth-card {
    position: relative;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: #0f172a;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -32px rgba(0, 0, 0, 0.9);
}

.auth-field {
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #0b1220;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #e2e8f0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-field::placeholder {
    color: #64748b;
}

.auth-field:hover {
    border-color: rgba(148, 163, 184, 0.28);
}

.auth-field:focus {
    outline: none;
    border-color: #db9c2a;
    background: #020617;
    box-shadow: 0 0 0 3px rgba(219, 156, 42, 0.18);
}

.auth-field[aria-invalid="true"] {
    border-color: rgba(244, 63, 94, 0.55);
}

.auth-field[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.auth-submit {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.375rem;
    background: #db9c2a;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2b1804;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 12px 24px -14px rgba(219, 156, 42, 0.9);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover {
    background: #e9bd66;
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(219, 156, 42, 0.45);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(148, 163, 184, 0.14);
}

/* ------------------------------------------------------- scroll to top ---- */

.scroll-top-btn {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 60;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-secondary);
    box-shadow: var(--shadow-lift);
    cursor: pointer;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.scroll-top-btn[hidden] {
    display: none;
}

.scroll-top-btn.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    color: var(--accent-text);
    border-color: var(--accent);
}

.scroll-top-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

@media (min-width: 640px) {
    .scroll-top-btn {
        right: 1.75rem;
        bottom: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-top-btn {
        transition: none;
    }
}

/* --------------------------------------------------------------- print ---- */

@media print {
    .dx-sidebar,
    .app-topbar,
    .app-footer,
    .scroll-top-btn {
        display: none !important;
    }

    body.app-body {
        background: #ffffff;
        color: #000000;
    }
}
