/* Enjaz Platform: liquid glass, taken from leadbook's design (general/projects/leadbook, "Liquid glass" section of app.css).
   Surfaces are frosted glass over a slow, softly coloured backdrop (aurora + moving web, painted by bg.js): a translucent fill,
   a light blur, a lit top edge and a soft shadow. The tokens below are leadbook's own values; only the selectors are this project's
   (Bootstrap) ones. Enjaz keeps its own brand colours (purple actions, gold secondary). */

:root {
  --page: #fbfbfa;
  --glass: rgba(255,255,255,.52);
  --glass-2: rgba(255,255,255,.74);                /* over the page: menus, dialogs */
  --glass-brd: rgba(255,255,255,.7);
  --glass-tint: rgba(255,255,255,.45);             /* fields and quiet buttons inside glass */
  --glass-line: rgba(90,60,30,.12);
  --edge: rgba(255,255,255,.95);
  --sheen: linear-gradient(160deg,rgba(255,255,255,.6),rgba(255,255,255,.12) 38%,rgba(255,255,255,0) 62%,rgba(255,255,255,.18));
  --glass-shadow: inset 0 1px 0 var(--edge),inset 0 0 0 1px rgba(255,255,255,.18),0 14px 34px -18px rgba(70,40,15,.32),0 2px 6px -2px rgba(70,40,15,.08);
  --blur: blur(5px) saturate(185%);                /* light enough that the moving web shows through as soft threads */
  --orb-1: #7c4ddf; --orb-2: #f0c040; --orb-3: #c026d3; --orb-4: #4f46e5; --aurora-a: .8; --aurora-size: .55;   /* matte white with vivid moving coloured lights, the same lights as the dark theme */
  --web: 70,60,160; --web-a: .5;
  --primary: #6c3fc5; --primary-dark: #4e2d99; --secondary: #d4a017; --on-primary: #ffffff;
  --text: #1f1510; --text-muted: #75655a;
  --surface: var(--glass); --surface2: var(--glass-2); --card: var(--glass); --border: var(--glass-line);
}
html[data-theme="dark"], :root:not([data-theme="light"]) {
  --page: #040405;
  --glass: rgba(24,25,28,.48);
  --glass-2: rgba(22,23,26,.88);
  --glass-brd: rgba(255,255,255,.1);
  --glass-tint: rgba(255,255,255,.055);
  --glass-line: rgba(255,255,255,.1);
  --edge: rgba(255,255,255,.17);
  --sheen: linear-gradient(160deg,rgba(255,255,255,.11),rgba(255,255,255,.025) 38%,rgba(255,255,255,0) 62%,rgba(255,255,255,.035));
  --glass-shadow: inset 0 1px 0 var(--edge),inset 0 0 0 1px rgba(255,255,255,.025),0 20px 44px -20px rgba(0,0,0,.8),0 2px 8px -2px rgba(0,0,0,.45);
  --orb-1: #7c4ddf; --orb-2: #f0c040; --orb-3: #c026d3; --orb-4: #4f46e5; --aurora-a: .55; --aurora-size: .5;   /* matte black with small coloured lights (leadbook's dark colours) */
  --web: 205,210,222; --web-a: .3;
  --primary: #8257e6; --primary-dark: #6c3fc5; --secondary: #f0c040; --on-primary: #ffffff;
  --text: #f5f5f4; --text-muted: #cacad2;
}

/* ── Backdrop: the canvases painted by bg.js, a fine grain on top so the gradients never band ── */
html { background: var(--page); }
body { background: transparent !important; color: var(--text); }
#bg, #web { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; display: block; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ── Glass surfaces (leadbook .card) ── */
.card, .pf-panel, .pf-hero, .pf-tile, .auth-shell, .accordion-item, .list-group-item,
.home-hero-main, .home-hero-side, .home-metric, .home-service-card {
  background: var(--sheen), var(--glass) !important;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-brd) !important; box-shadow: var(--glass-shadow) !important;
}
.card, .pf-panel, .pf-hero, .home-hero-main, .home-hero-side { border-radius: 20px !important; }
.pf-tile, .home-service-card, .home-metric { border-radius: 18px !important; }
.card { overflow: hidden; }
.home-shell::before, .home-shell::after { display: none; }
.pf-panel-head, .pf-pager, .txn-row { border-color: var(--glass-line) !important; }
.txn-row:hover { background: var(--glass-tint); }
footer.pf-pager {
  width: auto; margin: 0 !important; padding: .65rem 1.1rem !important; border-radius: 0 !important; background: transparent !important;
  border: 0 !important; border-top: 1px solid var(--glass-line) !important; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none !important;
}

/* menus, dialogs: the stronger glass (leadbook .user .menu / .dlg) */
.modal-content, .dropdown-menu, .offcanvas {
  background: var(--sheen), var(--glass-2) !important;
  -webkit-backdrop-filter: blur(32px) saturate(190%); backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid var(--glass-brd) !important; box-shadow: var(--glass-shadow), 0 30px 70px -24px rgba(0,0,0,.45) !important;
}
.modal-content { border-radius: 26px !important; }
.dropdown-menu { border-radius: 18px !important; padding: .45rem; }
.dropdown-item { border-radius: 12px; }
.modal-backdrop { --bs-backdrop-opacity: 1; background: rgba(6,8,12,.42); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); }

