/* ==========================================================================
   Nebula Messenger — Design System
   Premium dark interface. Hand-authored tokens, components and page shells.
   No external assets. Works with a strict style-src 'self' CSP.
   ========================================================================== */

/* ------------------------------------------------------------------ Tokens */
:root {
  /* Surfaces */
  --bg-0: #06080e;
  --bg-1: #0a0d15;
  --bg-2: #10141f;
  --bg-3: #171d2b;
  --bg-4: #1e2536;
  --surface: rgba(18, 23, 36, 0.78);
  --surface-strong: rgba(22, 28, 44, 0.94);
  --surface-glass: rgba(12, 16, 27, 0.72);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(34, 211, 238, 0.28);

  /* Text */
  --text-0: #f5f7fc;
  --text-1: #c5cbd9;
  --text-2: #8b94a9;
  --text-3: #5d6679;

  /* Accents */
  --accent: #22d3ee;
  --accent-2: #8b5cf6;
  --accent-3: #38bdf8;
  --accent-soft: rgba(34, 211, 238, 0.13);
  --accent-softer: rgba(34, 211, 238, 0.07);
  --accent-glow: rgba(34, 211, 238, 0.32);
  --violet-soft: rgba(139, 92, 246, 0.15);

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;

  --grad-brand: linear-gradient(135deg, #22d3ee 0%, #6ee7f9 42%, #a78bfa 100%);
  --grad-brand-deep: linear-gradient(140deg, #0e7490 0%, #6d28d9 100%);
  --grad-panel: linear-gradient(180deg, rgba(23, 29, 43, 0.85), rgba(12, 16, 26, 0.9));
  --grad-ambient:
    radial-gradient(1200px 620px at 8% -12%, rgba(34, 211, 238, 0.13), transparent 62%),
    radial-gradient(1000px 560px at 108% 4%, rgba(139, 92, 246, 0.15), transparent 58%),
    radial-gradient(900px 600px at 50% 120%, rgba(56, 189, 248, 0.06), transparent 60%);

  /* Typography */
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-full: 999px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 18px 50px -18px rgba(0, 0, 0, 0.75);
  --shadow-3: 0 30px 90px -30px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 0 1px var(--border), 0 18px 60px -20px rgba(34, 211, 238, 0.25);

  /* Motion */
  --t-fast: 130ms;
  --t-med: 220ms;
  --t-slow: 420ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------ Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text-0);
  background-color: var(--bg-0);
  background-image: var(--grad-ambient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
}

p {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover {
  color: #67e8f9;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(34, 211, 238, 0.28);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  background-clip: content-box;
}

/* ------------------------------------------------------------------ Utilities */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--text-2);
}

.small {
  font-size: var(--fs-sm);
}

.center {
  text-align: center;
}

.flex {
  display: flex;
}

.between {
  justify-content: space-between;
}

.items-center {
  align-items: center;
}

.gap-2 {
  gap: var(--sp-2);
}

.gap-3 {
  gap: var(--sp-3);
}

.mt-4 {
  margin-top: var(--sp-4);
}

.mt-5 {
  margin-top: var(--sp-5);
}

.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 11px;
  border: 1px solid var(--border-accent);
  border-radius: var(--r-full);
  background: rgba(34, 211, 238, 0.07);
  color: #a5f3fc;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
  animation: pulseDot 2.6s ease-in-out infinite;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), opacity var(--t-fast);
}

.link-btn:hover {
  color: #a5f3fc;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.noscript-banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 999;
  padding: 12px 20px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #1a1205;
  background: var(--warning);
}

