/* ==========================================================================
   Ready2Go Servers console design system — shared by auth.html and dashboard.html
   Amber on obsidian, Plus Jakarta Sans + JetBrains Mono (same as the landing).
   ========================================================================== */
:root {
  --bg: #07080c;
  --bg-2: #0b0c12;
  --panel: #101119;
  --panel-2: #151722;
  --panel-3: #1b1e2b;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --dim: #808a9e;  /* 4.9:1+ on every console surface */
  --amber: #facc15;
  --amber-2: #fde047;
  --amber-soft: rgba(250, 204, 21, 0.1);
  --amber-line: rgba(250, 204, 21, 0.3);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, 0.12);
  --blue: #60a5fa;
  --font: 'Plus Jakarta Sans', 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(250, 204, 21, 0.3); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
[hidden] { display: none !important; }

/* --- Brand ------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: #fff;
}
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand strong { color: var(--amber); font-weight: 800; }

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 700 14px var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.25s var(--spring), box-shadow 0.25s;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--amber); color: #0a0b10; box-shadow: 0 6px 20px rgba(250, 204, 21, 0.18); }
.btn-primary:hover:not(:disabled) { background: var(--amber-2); box-shadow: 0 8px 28px rgba(250, 204, 21, 0.32); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); }
.btn-danger { background: var(--red-soft); border-color: rgba(244, 63, 94, 0.35); color: #fda4af; }
.btn-danger:hover:not(:disabled) { background: rgba(244, 63, 94, 0.2); }
.btn-text { background: none; border: 0; color: var(--muted); min-height: 36px; padding: 0 10px; }
.btn-text:hover { color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; min-height: 34px; }
.btn .spinner { width: 16px; height: 16px; }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0.8;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Forms ------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.field-label a, .field-label button { font-size: 12.5px; font-weight: 600; color: var(--amber); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.field-label a:hover, .field-label button:hover { text-decoration: underline; }
.field-hint { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.field-error { font-size: 12.5px; color: #fda4af; display: flex; gap: 6px; align-items: flex-start; }
.field-error svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: 500 15px var(--font);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.textarea { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255, 255, 255, 0.2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--amber); background: rgba(250, 204, 21, 0.03); box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.1); }
.input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1); }
.input.has-icon { padding-left: 42px; }
.input.has-action { padding-right: 46px; }
.input-icon { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--dim); pointer-events: none; }
.input-action {
  position: absolute; right: 5px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: none; color: var(--dim); cursor: pointer;
}
.input-action:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.input-action svg { width: 17px; height: 17px; }
.input-mono { font-family: var(--mono); font-size: 14px; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  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='%236b7487' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.select option { background: var(--panel-2); }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--red-soft); border-color: rgba(244, 63, 94, 0.3); color: #fecdd3; }
.alert-success { background: var(--green-soft); border-color: rgba(34, 197, 94, 0.3); color: #bbf7d0; }
.alert-info { background: var(--amber-soft); border-color: var(--amber-line); color: #fef08a; }

/* --- Switch ------------------------------------------------------------ */
.switch { position: relative; display: inline-flex; flex-shrink: 0; width: 46px; height: 28px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  transition: background 0.2s, border-color 0.2s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.3s var(--spring), background 0.2s;
}
.switch input:checked + span { background: var(--amber); border-color: var(--amber); }
.switch input:checked + span::after { transform: translateX(18px); background: #0a0b10; }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

/* --- Segmented / lang -------------------------------------------------- */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.seg button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  font: 700 12px var(--mono);
  color: var(--dim);
  cursor: pointer;
}
.seg button.is-active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.lang-pick svg { width: 15px; height: 15px; flex-shrink: 0; }
.lang-pick .select { min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; width: auto; }

/* --- Badges ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font: 700 11.5px var(--font);
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-green { color: #86efac; background: var(--green-soft); border-color: rgba(34, 197, 94, 0.25); }
.badge-amber { color: #fde68a; background: var(--amber-soft); border-color: var(--amber-line); }
.badge-red { color: #fda4af; background: var(--red-soft); border-color: rgba(244, 63, 94, 0.25); }
.badge-gray { color: var(--muted); background: rgba(255, 255, 255, 0.05); border-color: var(--line); }
.badge-blue { color: #93c5fd; background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.25); }
.badge.is-live i { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* --- Spotlight (React Bits port, see fx.js) ---------------------------- */
.spot { position: relative; isolation: isolate; --sx: 50%; --sy: 50%; --sp: 0; --sf: 0; }
.spot::before,
.spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.spot::before {
  z-index: -1;
  background: radial-gradient(calc(280px + 60px * var(--sf)) circle at var(--sx) var(--sy), rgba(250, 204, 21, 0.1), rgba(250, 204, 21, 0.03) 45%, transparent 70%);
  opacity: var(--sp);
}
.spot::after {
  z-index: 1;
  padding: 1px;
  background: radial-gradient(160px circle at var(--sx) var(--sy), rgba(250, 204, 21, 0.6), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: calc(var(--sp) * 0.8);
}

.shiny {
  background: linear-gradient(110deg, var(--amber) 35%, #fff7c2 50%, var(--amber) 65%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny 3.6s ease-in-out infinite;
}
@keyframes shiny { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }

/* --- Dialog ------------------------------------------------------------ */
.dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: dlg-in 0.32s var(--ease); }
.dialog::backdrop { background: rgba(3, 4, 8, 0.72); backdrop-filter: blur(6px); animation: fade-in 0.25s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }
.dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; flex: 1; min-width: 0; }
.dialog-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.dialog-foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.dialog-wide { width: min(760px, calc(100vw - 24px)); }
@media (max-width: 640px) {
  .dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .dialog[open] { animation: sheet-in 0.36s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
}

/* --- Toast ------------------------------------------------------------- */
.fx-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 3000;
  max-width: min(92vw, 480px);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #0a0b10;
  background: var(--amber);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--spring);
}
.fx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.fx-toast[data-kind="error"] { background: var(--red); color: #fff; }
.fx-toast[data-kind="success"] { background: var(--green); color: #04130d; }

/* --- Skeleton ---------------------------------------------------------- */
.skel {
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(255,255,255,0.035) 30%, rgba(255,255,255,0.075) 50%, rgba(255,255,255,0.035) 70%) 0 0 / 300% 100%;
  animation: skel 1.4s linear infinite;
}
@keyframes skel { to { background-position: -150% 0; } }

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

/* --- Skip link (keyboard users jump past the header) --------------------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 5000; padding: 10px 14px; border-radius: 10px; background: var(--amber); color: #0a0b10; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