/* tiles that sit inside a glass panel are only tinted, never blurred or stacked with a second full glass
   (leadbook: "rows and fields inside them are just tinted"), so a panel is not darker than its neighbours */
.home-hero-side .home-metric, .home-hero-side-list .home-metric, .pf-panel .pf-tile, .card .pf-tile, .home-hero-main .home-metric {
  background: var(--glass-tint) !important; -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 1px solid var(--glass-line) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.1) !important;
}

/* One accent for tool cards and tiles */
.home-service-card, .home-metric, .home-hero-side-list, [style*="--card-accent"], [style*="--metric-accent"] {
  --card-accent: 130, 87, 230 !important; --metric-accent: 130, 87, 230 !important;
}
[data-theme="light"] .home-service-card, [data-theme="light"] .home-metric,
[data-theme="light"] [style*="--card-accent"], [data-theme="light"] [style*="--metric-accent"] { --card-accent: 108, 63, 197 !important; --metric-accent: 108, 63, 197 !important; }
.home-service-card [class*="icon"], .home-metric-icon {
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.28), transparent 55%), var(--glass-tint) !important;
  color: var(--primary) !important; border: 0 !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.14); border-radius: 14px;
}
.home-service-card .fa-arrow-right, .home-service-card [class*="open"] { color: var(--primary) !important; }
[style*="108,63,197"], [style*="108, 63, 197"] { background: var(--glass) !important; border-color: transparent !important; }
.home-metric::after { display: none; }
.home-kicker, .home-hero-side-pill { background: var(--glass-tint) !important; color: var(--text) !important; border: 1px solid var(--glass-line) !important; }

/* ── One page width: the page content is exactly as wide as the bar (leadbook: main and .nav-in share the same gaps) ── */
#appContent .container:not(.container *, .container-fluid *),
#appContent .container-fluid:not(.container *, .container-fluid *) {
  width: min(1204px, calc(100% - 36px)); max-width: none !important; margin-inline: auto; padding-inline: 0 !important;
}
@media (max-width: 575px) {
  #appContent .container:not(.container *, .container-fluid *), #appContent .container-fluid:not(.container *, .container-fluid *) { width: calc(100% - 16px); }
}

/* ── The bar: leadbook's .nav / .nav-in — a 60px glass pill, same glass as the cards, stronger blur ── */
.navbar {
  position: sticky; top: 10px; z-index: 1030;
  width: min(1204px, calc(100% - 36px)); min-height: 60px; margin: 10px auto 0; padding: 0 10px !important; border-radius: 22px;
  background: var(--sheen), var(--glass) !important; border: 1px solid var(--glass-brd) !important;
  -webkit-backdrop-filter: blur(18px) saturate(185%); backdrop-filter: blur(18px) saturate(185%); box-shadow: var(--glass-shadow) !important;
}
.navbar > .container { max-width: none; padding-inline: 0; min-height: 60px; }
.navbar-brand { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0; }
.navbar .brand-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
.navbar .brand-name { color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: .2px; }
/* links: no borders, muted text, a soft tint on hover (leadbook .links a) */
.navbar-actions .btn-outline-secondary {
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--text-muted) !important;
  font-weight: 500; font-size: .95rem; padding: 8px 14px; border-radius: 14px !important; transition: background .15s, color .15s;
}
.navbar-actions .btn-outline-secondary:hover, .navbar-actions .btn-outline-secondary:focus, .navbar-actions .btn-outline-secondary.show {
  background: color-mix(in srgb, var(--primary) 14%, transparent) !important; color: var(--primary) !important;
}
.navbar-actions { flex-wrap: nowrap; gap: .15rem !important; }
.navbar-actions .btn, .navbar .brand-name { white-space: nowrap; }
/* laptop widths: tighter links so nothing wraps to two lines */
@media (min-width: 992px) and (max-width: 1279px) {
  .navbar-actions .btn-outline-secondary { padding: 8px 9px; font-size: .88rem; }
  .navbar .brand-name { font-size: 15px; }
}
@media (min-width: 992px) and (max-width: 1119px) { .navbar .brand-name { display: none; } }
.navbar-actions .btn-primary { padding: 8px 16px; font-size: .95rem; border-radius: 999px; }
/* the theme switch: leadbook's .icon-btn, a 40px glass square */
#themeToggle.btn-outline-secondary {
  width: 40px; height: 40px; padding: 0 !important; display: grid; place-items: center;
  background: var(--glass-tint) !important; border: 1px solid var(--glass-line) !important; border-radius: 14px !important; color: var(--text-muted) !important;
}
#themeToggle.btn-outline-secondary:hover { background: color-mix(in srgb, var(--primary) 14%, transparent) !important; color: var(--primary) !important; }
footer, #appFooter {
  width: min(1204px, calc(100% - 36px)); margin: 18px auto 12px !important; padding: .55rem 1rem !important; border-radius: 18px;
  background: var(--sheen), var(--glass) !important; border: 1px solid var(--glass-brd) !important;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-shadow) !important;
}