/* ------------------------------------------------------------------ Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-0);
  text-decoration: none;
}

.brand:hover {
  color: var(--text-0);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--grad-brand);
  box-shadow: 0 8px 26px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  color: #051018;
}

.brand-mark-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand-mark-sm svg {
  width: 19px;
  height: 19px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.brand-sub {
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.brand-compact {
  gap: 9px;
}

.brand-compact .brand-title {
  font-size: var(--fs-md);
}

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.66rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-0);
  cursor: pointer;
  user-select: none;
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    opacity var(--t-fast);
}

.btn:hover {
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.995);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  color: #04121a;
  background: var(--grad-brand);
  box-shadow: 0 12px 30px -12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:hover:not(:disabled) {
  color: #04121a;
  box-shadow: 0 18px 40px -14px rgba(34, 211, 238, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-0);
  background: var(--bg-2);
  border-color: var(--border-strong);
}

.btn-danger {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.13);
  border-color: rgba(251, 113, 133, 0.3);
}

.btn-danger:hover:not(:disabled) {
  color: #ffe4e6;
  background: rgba(251, 113, 133, 0.22);
  border-color: rgba(251, 113, 133, 0.45);
}

.btn-success {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.13);
  border-color: rgba(52, 211, 153, 0.3);
}

.btn-success:hover:not(:disabled) {
  color: #d1fae5;
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.45);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.82rem 1.35rem;
  font-size: 1rem;
  border-radius: 14px;
}

.btn-sm {
  padding: 0.44rem 0.72rem;
  font-size: var(--fs-sm);
  gap: 6px;
  border-radius: 10px;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

.btn-xs {
  padding: 0.3rem 0.55rem;
  font-size: var(--fs-xs);
  gap: 5px;
  border-radius: 8px;
}

.btn-xs svg {
  width: 13px;
  height: 13px;
}

.btn-icon {
  padding: 0.55rem;
  border-radius: var(--r-md);
}

/* Busy state (works with button markup that keeps its label) */
.btn.is-busy {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.is-busy svg {
  opacity: 0;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.btn-primary.is-busy::after {
  border-color: rgba(4, 18, 26, 0.35);
  border-top-color: #04121a;
}

/* ------------------------------------------------------------------ Icon buttons */
.icon-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover:not(:disabled) {
  color: var(--text-0);
  background: var(--bg-2);
  border-color: var(--border);
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.icon-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.icon-btn-accent {
  color: #06212a;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 8px 22px -10px var(--accent-glow);
}

.icon-btn-accent:hover:not(:disabled) {
  color: #04121a;
  background: #67e8f9;
  border-color: transparent;
}

.icon-btn-danger {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.08);
}

.icon-btn-danger:hover:not(:disabled) {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.3);
}

.icon-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.icon-btn-sm svg {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------ Forms */
.field {
  margin-bottom: var(--sp-4);
}

.field:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-1);
}

.field-hint {
  margin-top: 6px;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--text-3);
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 0.68rem 0.85rem;
  color: var(--text-0);
  font-family: inherit;
  font-size: var(--fs-md);
  background: rgba(8, 11, 19, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}

.input::placeholder {
  color: var(--text-3);
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  background: var(--bg-1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.input-error {
  border-color: rgba(251, 113, 133, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.14) !important;
}

textarea.input {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

select.input,
.input-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b94a9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.input-icon {
  position: relative;
}

.input-icon > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-3);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-icon .input {
  padding-left: 42px;
}

.input-icon-action .input {
  padding-right: 48px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: var(--text-3);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color var(--t-fast), background var(--t-fast);
}

.input-action:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

.input-action svg {
  width: 18px;
  height: 18px;
}

.field-counter {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Alerts */
.alert,
.form-alert {
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.45;
  animation: rise var(--t-med) var(--ease) both;
}

.alert-error {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.09);
  border-color: rgba(251, 113, 133, 0.28);
}

.alert-success {
  color: #bbf7d0;
  background: rgba(52, 211, 153, 0.09);
  border-color: rgba(52, 211, 153, 0.28);
}

.alert-info {
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.09);
  border-color: rgba(56, 189, 248, 0.28);
}

.alert-warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.26);
}

.form-alert {
  margin-bottom: var(--sp-4);
}

/* Password strength */
.strength-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.strength-track {
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--bg-3);
}

.strength-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--text-3);
  transition: width var(--t-med) var(--ease), background var(--t-med) var(--ease);
}

