/* TJ Loop — dark SaaS design system (trilingual-friendly) */
:root {
  --ground: #0a0c12;
  --ground-2: #0e111a;
  --surface: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #eaf0ff;
  --ink-dim: #98a2bd;
  --ink-faint: #5a6480;
  --teal: #33e7c9;
  --violet: #7c5cff;
  --lime: #9dff5c;
  --amber: #ffb86b;
  --danger: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.bgfx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(800px 500px at 80% -5%, rgba(51,231,201,0.12), transparent 60%),
    radial-gradient(700px 500px at 5% 10%, rgba(124,92,255,0.13), transparent 58%),
    var(--ground);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
.shell { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.muted { color: var(--ink-dim); }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }

/* glass */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 20px 50px -28px rgba(0,0,0,0.9);
}
.card { padding: 22px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,18,0.7); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--ink-dim); font-size: 0.92rem; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  padding: 0.62rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.3s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { color: #042; background: linear-gradient(180deg, #6df0db, var(--teal)); box-shadow: 0 10px 28px -12px rgba(51,231,201,0.8); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -12px rgba(51,231,201,0.95); }
.btn-violet { color: #fff; background: linear-gradient(180deg, #9a80ff, var(--violet)); }
.btn-ghost { color: var(--ink); background: rgba(255,255,255,0.05); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); }
.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.84rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.82rem; color: var(--ink-dim); }
.input, select.input, textarea.input {
  font: inherit; color: var(--ink); background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(51,231,201,0.15); }
textarea.input { resize: vertical; min-height: 96px; }

/* chips / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-dim); padding: 0.28rem 0.65rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.badge { font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; }
.badge.pending { color: var(--amber); background: rgba(255,184,107,0.13); }
.badge.paid { color: var(--teal); background: rgba(51,231,201,0.13); }
.badge.delivered { color: var(--lime); background: rgba(157,255,92,0.14); }
.badge.open { color: var(--violet); background: rgba(124,92,255,0.16); }
.badge.resolved { color: var(--ink-dim); background: rgba(255,255,255,0.06); }

/* layout helpers */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.center { text-align: center; }
.hidden { display: none !important; }

/* steps (the loop) */
.steps { display: flex; flex-wrap: wrap; gap: 8px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-dim); }
.step .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.7rem; }
.step.active .dot { background: linear-gradient(180deg, #6df0db, var(--teal)); color: #042; border-color: transparent; }
.step.done .dot { background: rgba(157,255,92,0.18); color: var(--lime); border-color: transparent; }
.step .sep { color: var(--ink-faint); }

/* lang switcher */
.lang { position: relative; }
.lang-btn { cursor: pointer; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; padding: 6px; z-index: 60; }
.lang-menu button { display: flex; width: 100%; justify-content: space-between; padding: 0.5rem 0.6rem; border: none; background: transparent; color: var(--ink-dim); font: inherit; font-size: 0.9rem; cursor: pointer; border-radius: 8px; }
.lang-menu button:hover, .lang-menu button.active { background: rgba(51,231,201,0.12); color: #fff; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 200; padding: 0.7rem 1.1rem; border-radius: 12px; background: #11141f; border: 1px solid var(--line-2); opacity: 0; transition: all 0.3s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255,107,107,0.5); }

/* bot widget */
.bot-fab { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; background: linear-gradient(180deg, #9a80ff, var(--violet)); box-shadow: 0 12px 30px -10px rgba(124,92,255,0.8); display: grid; place-items: center; }
.bot-panel { position: fixed; right: 20px; bottom: 86px; z-index: 90; width: min(360px, calc(100vw - 40px)); height: 460px; display: flex; flex-direction: column; overflow: hidden; }
.bot-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.bot-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bot-msg { max-width: 82%; padding: 0.6rem 0.8rem; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; }
.bot-msg.user { align-self: flex-end; background: linear-gradient(180deg,#6df0db,var(--teal)); color: #042; }
.bot-msg.bot { align-self: flex-start; background: rgba(255,255,255,0.06); border: 1px solid var(--line); }
.bot-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

/* tables / lists */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }

/* responsive */
@media (max-width: 760px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .nav-links .hide-sm { display: none; }
}
