/* =============================================================================
   LAB2HOME DIAGNOSTICS — Premium Theme
   Black / Gold / White · Glassmorphism · Apple/Tesla inspired
   Module 1: Foundation
   ============================================================================= */

:root {
  --l2h-black: #0a0a0a;
  --l2h-black-soft: #121212;
  --l2h-black-card: #161616;
  --l2h-gold: #c9a227;
  --l2h-gold-bright: #e0b93a;
  --l2h-gold-dim: rgba(201, 162, 39, 0.18);
  --l2h-white: #f5f5f7;
  --l2h-muted: #a1a1a6;
  --l2h-border: rgba(255, 255, 255, 0.08);
  --l2h-glass: rgba(255, 255, 255, 0.04);
  --l2h-radius: 18px;
  --l2h-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --l2h-font: 'Inter', system-ui, sans-serif;
  --l2h-display: 'Outfit', 'Inter', sans-serif;
  --l2h-transition: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body.l2h-body {
  margin: 0;
  color-scheme: dark;
  font-family: var(--l2h-font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 255, 255, 0.05), transparent 50%),
    linear-gradient(180deg, #050505 0%, #0d0d0d 100%);
  color: var(--l2h-white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--l2h-gold);
  text-decoration: none;
  transition: color var(--l2h-transition);
}

a:hover {
  color: var(--l2h-gold-bright);
}

h1, h2, h3, h4, h5, .l2h-display {
  font-family: var(--l2h-display);
  letter-spacing: -0.02em;
}

/* ---------- Brand ---------- */
.l2h-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.l2h-brand-stack {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.l2h-brand-link {
  color: inherit;
}

.l2h-brand-logo {
  flex-shrink: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.l2h-brand-logo--nav {
  height: 52px;
}

.l2h-brand-logo--sidebar {
  height: 88px;
}

.l2h-brand-logo--footer {
  height: 72px;
}

.l2h-brand-logo--auth {
  height: 110px;
}

.l2h-brand-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.2;
}

.l2h-brand-caption strong {
  font-family: var(--l2h-display);
  font-size: 1.15rem;
  color: var(--l2h-white);
}

.l2h-brand-caption small {
  color: var(--l2h-muted);
  font-size: 0.78rem;
}

.l2h-sidebar-brand .l2h-brand {
  width: 100%;
}

.l2h-sidebar-brand .l2h-brand-caption small {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.l2h-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--l2h-gold), #8a6d12);
  color: #111;
  font-family: var(--l2h-display);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.35);
}

.l2h-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  color: var(--l2h-white);
}

.l2h-brand-text strong {
  font-family: var(--l2h-display);
  font-size: 1rem;
}

.l2h-brand-text small {
  color: var(--l2h-muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.l2h-navbar .l2h-lang-switch,
.l2h-navbar-primo .l2h-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.25);
}

.l2h-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.3rem 0.45rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  color: rgba(245, 245, 247, 0.65) !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.l2h-lang-btn:hover {
  color: #e0b93a !important;
  background: rgba(201, 162, 39, 0.12);
}

.l2h-lang-btn.is-active {
  background: linear-gradient(135deg, #c9a227, #e0b93a);
  color: #111 !important;
}

.l2h-navbar-primo .l2h-lang-switch {
  border-color: rgba(201, 162, 39, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Navbar ---------- */
.l2h-navbar {
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--l2h-border);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.l2h-navbar .nav-link {
  color: var(--l2h-muted) !important;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.45rem 0.85rem !important;
  border-radius: 999px;
  transition: all var(--l2h-transition);
}

.l2h-navbar .nav-link:hover,
.l2h-navbar .nav-link.active {
  color: var(--l2h-white) !important;
  background: var(--l2h-glass);
}

/* ---------- Buttons ---------- */
.btn-l2h-gold {
  --bs-btn-color: #111;
  --bs-btn-bg: var(--l2h-gold);
  --bs-btn-border-color: var(--l2h-gold);
  --bs-btn-hover-color: #111;
  --bs-btn-hover-bg: var(--l2h-gold-bright);
  --bs-btn-hover-border-color: var(--l2h-gold-bright);
  --bs-btn-focus-shadow-rgb: 201, 162, 39;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(201, 162, 39, 0.28);
}

.btn-outline-l2h {
  --bs-btn-color: var(--l2h-white);
  --bs-btn-border-color: rgba(255, 255, 255, 0.25);
  --bs-btn-hover-color: #111;
  --bs-btn-hover-bg: var(--l2h-gold);
  --bs-btn-hover-border-color: var(--l2h-gold);
  border-radius: 999px;
  font-weight: 500;
}

/* ---------- Cards / Glass ---------- */
.l2h-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--l2h-border);
  border-radius: var(--l2h-radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--l2h-shadow);
  color: var(--l2h-white);
}

.l2h-card-body {
  padding: 1.5rem;
}

.l2h-stat-card {
  text-align: center;
  padding: 1.75rem 1.25rem;
}

.l2h-stat-card .l2h-stat-value {
  font-family: var(--l2h-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--l2h-gold);
  line-height: 1.1;
}

.l2h-stat-card .l2h-stat-label {
  color: var(--l2h-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.l2h-stat-card i {
  font-size: 1.5rem;
  color: var(--l2h-gold);
  margin-bottom: 0.75rem;
  display: inline-block;
}

/* ---------- Forms ---------- */
.l2h-form .form-control,
.l2h-form .form-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--l2h-border);
  color: var(--l2h-white);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.l2h-form .form-control:focus,
.l2h-form .form-select:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--l2h-gold);
  box-shadow: 0 0 0 0.2rem var(--l2h-gold-dim);
  color: var(--l2h-white);
}