.strength-bar[data-level="weak"] {
  width: 33%;
  background: var(--danger);
}

.strength-bar[data-level="fair"] {
  width: 66%;
  background: var(--warning);
}

.strength-bar[data-level="strong"] {
  width: 100%;
  background: var(--success);
}

.strength-label {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-3);
  cursor: pointer;
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}

.switch .slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--t-med) var(--ease), background var(--t-med) var(--ease);
}

.switch input:checked + .slider {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--accent);
}

.switch input:checked + .slider::before {
  background: var(--accent);
  transform: translateX(20px);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

.switch input:focus-visible + .slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------ Badges & pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-accent {
  color: #a5f3fc;
  background: var(--accent-soft);
  border-color: rgba(34, 211, 238, 0.28);
}

.badge-success {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
}

.badge-warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.09);
  border-color: rgba(251, 191, 36, 0.26);
}

.badge-danger {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.09);
  border-color: rgba(251, 113, 133, 0.28);
}

.badge-soft {
  color: var(--text-1);
  background: var(--bg-3);
  border-color: var(--border);
}

.pill {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  color: var(--text-1);
  background: var(--bg-3);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pill-warning {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
}

.pill.hidden {
  display: none;
}

/* ------------------------------------------------------------------ Avatars */
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(34, 211, 238, 0.2), rgba(139, 92, 246, 0.24)),
    var(--bg-3);
  color: var(--text-0);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-presence {
  overflow: visible;
}

.avatar-presence > img {
  border-radius: 50%;
}

.avatar-28 {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.avatar-30 {
  width: 30px;
  height: 30px;
  font-size: 10px;
}

.avatar-36 {
  width: 36px;
  height: 36px;
  font-size: 11px;
}

.avatar-38 {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

.avatar-44 {
  width: 44px;
  height: 44px;
  font-size: var(--fs-sm);
}

.avatar-46 {
  width: 46px;
  height: 46px;
  font-size: var(--fs-sm);
}

.avatar-52 {
  width: 52px;
  height: 52px;
  font-size: var(--fs-md);
}

.avatar-72 {
  width: 72px;
  height: 72px;
  font-size: var(--fs-xl);
}

.avatar-96 {
  width: 96px;
  height: 96px;
  font-size: var(--fs-2xl);
}

.presence-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-3);
}

.avatar .presence-dot {
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--bg-1);
}

.presence-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.presence-dot.offline {
  background: var(--text-3);
}

/* ------------------------------------------------------------------ Empty & skeleton */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--text-2);
}

.empty > svg {
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  opacity: 0.4;
  color: var(--accent);
}

.empty-title {
  color: var(--text-0);
  font-size: var(--fs-md);
  font-weight: 650;
}

.empty-text {
  max-width: 340px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-3);
}

.empty .btn {
  margin-top: 6px;
}

.empty-card {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.012);
}

.empty-compact {
  gap: 5px;
  padding: var(--sp-5) var(--sp-4);
}

.empty-compact > svg {
  width: 32px;
  height: 32px;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 45%, var(--bg-2) 65%);
  background-size: 240% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ------------------------------------------------------------------ Modal */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(8px);
  animation: fade var(--t-med) var(--ease) both;
}

