/* ==========================================================================
   Grid Software Design System — Reset + Components
   Loaded on every page, immediately after tokens.css.
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
  color: var(--text);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  margin: 0;
}

a {
  color: var(--accent-hi);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--text);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-sm);
}

[hidden] {
  display: none !important;
}

hr {
  height: 1px;
  margin: var(--sp-6) 0;
  border: 0;
  background: var(--line-1);
}

code,
kbd,
.mono,
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 200;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: top var(--t-base);
}

.skip-link:focus {
  top: var(--sp-4);
  color: #fff;
}

/* --- Layout helpers -------------------------------------------------------- */

.section-wrap,
.container {
  width: min(var(--shell-max), calc(100% - var(--sp-8)));
  margin-inline: auto;
}

.container {
  margin-block: var(--sp-7);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.row-between {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mb-24 { margin-bottom: var(--sp-5); }
.mt-24 { margin-top: var(--sp-5); }

.muted {
  color: var(--text-2);
}

.eyebrow {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
}

@media (max-width: 900px) {

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {

  .section-wrap,
  .container {
    width: calc(100% - var(--sp-5));
  }
}

/* --- Surfaces -------------------------------------------------------------- */

.card,
.panel {
  padding: var(--sp-5);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: var(--e1);
}

.card-tight {
  padding: var(--sp-4);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.card-head h2,
.card-head h3 {
  font-size: var(--fs-h3);
}

/* Glass survives on exactly two surfaces: the sticky nav and modals. */
.glass-panel {
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: var(--e1);
}

/* --- Buttons --------------------------------------------------------------- */

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.btn:hover,
button:hover {
  background: var(--surface-3);
  border-color: var(--line-3);
  color: var(--text);
}

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

.btn:disabled,
button:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

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

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

.btn-secondary,
button.secondary {
  border-color: var(--line-2);
  background: transparent;
  color: var(--text);
}

.btn-secondary:hover,
button.secondary:hover {
  background: var(--surface-2);
}

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

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  border-color: transparent;
  background: var(--err);
  color: #2a0708;
}

.btn-danger:hover {
  background: #ff7175;
  color: #2a0708;
}

.btn-lg {
  min-height: 48px;
  padding: 0 var(--sp-5);
  font-size: var(--fs-body);
}

.btn-sm {
  min-height: 32px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-xs);
}

.btn-block {
  width: 100%;
}

/* --- Badges + status ------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 3px var(--sp-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.badge-plain::before {
  display: none;
}

.badge-success {
  border-color: rgba(63, 207, 142, 0.3);
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-danger {
  border-color: rgba(244, 88, 92, 0.3);
  background: var(--err-soft);
  color: var(--err);
}

.badge-warning {
  border-color: rgba(245, 165, 36, 0.3);
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-info {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-hi);
}

/* --- Forms ----------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field label,
label {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--t-fast), background var(--t-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-3);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.field-error {
  color: var(--err);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* --- Tables ---------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  background: var(--surface-1);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-1);
  color: var(--text-3);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line-1);
  color: var(--text);
  vertical-align: middle;
}

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

.table tbody tr {
  transition: background var(--t-fast);
}

.table tbody tr:hover td {
  background: var(--surface-2);
}

.table .num,
.table .cell-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table code {
  padding: 2px 6px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-xs);
  background: var(--surface-inset);
  color: var(--text-2);
  font-size: var(--fs-xs);
}

/* --- Empty states ---------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-5);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface-inset);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-3);
}

.empty h3 {
  font-size: var(--fs-h3);
}

.empty p {
  max-width: 42ch;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

/* --- Global alert ---------------------------------------------------------- */
/* A full-bleed banner that sits above the nav. Reads as a proper notice: a  */
/* soft severity-tinted surface, a clear dot with a matching halo, and a     */
/* medium-weight message. Not a hairline. Not a mysterious edge glow.        */

/* When the banner is actually rendered, expose its height as --alert-h so   */
/* every layout that needs to reserve space for it (auth-wrap min-height,    */
/* sticky sidebar top/height, etc.) can subtract it via calc().              */
/* ==========================================================================
   Global Alert - Floating Cyber Island Pill
   ========================================================================== */

.global-alert-pill {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 32px));
  height: 40px;
  padding: 0 14px 0 16px;
  border-radius: 999px;
  background: rgba(13, 15, 22, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 
    0 10px 32px rgba(0, 0, 0, 0.65),
    0 0 18px rgba(56, 189, 248, 0.14);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: alertPillDrop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes alertPillDrop {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.global-alert-pill.is-dismissing {
  opacity: 0;
  transform: translate(-50%, -10px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scrolled behavior: docked gracefully below the pinned topbar */
body.scrolled .global-alert-pill {
  top: 68px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Content grouping */
.alert-pill-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

/* Beacon dot */
.alert-beacon {
  position: relative;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.alert-beacon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.alert-beacon-ring {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  animation: alertRingPulse 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes alertRingPulse {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* Tag */
.alert-tag {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Message */
.alert-msg {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

/* Dismiss button */
.alert-dismiss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.alert-dismiss-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
}

/* Severity Theme: Info / Notice (Default) */
.global-alert-info {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 18px rgba(56, 189, 248, 0.15);
}
.global-alert-info .alert-beacon-dot { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.global-alert-info .alert-beacon-ring { border-color: rgba(56, 189, 248, 0.6); }
.global-alert-info .alert-tag {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Severity Theme: Warning / Maintenance */
.global-alert-warning {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 158, 11, 0.18);
}
.global-alert-warning .alert-beacon-dot { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.global-alert-warning .alert-beacon-ring { border-color: rgba(245, 158, 11, 0.6); }
.global-alert-warning .alert-tag {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Severity Theme: Danger / Critical */
.global-alert-danger {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 22px rgba(239, 68, 68, 0.22);
}
.global-alert-danger .alert-beacon-dot { background: #f87171; box-shadow: 0 0 8px #f87171; }
.global-alert-danger .alert-beacon-ring { border-color: rgba(239, 68, 68, 0.65); }
.global-alert-danger .alert-tag {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Severity Theme: Success / Update */
.global-alert-success {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 20px rgba(16, 185, 129, 0.18);
}
.global-alert-success .alert-beacon-dot { background: #34d399; box-shadow: 0 0 8px #34d399; }
.global-alert-success .alert-beacon-ring { border-color: rgba(16, 185, 129, 0.6); }
.global-alert-success .alert-tag {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Responsive adjustment */
@media (max-width: 640px) {
  .global-alert-pill {
    top: 72px;
    height: auto;
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 14px;
  }
  .alert-msg {
    white-space: normal;
    font-size: 12px;
  }
}

/* --- Stat / KPI cards ------------------------------------------------------ */

.stat-grid,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-4);
}

.stat-card,
.kpi-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  transition: border-color var(--t-fast);
}

.stat-card:hover,
.kpi-card:hover {
  border-color: var(--line-2);
}

.stat-card h3,
.kpi-card h3 {
  margin: 0;
  color: var(--text-3);
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
}

/* Flat, legible numbers — no gradient text clipping. */
.stat-card .value,
.kpi-card .value {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
  -webkit-text-fill-color: currentColor;
  background: none;
}

.stat-card .value-success { color: var(--ok); }
.stat-card .value-danger { color: var(--err); }
.stat-card .value-warning { color: var(--warn); }
.stat-card .value-info { color: var(--text); }

.stat-meta {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* --- Tabs ------------------------------------------------------------------ */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  padding: var(--sp-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  width: fit-content;
  max-width: 100%;
}

.tab {
  min-height: 32px;
  padding: 0 var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.tab:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text);
}

.tab.active {
  background: var(--surface-3);
  border-color: var(--line-2);
  color: var(--text);
}

.tab-sm {
  min-height: 28px;
  font-size: var(--fs-xs);
}

/* --- Toasts ---------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(360px, calc(100vw - var(--sp-8)));
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: var(--e2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-base), transform var(--t-base);
  overflow: hidden;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.toast-title {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.toast-message {
  margin: 2px 0 0;
  color: var(--text);
  font-size: var(--fs-sm);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-close {
  min-height: 24px;
  padding: 0 var(--sp-2);
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.toast-close:hover {
  background: transparent;
  color: var(--text);
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: toast-progress linear forwards;
}

.toast-success { box-shadow: var(--e2), inset 3px 0 0 var(--ok); }
.toast-error { box-shadow: var(--e2), inset 3px 0 0 var(--err); }
.toast-info { box-shadow: var(--e2), inset 3px 0 0 var(--accent); }

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* --- Modal ----------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  width: min(560px, 100%);
  padding: var(--sp-5);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: var(--e3);
}

/* --- Skeletons ------------------------------------------------------------- */

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}

@keyframes skeleton {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

/* --- Utility --------------------------------------------------------------- */

.is-elevated {
  position: relative;
  z-index: 90;
  overflow: visible !important;
}

.custom-select.is-open { z-index: 95 !important; }
.is-elevated .custom-select-menu { z-index: 96 !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Language Switcher (i18n) --------------------------------------------- */

.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1050;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-2, #94a3b8);
  cursor: pointer;
  outline: none;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.lang-btn:hover,
.lang-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.lang-icon {
  display: block;
  transition: transform 160ms ease, color 160ms ease;
}

.lang-btn:hover .lang-icon,
.lang-btn[aria-expanded="true"] .lang-icon {
  color: #38bdf8;
  transform: scale(1.08);
}

/* Dropdown Menu */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  max-height: 360px;
  overflow-y: auto;
  background: rgba(13, 14, 18, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 14px;
  padding: 6px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(59, 130, 246, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity 160ms cubic-bezier(0.16, 1, 0.3, 1), transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1100;
}

.lang-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-dropdown::-webkit-scrollbar {
  width: 4px;
}
.lang-dropdown::-webkit-scrollbar-track {
  background: transparent;
}
.lang-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-2, #94a3b8);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 120ms ease;
  user-select: none;
}

.lang-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.14);
  color: #fff;
}

.lang-dropdown-item.is-active {
  background: rgba(59, 130, 246, 0.2);
  color: #38bdf8;
  font-weight: 600;
}

.lang-item-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lang-flag-svg {
  width: 20px;
  height: 15px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: block;
}

.lang-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-check {
  color: #38bdf8;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .lang-dropdown {
    right: -10px;
    width: 170px;
  }
}
