/*
  Shared design system for the user-facing app (dashboard + account area).
  Goal: one consistent visual language instead of per-page bespoke
  gradients/glows, so the product reads as a single deliberate design.
*/

:root {
  --ink: #0f1115;
  --ink-soft: #4b5261;
  --muted: #7c8394;
  --line: #e6e8ec;
  --line-soft: #eef0f3;
  --surface: #ffffff;
  --surface-sunken: #f7f8fa;
  --accent: #2f5fe0;
  --accent-ink: #1f45ad;
  --accent-soft: #eef2fd;
  --good: #1a8f5e;
  --good-soft: #e9f7f0;
  --warn: #b4740a;
  --warn-soft: #fbf1e0;
  --bad: #c23b3b;
  --bad-soft: #fbecec;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(15, 17, 21, 0.04);
  --shadow-2: 0 6px 20px -8px rgba(15, 17, 21, 0.12);
}

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

.ui-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.ui-card-hover {
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ui-card-hover:hover {
  border-color: #d7dae0;
  box-shadow: var(--shadow-2);
}

.ui-sunken {
  background: var(--surface-sunken);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover { background: #262a33; border-color: #262a33; }

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--surface-sunken); border-color: #d7dae0; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-sunken); color: var(--ink); }

.btn-danger {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: #f3d3d3;
}
.btn-danger:hover { background: #f8dcdc; }

.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- badges / status pills ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-good .badge-dot { background: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-warn .badge-dot { background: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-bad .badge-dot { background: var(--bad); }
.badge-neutral { background: var(--surface-sunken); color: var(--ink-soft); border: 1px solid var(--line); }
.badge-neutral .badge-dot { background: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-accent .badge-dot { background: var(--accent); }

/* ---------- form controls ---------- */

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input::placeholder { color: var(--muted); }

/* ---------- stat tiles ---------- */
/* Replaces the "colored icon in a colored rounded box" pattern with a
   single restrained accent used only on the active/primary metric. */

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-tile .stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.stat-tile .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: -0.01em;
}
.stat-tile .stat-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- nav ---------- */

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #aab0bd;
  transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.is-active { background: var(--accent); color: #fff; }
.nav-link i { width: 18px; text-align: center; font-size: 14px; opacity: .9; }

/* ---------- utility ---------- */

.text-muted { color: var(--muted); }
.text-ink-soft { color: var(--ink-soft); }
.divider { border-top: 1px solid var(--line-soft); }

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* ---------- loading dots (site-wide standard loading indicator) ---------- */

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.25;
  animation: loading-dot-pulse 1.1s ease-in-out infinite;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes loading-dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.15); }
}
.loading-dots.loading-dots-lg span { width: 9px; height: 9px; }
.loading-dots.loading-dots-white span { background: #fff; }

/* Full-page navigation loader */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
#page-loader.is-active {
  opacity: 1;
  pointer-events: all;
}

/* ---------- Accessibility & Skip to content ---------- */
.skip-to-content {
  position: absolute;
  top: -9999px;
  left: 16px;
  z-index: 10000;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: top 0.15s ease;
}
.skip-to-content:focus {
  top: 16px;
  outline: 3px solid var(--accent);
}

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

/* ---------- Scroll Progress Bar ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  width: 0%;
  transition: width 0.08s ease-out;
}

/* ---------- Back to Top Button ---------- */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.1);
}
#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover {
  background: #232730;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.22);
}

/* ---------- Floating Support/Contact Badge ---------- */
#floating-contact {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #229ED9;
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px -4px rgba(34, 158, 217, 0.45);
  transition: all 0.2s ease;
  text-decoration: none;
}
#floating-contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(34, 158, 217, 0.6);
  color: #fff;
}
@media (max-width: 640px) {
  #floating-contact span { display: none; }
  #floating-contact { width: 44px; height: 44px; padding: 0; justify-content: center; }
}

/* ---------- Cookie Consent Banner ---------- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  inset-x: 0;
  z-index: 999;
  background: rgba(15, 17, 21, 0.96);
  backdrop-filter: blur(12px);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
}
@media (min-width: 768px) {
  #cookie-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
#cookie-banner.is-active {
  transform: translateY(0);
}

/* ---------- Sticky Mobile CTA (Landing Page) ---------- */
.sticky-mobile-cta {
  display: none;
}
@media (max-width: 767px) {
  .sticky-mobile-cta {
    position: fixed;
    bottom: 0;
    inset-x: 0;
    z-index: 85;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  }
}

/* ---------- Reduced Motion ---------- */
@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;
  }
}

/* ---------- Print Stylesheet ---------- */
@media print {
  header, nav, #sidebar, #mobile-menu, #sidebar-overlay, #page-loader, #back-to-top, #floating-contact, #cookie-banner, .sticky-mobile-cta, .no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt !important;
  }
  .ui-card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 80%;
    color: #666;
  }
}