.overlay.leaving {
  animation: fadeOut 160ms var(--ease) both;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 470px;
  max-height: min(88vh, 760px);
  padding: var(--sp-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background:
    radial-gradient(600px 220px at 12% 0%, rgba(34, 211, 238, 0.08), transparent 60%),
    var(--bg-2);
  box-shadow: var(--shadow-3);
  animation: modalIn var(--t-med) var(--ease) both;
}

.modal-sm {
  max-width: 410px;
}

.modal-lg {
  max-width: 720px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.modal-heading {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.modal-description {
  margin-top: 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.modal-close {
  margin: -6px -6px 0 0;
}

.modal-body {
  overflow-y: auto;
  color: var(--text-1);
  font-size: var(--fs-sm);
}

.modal-body p {
  color: var(--text-2);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

/* ------------------------------------------------------------------ Toasts */
.toast-stack {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(92vw, 380px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: rgba(18, 23, 36, 0.96);
  box-shadow: var(--shadow-2);
  color: var(--text-1);
  font-size: var(--fs-sm);
  line-height: 1.5;
  pointer-events: auto;
  animation: toastIn var(--t-med) var(--ease-out) both;
  backdrop-filter: blur(14px);
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-info {
  border-left-color: var(--accent);
}

.toast-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}

.toast-success .toast-icon {
  color: var(--success);
  background: rgba(52, 211, 153, 0.12);
}

.toast-error .toast-icon {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.12);
}

.toast-icon svg {
  width: 15px;
  height: 15px;
}

.toast-message {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.toast-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--text-3);
  transition: color var(--t-fast), background var(--t-fast);
}

.toast-close:hover {
  color: var(--text-0);
  background: var(--bg-3);
}

.toast.leaving {
  animation: toastOut 220ms var(--ease) both;
}

/* ==========================================================================
   Landing page
   ========================================================================== */
.landing-body {
  overflow-x: hidden;
}

.landing {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.landing-glow {
  position: absolute;
  z-index: 0;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.5;
  pointer-events: none;
}

.landing-glow-a {
  top: -16vw;
  left: -12vw;
  background: rgba(34, 211, 238, 0.2);
}

.landing-glow-b {
  top: 6vw;
  right: -16vw;
  background: rgba(139, 92, 246, 0.24);
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.023) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.023) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 68%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 68%);
  pointer-events: none;
}

.landing-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  max-width: 1260px;
  margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 48px);
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.landing-links a {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 550;
  letter-spacing: 0.005em;
}

.landing-links a:hover {
  color: var(--text-0);
  text-decoration: none;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: var(--sp-3);
}

.landing-nav-actions .btn {
  padding: 0.52rem 0.9rem;
  font-size: var(--fs-sm);
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  align-items: center;
  gap: clamp(40px, 5.5vw, 88px);
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(44px, 6vw, 84px) clamp(20px, 4vw, 48px) clamp(68px, 8vw, 118px);
}

.hero-copy h1 {
  margin: 20px 0 20px;
  font-size: clamp(2.55rem, 5vw, 4.35rem);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.hero-lead {
  max-width: 570px;
  color: var(--text-1);
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  line-height: 1.68;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 550;
}

.point-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.07);
  color: var(--accent);
}

.point-icon svg {
  width: 15px;
  height: 15px;
}

/* Hero product preview */
.hero-preview {
  position: relative;
  isolation: isolate;
}

.hero-preview::before {
  content: "";
  position: absolute;
  inset: 12% 6% -6%;
  z-index: -1;
  border-radius: 40px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.3), rgba(139, 92, 246, 0.32));
  filter: blur(58px);
  opacity: 0.55;
}

.preview-window {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(700px 280px at 85% 0%, rgba(139, 92, 246, 0.1), transparent 55%),
    linear-gradient(170deg, #121826 0%, #0a0e18 100%);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: perspective(1400px) rotateY(-3deg) rotateX(1deg);
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}

.preview-dots {
  display: flex;
  gap: 5px;
}

.preview-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.preview-dots i:first-child {
  background: rgba(251, 113, 133, 0.6);
}

.preview-dots i:nth-child(2) {
  background: rgba(251, 191, 36, 0.6);
}

.preview-dots i:nth-child(3) {
  background: rgba(52, 211, 153, 0.6);
}

.preview-title {
  flex: 1;
  color: var(--text-1);
  font-size: var(--fs-xs);
  font-weight: 650;
  text-align: center;
  letter-spacing: 0.04em;
}

.preview-online {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preview-online i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.preview-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 18px 18px;
}

.preview-day {
  text-align: center;
  margin-bottom: 2px;
}

.preview-day span {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 10px;
}

.preview-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
  animation: rise var(--t-slow) var(--ease) both;
}

.preview-msg.in {
  align-self: flex-start;
}

.preview-msg.out {
  align-self: flex-end;
}