/* ── Controls: pill buttons with a lit top edge; quiet buttons and fields are tinted glass (leadbook) ── */
.btn { border-radius: 999px; transition: background .15s, filter .15s, transform .15s; }
.btn-primary {
  background: var(--primary) linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0) 58%) !important; color: var(--on-primary) !important;
  border: 0 !important; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 20px -10px color-mix(in srgb, var(--primary) 80%, transparent) !important;
}
.btn-primary:hover, .btn-primary:focus { filter: brightness(1.07); color: var(--on-primary) !important; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary i { color: inherit !important; }
.btn-outline-secondary, .btn-outline-primary {
  background: var(--glass-tint) !important; color: var(--text) !important; border: 1px solid var(--glass-line) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12) !important;
}
.btn-outline-secondary:hover, .btn-outline-primary:hover { background: color-mix(in srgb, var(--glass-tint) 60%, rgba(255,255,255,.12)) !important; }
.form-control, .form-select, .input-group-text {
  background-color: var(--glass-tint) !important; color: var(--text); border: 1px solid var(--glass-line) !important; border-radius: 14px !important;
}
.form-control::placeholder { color: var(--text-muted); opacity: .8; }
.form-control:focus, .form-select:focus {
  border-color: color-mix(in srgb, var(--primary) 70%, transparent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent) !important;
}
.badge { border-radius: 999px; }
.alert { border-radius: 16px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--glass-line); }
.pf-avatar { background: var(--primary); color: var(--on-primary); }
.text-muted, .small.text-muted { color: var(--text-muted) !important; }
option, optgroup { background-color: #fff; color: #1f1510; }
html:not([data-theme="light"]) :is(option, optgroup) { background-color: #17181e; color: #f5f5f4; }

/* ── Sign-in ── */
.auth-shell { border-radius: 26px !important; }
html:not([data-theme="light"]) .auth-showcase { background: rgba(14,8,28,.40) !important; }
[data-theme="light"] .auth-showcase { background: rgba(60,30,120,.58) !important; }
.auth-showcase::before { background: rgba(240,192,64,.18) !important; }
.auth-showcase::after { background: rgba(108,63,197,.26) !important; }
html:not([data-theme="light"]) .auth-label-row a, html:not([data-theme="light"]) .auth-shell a:not(.btn) { color: #c4b5fd; }

@media (max-width: 575px) {
  .navbar, footer, #appFooter { width: calc(100% - 16px); }
  .navbar { top: 8px; margin-top: 8px; border-radius: 18px; }
}
@media (prefers-reduced-transparency: reduce) {
  .card, .pf-panel, .pf-hero, .pf-tile, .auth-shell, .navbar, footer, .home-hero-main, .home-hero-side, .home-metric, .home-service-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .navbar { background: color-mix(in srgb, var(--page) 88%, #888) !important; }
  .modal-content, .dropdown-menu { background: color-mix(in srgb, var(--page) 92%, #888) !important; }
}

/* ── Matte black (dark): a faint satin band of light sweeps slowly over the black, under the coloured lights ── */
html[data-theme="dark"] body::before, :root:not([data-theme="light"]) body::before {
  content: ""; position: fixed; inset: -30%; z-index: -1; pointer-events: none;
  background:
    linear-gradient(112deg, transparent 36%, rgba(255,255,255,.03) 44%, rgba(255,255,255,.10) 50%, rgba(255,255,255,.025) 56%, transparent 64%),
    radial-gradient(70% 50% at 50% 50%, transparent 52%, rgba(0,0,0,.55) 100%);
  animation: matte-sheen 16s ease-in-out infinite alternate;
}
html[data-theme="dark"] body::after, :root:not([data-theme="light"]) body::after { opacity: .05; }
html[data-theme="dark"] #web, :root:not([data-theme="light"]) #web { z-index: -2; }
@keyframes matte-sheen { from { transform: translate3d(-16%, 0, 0); } to { transform: translate3d(16%, 0, 0); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none !important; } }


/* ── Matte white (light): a soft satin band of light and shade sweeps slowly over the white, under the coloured lights ── */
html[data-theme="light"] body::before {
  content: ""; position: fixed; inset: -30%; z-index: -1; pointer-events: none;
  background:
    linear-gradient(112deg, transparent 34%, rgba(255,255,255,.55) 42%, rgba(60,70,110,.07) 50%, rgba(255,255,255,.5) 58%, transparent 66%),
    radial-gradient(70% 50% at 50% 50%, transparent 55%, rgba(60,70,110,.07) 100%);
  animation: matte-sheen 18s ease-in-out infinite alternate;
}

/* theme switch icons, as in leadbook: a sun in the dark theme (tap for light), a moon in the light theme */
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
#themeToggle .sun { display: none; }
html:not([data-theme="light"]) #themeToggle .sun { display: block; }
html:not([data-theme="light"]) #themeToggle .moon { display: none; }
