/* RoboChat — shared look: colors, type, buttons, fields, dialogs */
:root {
  --void: #070914;
  --glass: rgba(14, 18, 36, 0.62);
  --glass-strong: rgba(13, 16, 32, 0.86);
  --glass-hi: rgba(36, 44, 82, 0.5);
  --line: rgba(170, 185, 255, 0.12);
  --line-2: rgba(170, 185, 255, 0.24);
  --text: #dde3f7;
  --muted: #8c93b3;
  --ice: #7fe7ff;
  --orchid: #c59bff;
  --ember: #ff8a7a;
  --mint: #6bf2c2;
  --r-l: 22px;
  --r-m: 14px;
  --r-s: 10px;
  --blur: 18px;
  --font: "Inter", "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-d: "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }

/* Background */
#bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0;
  display: block; background: var(--void);
}
.no-webgl body, html.no-webgl {
  background:
    radial-gradient(1200px 700px at 20% 15%, rgba(40, 110, 160, 0.35), transparent 60%),
    radial-gradient(900px 600px at 85% 80%, rgba(120, 50, 170, 0.35), transparent 60%),
    var(--void);
}
.no-webgl #bg { display: none; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; font: 650 17px/1 var(--font-d); letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; flex: none; }

/* Fields and buttons */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 11px 14px;
  background: rgba(5, 7, 15, 0.55); border: 1px solid var(--line-2); border-radius: var(--r-m);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #5f6688; }
.input:focus { border-color: var(--ice); box-shadow: 0 0 0 3px rgba(127, 231, 255, 0.15); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--glass-hi); font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { border-color: rgba(170, 185, 255, 0.4); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  border: 0; color: #041018;
  background: linear-gradient(135deg, #9af0ff, #7fb2ff 55%, #c59bff);
  box-shadow: 0 8px 24px -8px rgba(127, 200, 255, 0.6);
}
.btn-danger { border-color: rgba(255, 138, 122, 0.4); color: var(--ember); background: rgba(255, 138, 122, 0.08); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--glass-hi); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.error-text { color: var(--ember); font-size: 14px; min-height: 1.5em; margin: 0; }

/* Glass panel */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
}

/* Robots */
.robot { display: block; flex: none; overflow: visible; }
.robot .rb-ant { filter: drop-shadow(0 0 3px var(--rc)); animation: rb-glow 3.2s ease-in-out infinite; animation-delay: var(--rd); }
.robot .rb-eyes { transform-box: fill-box; transform-origin: center; animation: rb-blink 5s infinite; animation-delay: var(--rd); }
@keyframes rb-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes rb-glow { 50% { opacity: 0.45; } }
.ava { position: relative; flex: none; }
.ava .dot {
  position: absolute; right: -1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%;
  background: #4a5070; border: 2px solid #0c1022;
}
.ava.on .dot { background: var(--mint); box-shadow: 0 0 8px var(--mint); }

/* Dialogs */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 5, 12, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade-in 0.18s ease-out;
}
.modal {
  width: min(380px, 100%); padding: 26px 24px 22px; border-radius: var(--r-l);
  background: var(--glass-strong); border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  animation: rise 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal h2 { margin: 0 0 6px; font: 650 20px/1.25 var(--font-d); letter-spacing: -0.02em; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.97); } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--line-2); font-size: 14px;
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.7);
  animation: rise 0.2s ease-out;
}
.toast.bad { border-color: rgba(255, 138, 122, 0.5); color: #ffd2cb; }

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