.l2h-form .form-control::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.l2h-form .form-label {
  color: var(--l2h-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.l2h-form .form-select option {
  background: #1a1a1a;
  color: #fff;
}

/* Dark-surface alerts */
.l2h-body .alert {
  border-radius: 12px;
  border-width: 1px;
}
.l2h-body .alert-danger {
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.35);
  color: #f1aeb5;
}
.l2h-body .alert-success {
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(25, 135, 84, 0.35);
  color: #a3cfbb;
}
.l2h-body .alert-warning {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.4);
  color: #e0b93a;
}
.l2h-body .alert-info {
  background: rgba(13, 202, 240, 0.1);
  border-color: rgba(13, 202, 240, 0.3);
  color: #9eeaf9;
}

/* ---------- Sidebar Layout ---------- */
.l2h-app-shell {
  display: flex;
  min-height: 100vh;
}

.l2h-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: rgba(8, 8, 8, 0.92);
  border-right: 1px solid var(--l2h-border);
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.l2h-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--l2h-border);
  margin-bottom: 1rem;
}

.l2h-sidebar-brand strong {
  display: block;
  font-family: var(--l2h-display);
  font-size: 0.95rem;
}

.l2h-sidebar-brand small {
  color: var(--l2h-muted);
  font-size: 0.72rem;
}

.l2h-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.l2h-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  color: var(--l2h-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all var(--l2h-transition);
}

.l2h-sidebar-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.l2h-sidebar-link:hover,
.l2h-sidebar-link.active {
  color: var(--l2h-white);
  background: var(--l2h-gold-dim);
  box-shadow: inset 3px 0 0 var(--l2h-gold);
}

.l2h-sidebar-logout {
  margin-top: 1rem;
  border-top: 1px solid var(--l2h-border);
  padding-top: 1rem;
  border-radius: 0 0 12px 12px;
}

.l2h-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
}

.l2h-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ---------- Tables ---------- */
.l2h-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--l2h-white);
  --bs-table-border-color: var(--l2h-border);
  --bs-table-hover-bg: rgba(201, 162, 39, 0.06);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  margin-bottom: 0;
}

.l2h-table thead th {
  color: var(--l2h-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom-width: 1px;
}

/* ---------- Utilities ---------- */
.l2h-text-muted {
  color: var(--l2h-muted) !important;
}

.l2h-text-gold {
  color: var(--l2h-gold) !important;
}

.l2h-section {
  padding: 5rem 0;
}

.l2h-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--l2h-gold), transparent);
  opacity: 0.35;
  border: 0;
}

.l2h-fade-up {
  animation: l2hFadeUp 0.7s var(--l2h-transition) both;
}

@keyframes l2hFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Shared utilities ---------- */
.l2h-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.l2h-info-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--l2h-border);
}

.l2h-info-list li:last-child {
  border-bottom: 0;
}

.l2h-info-list .label {
  color: var(--l2h-muted);
}

.l2h-info-list .value {
  color: #fff;
  font-weight: 500;
  text-align: right;
}

.l2h-badge-soft {
  background: rgba(201, 162, 39, 0.15);
  color: var(--l2h-gold);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--l2h-gold);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .l2h-app-shell {
    flex-direction: column;
  }

  .l2h-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .l2h-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .l2h-sidebar-link {
    flex: 1 1 45%;
  }
}

@media (max-width: 575.98px) {
  .l2h-sidebar-link {
    flex: 1 1 100%;
  }

  .l2h-topbar h1 {
    font-size: 1.25rem;
  }

  .l2h-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