.preview-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.28), rgba(139, 92, 246, 0.4));
  color: #e0f2fe;
  font-size: 9px;
  font-weight: 800;
}

.preview-bubble {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  background: var(--bg-3);
  color: var(--text-1);
  font-size: 12px;
  line-height: 1.45;
}

.preview-msg.out .preview-bubble {
  border: 0;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, #1fbcd6, #7c6af0);
  color: #04121a;
  font-weight: 550;
}

.preview-voice {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 220px;
}

.preview-play {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(4, 18, 26, 0.22);
}

.preview-play svg {
  width: 10px;
  height: 10px;
  margin-left: 1px;
}

.preview-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.preview-wave i {
  width: 2px;
  border-radius: 2px;
  background: rgba(4, 18, 26, 0.55);
}

.preview-wave i:nth-child(1) { height: 6px; }
.preview-wave i:nth-child(2) { height: 11px; }
.preview-wave i:nth-child(3) { height: 16px; }
.preview-wave i:nth-child(4) { height: 9px; }
.preview-wave i:nth-child(5) { height: 18px; }
.preview-wave i:nth-child(6) { height: 13px; }
.preview-wave i:nth-child(7) { height: 7px; }
.preview-wave i:nth-child(8) { height: 14px; }
.preview-wave i:nth-child(9) { height: 5px; }

.preview-duration {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.preview-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.preview-typing-bubble {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  background: var(--bg-3);
}

.preview-typing-bubble i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-2);
  animation: typingBounce 1.3s ease-in-out infinite;
}

.preview-typing-bubble i:nth-child(2) { animation-delay: 0.15s; }
.preview-typing-bubble i:nth-child(3) { animation-delay: 0.3s; }

.preview-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 14px 14px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-3);
  font-size: 11px;
}

.preview-send {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #04121a;
}

.preview-send svg {
  width: 14px;
  height: 14px;
}

.preview-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: rgba(13, 17, 28, 0.92);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(14px);
  animation: floatY 7s ease-in-out infinite;
}

.preview-float strong {
  display: block;
  color: var(--text-0);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}

.preview-float small {
  display: block;
  color: var(--text-3);
  font-size: 9.5px;
  line-height: 1.4;
}

.float-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
}

.float-icon svg {
  width: 15px;
  height: 15px;
}

.float-icon-violet {
  background: var(--violet-soft);
  color: #c4b5fd;
}

.preview-float-a {
  top: 54px;
  left: -38px;
}

.preview-float-b {
  right: -28px;
  bottom: 44px;
  animation-delay: -3.2s;
}

/* Feature band */
.feature-band {
  position: relative;
  z-index: 1;
  padding: clamp(64px, 7vw, 104px) clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(8, 11, 19, 0.55), rgba(8, 11, 19, 0.9));
}

.section-heading {
  max-width: 680px;
  margin: 0 auto clamp(34px, 4vw, 52px);
  text-align: center;
}

.section-heading .eyebrow {
  margin: 0 auto;
}

.section-heading h2 {
  margin-top: 16px;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
  letter-spacing: -0.035em;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1260px;
  margin: 0 auto;
}

.feature-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.008));
  transition: border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease), background var(--t-med);
}

.feature-card:hover {
  border-color: rgba(34, 211, 238, 0.22);
  background: linear-gradient(165deg, rgba(34, 211, 238, 0.05), rgba(255, 255, 255, 0.01));
  transform: translateY(-3px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent);
}

.feature-icon svg {
  width: 19px;
  height: 19px;
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 650;
}

.feature-card p {
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

/* Security */
.security-section {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: start;
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) clamp(20px, 4vw, 48px);
}

.security-copy h2 {
  margin: 16px 0 18px;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  letter-spacing: -0.04em;
}

.security-copy > p {
  max-width: 520px;
  color: var(--text-1);
  font-size: 1rem;
  line-height: 1.72;
}

.honesty-note {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  padding: 15px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--r-md);
  background: rgba(251, 191, 36, 0.055);
}

