/* Shared design system for the Toshost Claude Code panel — one visual
   language across login/add-device/ssh-keys/claudecode instead of four
   copies of the same flat-card look. */

:root {
  color-scheme: light;
  --accent: #1f9e8a;
  --accent2: #2a6fb5;
  --accent-bright: #3fd0b3;
  --accent-glow: rgba(31, 158, 170, .16);
  --bg: #f2f8f7;
  --bg-blob-1: rgba(31, 158, 138, .16);
  --bg-blob-2: rgba(42, 111, 181, .15);
  --bg-blob-3: rgba(80, 210, 170, .12);
  --ink: #16262a;
  --ink-soft: #3d5a58;
  --line: #d8e6e2;
  --line-soft: rgba(216, 230, 226, .6);
  --muted: #6b8b88;
  --card: rgba(255, 255, 255, .74);
  --card-solid: #ffffff;
  --card-border: rgba(255, 255, 255, .6);
  --bubble-bot: #ffffff;
  --code-bg: #0f2523;
  --code-ink: #d9f0ea;
  --success: #2f9e63;
  --danger: #d64545;
  --shadow-sm: 0 1px 2px rgba(16, 38, 38, .05), 0 1px 1px rgba(16, 38, 38, .03);
  --shadow-md: 0 8px 24px rgba(16, 38, 38, .08), 0 2px 6px rgba(16, 38, 38, .05);
  --shadow-lg: 0 24px 70px rgba(16, 38, 38, .14), 0 6px 20px rgba(16, 38, 38, .07);
  --shadow-glow: 0 0 0 1px rgba(255, 255, 255, .5) inset, 0 1px 0 rgba(255, 255, 255, .8) inset;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --accent: #35b8a0;
    --accent2: #2f86c9;
    --accent-bright: #5fe0c4;
    --accent-glow: rgba(53, 184, 160, .18);
    --bg: #0c1614;
    --bg-blob-1: rgba(53, 184, 160, .16);
    --bg-blob-2: rgba(47, 134, 201, .14);
    --bg-blob-3: rgba(53, 184, 160, .08);
    --ink: #e3f3ef;
    --ink-soft: #b9d9d2;
    --line: #1e3330;
    --line-soft: rgba(30, 51, 48, .6);
    --muted: #7fa39c;
    --card: rgba(15, 30, 28, .66);
    --card-solid: #10201e;
    --card-border: rgba(255, 255, 255, .06);
    --bubble-bot: #10201e;
    --code-bg: #081513;
    --code-ink: #d3ece5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .34);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
    --shadow-glow: 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 1px 0 rgba(255, 255, 255, .03) inset;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
code, pre { font-family: 'JetBrains Mono', monospace; }
::selection { background: var(--accent-glow); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; border: 2px solid var(--bg); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

/* Ambient gradient-mesh background — three soft blobs, slow independent
   drift so the page never feels static, tucked behind everything via a
   fixed full-viewport layer so scrolling content doesn't reveal seams. */
.mesh-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg);
}
.mesh-bg::before, .mesh-bg::after, .mesh-bg .blob3 {
  content: ''; position: absolute; border-radius: 50%; filter: blur(60px);
}
.mesh-bg::before {
  width: 46vw; height: 46vw; top: -14vw; left: -10vw;
  background: var(--bg-blob-1); animation: drift1 22s ease-in-out infinite alternate;
}
.mesh-bg::after {
  width: 40vw; height: 40vw; bottom: -16vw; right: -12vw;
  background: var(--bg-blob-2); animation: drift2 26s ease-in-out infinite alternate;
}
.mesh-bg .blob3 {
  width: 30vw; height: 30vw; top: 40%; left: 60%;
  background: var(--bg-blob-3); animation: drift1 30s ease-in-out infinite alternate-reverse;
}
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(4vw, 3vw) scale(1.08); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-3vw, -4vw) scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .mesh-bg::before, .mesh-bg::after, .mesh-bg .blob3 { animation: none; }
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.brand-logo {
  width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--accent-bright), var(--accent2));
  box-shadow: var(--shadow-md), 0 0 0 6px var(--accent-glow);
}

.btn {
  border: none; border-radius: var(--radius-sm); font-family: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s var(--ease), box-shadow .2s ease, opacity .15s ease, background .15s ease;
}
.btn:disabled { opacity: .45; cursor: default; box-shadow: none !important; transform: none !important; }
.btn-primary {
  background: linear-gradient(150deg, var(--accent-bright), var(--accent2)); color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 28px rgba(217, 119, 87, .28), var(--shadow-sm); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn-ghost {
  background: transparent; color: var(--accent2); border: 1.5px solid var(--accent-glow);
}
.btn-ghost:hover:not(:disabled) { background: var(--accent-glow); }

.field { width: 100%; margin-bottom: 12px; }
.field label { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .5); color: var(--ink); font-family: inherit; font-size: 16px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
@media (prefers-color-scheme: dark) {
  input[type=text], input[type=password], input[type=number] { background: rgba(0, 0, 0, .18); }
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
input::placeholder { color: var(--muted); opacity: .7; }

.pill-badge { font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; letter-spacing: .02em; }
.pill-badge.yes { background: rgba(47, 158, 99, .14); color: var(--success); }
.pill-badge.no { background: rgba(214, 69, 69, .12); color: var(--danger); }

.msg-note { font-size: 12.5px; margin-top: 14px; min-height: 16px; font-weight: 500; }
.msg-note.error { color: var(--danger); }
.msg-note.ok { color: var(--success); }

.hint-text { font-size: 12px; color: var(--muted); line-height: 1.55; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: none; transition: color .15s ease, gap .15s ease;
}
.back-link:hover { color: var(--accent2); gap: 9px; }
