/* discon frontend system: dark service UI layered on Tailwind CDN. */

:root {
  --bg: #080a10;
  --bg-2: #10131d;
  --nav: #0b0e15;
  --footer: #070910;
  --surface: rgba(18, 22, 33, 0.82);
  --surface-2: rgba(25, 30, 45, 0.94);
  --surface-3: rgba(255, 255, 255, 0.055);
  --hair: rgba(255, 255, 255, 0.10);
  --hair-2: rgba(255, 255, 255, 0.18);
  --text: #f4f7fb;
  --muted: #a0a8b8;
  --faint: #697286;

  --brand: #6c7cff;
  --brand-dark: #9aa5ff;
  --brand-soft: rgba(108, 124, 255, 0.15);
  --signal: #2bd4a7;
  --signal-soft: rgba(43, 212, 167, 0.13);

  --online: #2bd46f;
  --idle: #f3b343;
  --dnd: #ff5b66;
  --offline: #697286;
  --shadow: 0 28px 90px -40px rgba(0, 0, 0, 0.85);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

::selection { background: rgba(108, 124, 255, 0.28); color: var(--text); }
[x-cloak] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); background-clip: content-box; }

.app-container {
  width: min(100% - 32px, 1180px);
  margin-inline: auto;
}

.bg-field {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  background:
    radial-gradient(900px 560px at 18% -10%, rgba(108, 124, 255, 0.20), transparent 62%),
    radial-gradient(760px 520px at 86% 12%, rgba(43, 212, 167, 0.11), transparent 58%),
    linear-gradient(180deg, #0b0e17 0%, var(--bg) 46%, #06070c 100%);
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -9;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 72%);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, var(--brand), #18c6a3);
  color: white;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 16px 34px -18px rgba(108, 124, 255, 0.95);
}
.brand-mark-sm { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }

.icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  flex: none;
}

.mono-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--faint);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.065); }
.nav-link-accent { color: var(--brand-dark); }

.tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .03em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
}
.tag-signal { color: #7cf0cf; border-color: rgba(43,212,167,.26); background: var(--signal-soft); }
.tag-muted  { color: var(--muted); }
.tag-red    { color: #ff9ca2; border-color: rgba(255,91,102,.26); background: rgba(255,91,102,.10); }
.tag-blue   { color: #c7cdff; border-color: rgba(108,124,255,.28); background: var(--brand-soft); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.card-hover { transition: border-color .16s, transform .16s, background .16s, box-shadow .16s; }
.card-hover:hover {
  border-color: var(--hair-2);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: 0 32px 88px -42px rgba(0, 0, 0, 0.92);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .08s, box-shadow .16s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 18px 34px -18px rgba(108, 124, 255, 0.95);
}
.btn-primary:hover:not(:disabled) { background: #5968f0; }
.btn-ghost { background: rgba(255,255,255,.055); color: var(--text); border-color: var(--hair); }
.btn-ghost:hover:not(:disabled) { border-color: var(--hair-2); background: rgba(255,255,255,.09); }
.btn-danger { background: rgba(255,91,102,.11); color: #ffb0b5; border-color: rgba(255,91,102,.26); }
.btn-danger:hover:not(:disabled) { background: rgba(255,91,102,.18); }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }

.input, .select, .textarea {
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.055);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(108,124,255,.58);
  box-shadow: 0 0 0 3px rgba(108,124,255,.16);
  background: rgba(255,255,255,.085);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666d7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.input-mono { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: .01em; }

.dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; flex: none; }
.dot-online  { background: var(--online);  box-shadow: 0 0 0 4px rgba(23,167,102,.12); }
.dot-idle    { background: var(--idle);    box-shadow: 0 0 0 4px rgba(199,129,0,.12); }
.dot-dnd     { background: var(--dnd);     box-shadow: 0 0 0 4px rgba(223,63,69,.12); }
.dot-offline { background: var(--offline); box-shadow: 0 0 0 4px rgba(156,163,175,.12); }
.dot-pulse { animation: dotpulse 2s ease-in-out infinite; }
@keyframes dotpulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(23,167,102,.16); }
  50% { box-shadow: 0 0 0 7px rgba(23,167,102,0); }
}

.toggle {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid var(--hair);
  position: relative;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  flex: none;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #eef1ff;
  transition: transform .18s, background .18s;
  box-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.toggle:checked { background: var(--signal); border-color: transparent; }
.toggle:checked::after { transform: translateX(18px); }

.seg {
  width: 100%;
  min-height: 38px;
  padding: 8px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--hair);
  background: rgba(255,255,255,.055);
  color: var(--muted);
  cursor: pointer;
  transition: all .14s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.seg:hover { background: rgba(255,255,255,.09); color: var(--text); }
.seg-on { background: var(--brand-soft); border-color: rgba(108,124,255,.42); color: var(--brand-dark); }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left;
  padding: 12px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--hair);
  background: rgba(255,255,255,.045);
}
.tbl td { padding: 14px; border-bottom: 1px solid rgba(255,255,255,.065); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255,255,255,.04); }

.modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(3,5,10,.72); backdrop-filter: blur(9px); }
.modal-panel { position: relative; z-index: 41; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .42s cubic-bezier(.2,.7,.3,1) both; }
.rise-1 { animation-delay: .04s; } .rise-2 { animation-delay: .09s; }
.rise-3 { animation-delay: .14s; } .rise-4 { animation-delay: .19s; }

.spinner {
  width: 15px;
  height: 15px;
  flex: none;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: .85;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn[data-loading] { cursor: progress; }

#toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  font-size: 13.5px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: rgba(18,22,33,.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 58px -30px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  gap: 9px;
  transform: translateX(16px);
  opacity: 0;
  transition: all .24s;
}
.toast.in { transform: translateX(0); opacity: 1; }
.toast-success { border-color: rgba(43,212,167,.30); }
.toast-success .toast-dot { background: var(--signal); }
.toast-error { border-color: rgba(255,91,102,.30); }
.toast-error .toast-dot { background: var(--dnd); }
.toast-dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }

.hero-panel {
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: rgba(18,22,33,.72);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.metric {
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  padding: 14px;
}

.generated-key { color: var(--brand-dark); }

@media (max-width: 760px) {
  .app-container { width: min(100% - 24px, 1180px); }
  .btn { width: 100%; }
  .btn.btn-sm { width: auto; }
  .nav-link span { display: none; }
  #toast-host { left: 12px; right: 12px; top: 12px; }
}