.honesty-icon {
  flex-shrink: 0;
  color: var(--warning);
}

.honesty-icon svg {
  width: 19px;
  height: 19px;
}

.honesty-note p {
  color: #e7d9b3;
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.honesty-note strong {
  color: #fde68a;
}

.security-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.014);
  overflow: hidden;
}

.security-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--border);
}

.security-list li:last-child {
  border-bottom: 0;
}

.check-chip {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  background: var(--accent-softer);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.security-list strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-0);
  font-size: var(--fs-sm);
  font-weight: 650;
}

.security-list p {
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

/* Access */
.access-section {
  position: relative;
  z-index: 1;
  padding: 0 clamp(20px, 4vw, 48px) clamp(70px, 8vw, 120px);
}

.access-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  max-width: 1164px;
  margin: 0 auto;
  padding: clamp(30px, 4vw, 52px);
  border: 1px solid transparent;
  border-radius: var(--r-xl);
  background:
    linear-gradient(150deg, rgba(20, 27, 42, 0.96), rgba(10, 14, 23, 0.98)) padding-box,
    linear-gradient(135deg, rgba(34, 211, 238, 0.55), rgba(139, 92, 246, 0.55)) border-box;
  box-shadow: 0 40px 100px -50px rgba(34, 211, 238, 0.35);
}

.access-card h2 {
  margin: 14px 0 10px;
  font-size: clamp(1.65rem, 2.7vw, 2.2rem);
}

.access-card p {
  max-width: 560px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.landing-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px clamp(20px, 4vw, 48px) 34px;
  border-top: 1px solid var(--border);
}

.landing-footer p {
  flex: 1;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.footer-note {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* ==========================================================================
   Authentication pages
   ========================================================================== */
.auth-body {
  overflow-x: hidden;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 36px;
  overflow: hidden;
  padding: clamp(28px, 4vw, 56px);
  border-right: 1px solid var(--border);
  background:
    radial-gradient(800px 500px at 12% 4%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(700px 520px at 92% 70%, rgba(139, 92, 246, 0.17), transparent 60%),
    linear-gradient(160deg, #0a0e18, #06080e);
}

.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 26% 22%, #000, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at 26% 22%, #000, transparent 74%);
  pointer-events: none;
}

.auth-aside > * {
  position: relative;
  z-index: 1;
}

.auth-aside-copy {
  max-width: 480px;
  margin-top: auto;
}

.auth-aside-copy h1 {
  margin: 18px 0 16px;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.auth-aside-copy p {
  max-width: 430px;
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.7;
}

.auth-points,
.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 460px;
}

.auth-points li,
.auth-steps li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.auth-point-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.07);
  color: var(--accent);
}

.auth-point-icon svg {
  width: 17px;
  height: 17px;
}

.auth-points strong,
.auth-steps strong {
  display: block;
  color: var(--text-1);
  font-size: var(--fs-sm);
  font-weight: 650;
}

.auth-points span,
.auth-steps li > div > span {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.auth-steps li > span:first-child {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 750;
}

.auth-aside-foot {
  max-width: 440px;
  margin-top: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(24px, 4vw, 56px) clamp(18px, 4vw, 48px);
  background:
    radial-gradient(740px 500px at 88% 6%, rgba(139, 92, 246, 0.08), transparent 62%),
    radial-gradient(640px 500px at 6% 96%, rgba(34, 211, 238, 0.06), transparent 60%);
}

.auth-mobile-brand {
  display: none;
  width: 100%;
  max-width: 440px;
  margin-bottom: 4px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(24px, 3.2vw, 38px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background:
    radial-gradient(520px 220px at 14% 0%, rgba(34, 211, 238, 0.07), transparent 62%),
    rgba(14, 18, 29, 0.86);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  animation: rise var(--t-slow) var(--ease) both;
}

.auth-card-wide {
  max-width: 510px;
}

.auth-card-head {
  margin-bottom: 24px;
}

.auth-card-head h2 {
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.auth-card-head p {
  margin-top: 7px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.auth-card .btn-block {
  margin-top: 4px;
}

.auth-switch {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-align: center;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
}

.auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.auth-trust svg {
  width: 13px;
  height: 13px;
  color: var(--text-3);
}

.auth-legal {
  max-width: 430px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.approval-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
}

.approval-note svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--accent);
}

.approval-note p {
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.approval-note strong {
  color: var(--text-1);
}

.auth-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 2px;
  text-align: center;
  animation: rise var(--t-med) var(--ease) both;
}

.success-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 8px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.1);
  color: var(--success);
  box-shadow: 0 0 0 9px rgba(52, 211, 153, 0.04);
}

.success-orbit::after {
  content: "";
  position: absolute;
  inset: -13px;
  border: 1px dashed rgba(52, 211, 153, 0.24);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.success-orbit svg {
  width: 28px;
  height: 28px;
}

.auth-success h2 {
  font-size: 1.4rem;
}

.auth-success p {
  max-width: 340px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.auth-success .btn {
  margin-top: 14px;
}

/* ------------------------------------------------------------------ Animations */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(18px) scale(0.98);
  }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16); }
  50% { opacity: 0.55; box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.06); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 62px;
    padding-top: 40px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-preview {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
  }

  .preview-float-a {
    left: -14px;
  }

  .preview-float-b {
    right: -12px;
  }

  .security-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .access-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-aside {
    display: none;
  }

  .auth-main {
    justify-content: flex-start;
    padding-top: clamp(20px, 4vw, 42px);
  }

  .auth-mobile-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }
}

@media (max-width: 760px) {
  .landing-links {
    display: none;
  }

  .landing-nav-actions {
    margin-left: auto;
  }

  .landing-nav {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .hero {
    padding-bottom: 66px;
  }

  .hero-copy h1 {
    font-size: clamp(2.25rem, 9vw, 3.2rem);
  }

  .hero-points {
    gap: 10px 16px;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-window {
    transform: none;
  }

  .preview-float {
    display: none;
  }

  .landing-footer {
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  .landing-footer p {
    flex-basis: 100%;
    order: 3;
  }

  .auth-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .landing-nav-actions .btn-primary {
    display: none;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ Custom Nebula Language Toggle */
.lang-toggle {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(13, 18, 33, 0.88), rgba(9, 12, 22, 0.94));
  color: #f1f5f9;
  box-shadow:
    0 4px 20px -2px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  user-select: none;
  direction: ltr;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s,
    box-shadow 0.25s;
}

.lang-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow:
    0 8px 26px -4px rgba(0, 0, 0, 0.75),
    0 0 20px -2px rgba(56, 189, 248, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.lang-toggle:active {
  transform: translateY(0px) scale(0.95);
}

.lang-toggle.lang-is-fa {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow:
    0 4px 20px -2px rgba(0, 0, 0, 0.65),
    0 0 16px -2px rgba(16, 185, 129, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.lang-toggle.lang-is-fa:hover {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow:
    0 8px 26px -4px rgba(0, 0, 0, 0.75),
    0 0 22px -2px rgba(16, 185, 129, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Custom 3D Holographic Globe Emoji */
.lang-emoji-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.lang-globe-svg {
  width: 28px;
  height: 28px;
  overflow: visible;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.lang-toggle:hover .lang-globe-svg {
  transform: scale(1.08);
}

.lang-toggle .globe-sphere {
  fill: url(#nebulaGlobeGradEn);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
  transition: fill 0.4s ease, filter 0.4s ease;
}

.lang-toggle.lang-is-fa .globe-sphere {
  fill: url(#nebulaGlobeGradFa);
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.55));
}

.globe-satellite {
  filter: drop-shadow(0 0 3px #ffffff);
  transform-origin: 18px 18px;
  transition: transform 0.4s ease;
}

.lang-toggle:hover .globe-satellite {
  animation: satelliteHoverOrbit 2.4s linear infinite;
}

@keyframes satelliteHoverOrbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dual-Tag Pill Track */
.lang-pill-track {
  position: relative;
  display: flex;
  align-items: center;
  width: 52px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 2px;
  box-sizing: border-box;
}

.lang-pill-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 18px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.35s ease, box-shadow 0.35s ease;
  z-index: 1;
}

.lang-toggle.lang-is-fa .lang-pill-thumb {
  transform: translateX(24px);
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.75);
}

.lang-pill-text {
  position: relative;
  z-index: 2;
  width: 24px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.3s ease;
  line-height: 18px;
}

.lang-toggle.lang-is-en .lang-text-en,
.lang-toggle:not(.lang-is-fa) .lang-text-en {
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.lang-toggle.lang-is-fa .lang-text-fa {
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

/* Shockwave Ripple Ring */
.lang-ripple {
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  border: 2px solid #38bdf8;
  opacity: 0;
  pointer-events: none;
}

.lang-toggle.lang-is-fa .lang-ripple {
  border-color: #34d399;
}

/* Micro Sparkle Particles */
.lang-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sp-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
}

.sp-1 { color: #38bdf8; }
.sp-2 { color: #f43f5e; }
.sp-3 { color: #fbbf24; }
.sp-4 { color: #a855f7; }

/* ------------------------------------------------------------------ Click Animations */
.lang-toggle.switching .lang-ripple {
  animation: langRippleBurst 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes langRippleBurst {
  0% {
    transform: scale(0.8);
    opacity: 0.95;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.lang-toggle.switching .lang-globe-svg {
  animation: globeGyroSpin 0.68s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes globeGyroSpin {
  0% {
    transform: perspective(500px) rotateY(0deg) rotateX(0deg) scale(1);
  }
  45% {
    transform: perspective(500px) rotateY(190deg) rotateX(15deg) scale(1.35);
    filter: brightness(1.6) drop-shadow(0 0 12px rgba(168, 85, 247, 0.85));
  }
  100% {
    transform: perspective(500px) rotateY(360deg) rotateX(0deg) scale(1);
  }
}

.lang-toggle.switching .sp-1 { animation: spFly1 0.62s ease-out forwards; }
.lang-toggle.switching .sp-2 { animation: spFly2 0.62s ease-out forwards; }
.lang-toggle.switching .sp-3 { animation: spFly3 0.62s ease-out forwards; }
.lang-toggle.switching .sp-4 { animation: spFly4 0.62s ease-out forwards; }

@keyframes spFly1 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(-28px, -24px) scale(1.3); opacity: 0; }
}

@keyframes spFly2 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(32px, -22px) scale(1.2); opacity: 0; }
}

@keyframes spFly3 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(34px, 20px) scale(1.3); opacity: 0; }
}

@keyframes spFly4 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(-26px, 22px) scale(1.1); opacity: 0; }
}

/* Page-wide Cinematic Morph Transition */
body.lang-morphing main,
body.lang-morphing .app-shell,
body.lang-morphing .auth-layout,
body.lang-morphing .admin-container {
  animation: pageLangMorph 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageLangMorph {
  0% {
    opacity: 1;
    filter: blur(0px);
  }
  30% {
    opacity: 0.86;
    filter: blur(2px) brightness(1.05);
    transform: scale(0.998);
  }
  100% {
    opacity: 1;
    filter: blur(0px) brightness(1);
    transform: scale(1);
  }
}

/* Responsive adjustment */
@media (max-width: 600px) {
  .lang-toggle {
    top: 10px;
    right: 12px;
    padding: 4px 8px 4px 5px;
    gap: 6px;
  }
  .lang-emoji-box {
    width: 24px;
    height: 24px;
  }
  .lang-globe-svg {
    width: 24px;
    height: 24px;
  }
  .lang-pill-track {
    width: 46px;
    height: 22px;
  }
  .lang-pill-thumb {
    width: 20px;
    height: 16px;
  }
  .lang-toggle.lang-is-fa .lang-pill-thumb {
    transform: translateX(20px);
  }
  .lang-pill-text {
    width: 20px;
    font-size: 10px;
    line-height: 16px;
  }
}
