.login-preview {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 32px);
  overflow: hidden;
  background:
    linear-gradient(90deg, oklch(0.075 0.018 265 / 0.96), oklch(0.075 0.018 265 / 0.72)),
    radial-gradient(circle at 28% 38%, oklch(0.677 0.238 38.3 / 0.42), transparent 30%),
    radial-gradient(circle at 68% 45%, oklch(0.353 0.253 264.4 / 0.54), transparent 33%),
    linear-gradient(135deg, oklch(0.075 0.018 265), oklch(0.11 0.055 264));
  color: var(--foreground);
}

.login-led {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
  padding: 2px;
  border-radius: 22px;
  isolation: isolate;
}

.login-led::before,
.login-led::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--led-angle, 0deg),
    transparent 0deg,
    oklch(0.677 0.238 38.3) 60deg,
    oklch(0.55 0.27 320) 120deg,
    oklch(0.45 0.28 264) 180deg,
    transparent 240deg,
    transparent 360deg
  );
  -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,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: led-spin 4s linear infinite;
  pointer-events: none;
}

.login-led::after {
  filter: blur(22px);
  opacity: 1;
  z-index: -1;
}

@property --led-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes led-spin {
  to { --led-angle: 360deg; }
}

@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .login-led::before,
  .login-led::after { display: none; }
}

.login-glass {
  position: relative;
  width: 100%;
  padding: 42px 34px 34px;
  overflow: hidden;
  border-radius: 20px;
  background:
    linear-gradient(180deg, oklch(0.10 0.03 265 / 0.78), oklch(0.08 0.025 265 / 0.82));
  border: 1px solid oklch(1 0 0 / 0.06);
  box-shadow:
    0 30px 90px oklch(0 0 0 / 0.7),
    inset 0 1px 0 oklch(1 0 0 / 0.12);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.login-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(120% 80% at 0% 0%, oklch(1 0 0 / 0.05), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, oklch(0.677 0.238 38.3 / 0.07), transparent 55%);
}

.login-logo,
.login-form {
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  margin-bottom: 24px;
}

.login-logo img {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px oklch(0 0 0 / 0.55));
}

.login-form { display: grid; gap: 14px; }

.login-field {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 14px;
  isolation: isolate;
}

.login-field::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    120deg,
    oklch(0.677 0.238 38.3),
    oklch(0.55 0.27 320),
    oklch(0.45 0.28 264),
    oklch(0.677 0.238 38.3)
  );
  background-size: 300% 100%;
  -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,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
  animation: field-shine 4s linear infinite;
  pointer-events: none;
}

.login-field:focus-within::before { opacity: 1; }

@keyframes field-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.login-field svg {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: oklch(1 0 0 / 0.55);
  pointer-events: none;
  transition: color .25s ease, filter .25s ease;
  z-index: 1;
}

.login-form input {
  width: 100%;
  height: 52px;
  padding: 0 18px 0 46px;
  border: 1px solid oklch(1 0 0 / 0.12);
  border-radius: 14px;
  outline: none;
  background: oklch(1 0 0 / 0.06);
  color: var(--foreground);
  font: 500 14.5px/1 system-ui, sans-serif;
  letter-spacing: 0.01em;
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
  position: relative;
  z-index: 1;
}

.login-form input::placeholder { color: oklch(1 0 0 / 0.5); }

/* ===== Autofill cross-browser sem flicker (Chrome/Edge/Opera/Safari/Firefox) ===== */
/* Webkit: Chrome, Edge, Opera, Safari, Brave */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-text-fill-color: oklch(0.985 0.003 247.858) !important;
  caret-color: oklch(0.985 0.003 247.858);
  -webkit-background-clip: text !important;
  background-clip: text !important;
  /* Mantém o fundo glass via box-shadow inset, sem alterar o background real (evita flicker do LED) */
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
  /* Bloqueia a animação de transição de cor que o webkit aplica e causa o "flash" */
  transition: background-color 600000s 0s, color 600000s 0s, -webkit-text-fill-color 600000s 0s !important;
  animation: none !important;
}

/* Firefox: usa :autofill (sem prefixo) e respeita filter para neutralizar o tom amarelo */
input:autofill,
textarea:autofill,
select:autofill {
  filter: none !important;
  background-color: transparent !important;
  color: oklch(0.985 0.003 247.858) !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
}
input:-moz-autofill {
  filter: none !important;
  background-color: transparent !important;
  color: oklch(0.985 0.003 247.858) !important;
}

/* Reforço específico dos campos do login para preservar o glass exato */
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.login-form input:-webkit-autofill:active {
  -webkit-text-fill-color: oklch(0.985 0.003 247.858) !important;
  -webkit-box-shadow:
    0 0 0 1000px oklch(0.10 0.03 265 / 1) inset,
    inset 0 0 0 1px oklch(1 0 0 / 0.12) !important;
  box-shadow:
    0 0 0 1000px oklch(0.10 0.03 265 / 1) inset,
    inset 0 0 0 1px oklch(1 0 0 / 0.12) !important;
}
.login-form input:autofill {
  background: oklch(0.10 0.03 265 / 1) !important;
  color: oklch(0.985 0.003 247.858) !important;
}

/* ===== Toasts Neon (Sonner) — responsivo, sem truncar ===== */
.neon-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  max-width: min(92vw, 420px);
  padding: 14px 18px 14px 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, oklch(0.12 0.03 265 / 0.92), oklch(0.08 0.025 265 / 0.94));
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid oklch(1 0 0 / 0.08);
  color: oklch(0.985 0.003 247.858);
  font: 500 14px/1.45 system-ui, -apple-system, sans-serif;
  box-shadow: 0 18px 50px oklch(0 0 0 / 0.55);
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.neon-toast::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor, 0 0 28px currentColor;
}

.neon-toast-title { font-weight: 600; letter-spacing: 0.01em; white-space: normal; word-break: break-word; }
.neon-toast-description {
  font-size: 12.5px;
  color: oklch(1 0 0 / 0.78);
  margin-top: 3px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.neon-toast-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 12px currentColor);
}

[data-sonner-toast][data-type="error"]   { color: oklch(0.70 0.28 22); }
[data-sonner-toast][data-type="success"] { color: oklch(0.82 0.28 145); }
[data-sonner-toast][data-type="info"]    { color: oklch(0.70 0.28 305); }
[data-sonner-toast][data-type="warning"] { color: oklch(0.80 0.20 90); }
[data-sonner-toast][data-type="loading"] { color: oklch(0.70 0.28 305); }

.neon-error   { color: oklch(0.70 0.28 22); }
.neon-success { color: oklch(0.82 0.28 145); }
.neon-info    { color: oklch(0.70 0.28 305); }

[data-sonner-toaster] { --width: min(92vw, 420px) !important; max-width: 100vw; }
@media (max-width: 640px) {
  [data-sonner-toaster][data-y-position="top"] { top: 12px !important; }
  [data-sonner-toaster] {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    --width: calc(100vw - 24px) !important;
  }
  .neon-toast { padding: 12px 14px 12px 18px; font-size: 13.5px; }
  .neon-toast-description { font-size: 12px; }
}

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Painel Admin ===== */
.admin-auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 30% 20%, oklch(0.677 0.238 38.3 / 0.25), transparent 40%),
              radial-gradient(circle at 70% 80%, oklch(0.45 0.28 264 / 0.3), transparent 40%),
              oklch(0.075 0.018 265); }
.admin-auth-card { width: 100%; max-width: 420px; padding: 36px 28px; border-radius: 18px;
  background: oklch(0.10 0.03 265 / 0.85); border: 1px solid oklch(1 0 0 / 0.08);
  box-shadow: 0 30px 80px oklch(0 0 0 / 0.6); backdrop-filter: blur(24px); }
.admin-auth-head { text-align: center; margin-bottom: 22px; }
.admin-auth-logo { width: 44px; height: 44px; color: oklch(0.677 0.238 38.3);
  filter: drop-shadow(0 0 12px oklch(0.677 0.238 38.3 / 0.6)); margin: 0 auto 10px; }
.admin-auth-head h1 { color: #fff; font-size: 22px; font-weight: 700; }
.admin-auth-head p { color: oklch(1 0 0 / 0.6); font-size: 13px; margin-top: 4px; }
.admin-auth-form, .admin-add-form { display: grid; gap: 12px; }
.admin-field { position: relative; display: flex; align-items: center; }
.admin-field svg { position: absolute; left: 14px; width: 16px; height: 16px; color: oklch(1 0 0 / 0.55); }
.admin-field input, .admin-add-form input {
  width: 100%; height: 46px; padding: 0 14px 0 40px;
  background: oklch(1 0 0 / 0.06); color: #fff;
  border: 1px solid oklch(1 0 0 / 0.12); border-radius: 12px;
  font: 500 14px/1 system-ui, sans-serif; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.admin-add-form input { padding-left: 14px; }
.admin-field input:focus, .admin-add-form input:focus {
  border-color: oklch(0.677 0.238 38.3); box-shadow: 0 0 0 3px oklch(0.677 0.238 38.3 / 0.2);
}
.admin-auth-form button, .admin-add-form button {
  height: 46px; border: 0; border-radius: 12px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, oklch(0.677 0.238 38.3), oklch(0.45 0.28 264));
  font: 600 14px/1 system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 30px oklch(0.677 0.238 38.3 / 0.3);
  transition: transform .15s, box-shadow .15s;
}
.admin-auth-form button:hover:not(:disabled),
.admin-add-form button:hover:not(:disabled) { transform: translateY(-1px); }
.admin-auth-form button:disabled, .admin-add-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.admin-auth-hint { text-align: center; font-size: 12px; color: oklch(1 0 0 / 0.5); margin-top: 4px; }
.admin-auth-hint code { background: oklch(1 0 0 / 0.08); padding: 1px 6px; border-radius: 4px; color: #fff; }

.admin-shell { min-height: 100dvh; width: 100%; padding: 24px;
  display: grid; align-content: start; gap: 20px; background: oklch(0.075 0.018 265); color: #fff;
  background-image: linear-gradient(oklch(0 0 0 / 0.45), oklch(0 0 0 / 0.55)), url('bg-login.jpg');
  background-size: cover; background-position: center; background-attachment: fixed; }
.admin-shell > .admin-header,
.admin-shell > .admin-card { width: min(100%, 960px); margin-inline: auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; border-radius: 14px; background: oklch(0.10 0.03 265 / 0.7);
  border: 1px solid oklch(1 0 0 / 0.06); }
.admin-header-brand { display: flex; align-items: center; gap: 12px; }
.admin-header-brand svg { color: oklch(0.677 0.238 38.3); width: 26px; height: 26px;
  filter: drop-shadow(0 0 8px oklch(0.677 0.238 38.3 / 0.6)); }
.admin-header-brand h1 { font-size: 18px; font-weight: 700; }
.admin-header-brand p { font-size: 12px; color: oklch(1 0 0 / 0.6); }
.admin-btn-ghost { display: inline-flex; align-items: center; gap: 6px;
  background: oklch(1 0 0 / 0.06); border: 1px solid oklch(1 0 0 / 0.1); color: #fff;
  padding: 8px 12px; border-radius: 10px; font-size: 13px; cursor: pointer;
  transition: background .15s; }
.admin-btn-ghost:hover { background: oklch(1 0 0 / 0.12); }
.admin-btn-danger { display: inline-flex; align-items: center; gap: 6px;
  background: oklch(0.65 0.27 22 / 0.15); border: 1px solid oklch(0.65 0.27 22 / 0.4);
  color: oklch(0.85 0.2 22); padding: 8px 10px; border-radius: 10px; cursor: pointer;
  transition: background .15s; }
.admin-btn-danger:hover { background: oklch(0.65 0.27 22 / 0.3); }

.admin-card { padding: 22px; border-radius: 16px; background: oklch(0.10 0.03 265 / 0.7);
  border: 1px solid oklch(1 0 0 / 0.06); display: grid; gap: 18px; }
.admin-card-head { display: flex; align-items: center; gap: 12px; }
.admin-card-head svg { color: oklch(0.677 0.238 38.3); }
.admin-card-head h2 { font-size: 16px; font-weight: 700; }
.admin-card-head p { font-size: 12px; color: oklch(1 0 0 / 0.6); }
.admin-add-form { grid-template-columns: 1fr 2fr auto; gap: 10px; }
@media (max-width: 640px) { .admin-add-form { grid-template-columns: 1fr; } }

.admin-empty { padding: 30px; text-align: center; color: oklch(1 0 0 / 0.6);
  border: 1px dashed oklch(1 0 0 / 0.12); border-radius: 12px; display: grid; gap: 6px; justify-items: center; }
.admin-empty p { font-weight: 600; color: #fff; }
.admin-empty span { font-size: 12px; }

.admin-server-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.admin-server-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: oklch(1 0 0 / 0.04);
  border: 1px solid oklch(1 0 0 / 0.08); }
.admin-server-list li.is-inactive { opacity: 0.55; }
.srv-info { min-width: 0; flex: 1; }
.srv-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.srv-dot { width: 8px; height: 8px; border-radius: 50%; }
.srv-dot.on { background: oklch(0.82 0.28 145); box-shadow: 0 0 8px oklch(0.82 0.28 145); }
.srv-dot.off { background: oklch(0.5 0 0); }
.srv-url { font-size: 12px; color: oklch(1 0 0 / 0.6); display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; word-break: break-all; }
.srv-url:hover { color: #fff; }
.srv-actions { display: flex; gap: 6px; flex-shrink: 0; }
.srv-edit { flex: 1; display: grid; gap: 6px; }
.srv-edit input { width: 100%; height: 36px; padding: 0 10px; background: oklch(1 0 0 / 0.06);
  border: 1px solid oklch(1 0 0 / 0.12); border-radius: 8px; color: #fff; font-size: 13px; outline: none; }

/* Modal de troca de credenciais */
.admin-modal-backdrop { position: fixed; inset: 0; z-index: 100;
  background: oklch(0 0 0 / 0.7); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 16px;
  animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.admin-modal { width: 100%; max-width: 440px; padding: 28px 24px; border-radius: 18px;
  background: oklch(0.10 0.03 265 / 0.96); border: 1px solid oklch(1 0 0 / 0.1);
  box-shadow: 0 40px 100px oklch(0 0 0 / 0.7), 0 0 60px oklch(0.677 0.238 38.3 / 0.15);
  color: #fff; }
.admin-modal header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.admin-modal header svg { color: oklch(0.80 0.20 90); width: 28px; height: 28px; flex-shrink: 0;
  filter: drop-shadow(0 0 10px oklch(0.80 0.20 90 / 0.6)); }
.admin-modal header h2 { font-size: 17px; font-weight: 700; }
.admin-modal header p { font-size: 12.5px; color: oklch(1 0 0 / 0.65); margin-top: 3px; }
.admin-modal form { display: grid; gap: 14px; }
.admin-modal label { display: grid; gap: 6px; }
.admin-modal label span { font-size: 12px; color: oklch(1 0 0 / 0.7); font-weight: 500; }
.admin-modal input { height: 42px; padding: 0 12px; background: oklch(1 0 0 / 0.06);
  border: 1px solid oklch(1 0 0 / 0.12); border-radius: 10px; color: #fff;
  font: 500 14px/1 system-ui, sans-serif; outline: none; transition: border-color .15s, box-shadow .15s; }
.admin-modal input:focus { border-color: oklch(0.677 0.238 38.3);
  box-shadow: 0 0 0 3px oklch(0.677 0.238 38.3 / 0.2); }
.admin-modal small.err { color: oklch(0.75 0.25 22); font-size: 11.5px; }
.admin-modal small.hint { color: oklch(1 0 0 / 0.55); font-size: 11.5px; }
.admin-modal button[type="submit"] { height: 44px; margin-top: 4px; border: 0; border-radius: 10px;
  cursor: pointer; color: #fff; font: 600 13.5px/1 system-ui, sans-serif;
  letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(135deg, oklch(0.677 0.238 38.3), oklch(0.45 0.28 264));
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 10px 30px oklch(0.677 0.238 38.3 / 0.3); transition: transform .15s, opacity .15s; }
.admin-modal button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; }
.admin-modal button[type="submit"]:not(:disabled):hover { transform: translateY(-1px); }
.pw-meter { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.pw-bars { display: flex; gap: 4px; flex: 1; }
.pw-bars span { flex: 1; height: 5px; border-radius: 3px; background: oklch(1 0 0 / 0.08); transition: background .2s; }
.pw-label { font-size: 11.5px; font-weight: 600; }


.login-form input:focus {
  background: oklch(1 0 0 / 0.10);
  border-color: transparent;
  box-shadow:
    0 0 0 3px oklch(0.677 0.238 38.3 / 0.20),
    0 8px 24px oklch(0.45 0.28 264 / 0.22);
}

.login-field:focus-within svg {
  color: oklch(0.677 0.238 38.3);
  filter: drop-shadow(0 0 6px oklch(0.677 0.238 38.3 / 0.65));
}

.login-form button {
  position: relative;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  background:
    linear-gradient(135deg,
      oklch(0.677 0.238 38.3) 0%,
      oklch(0.55 0.27 320) 55%,
      oklch(0.45 0.28 264) 100%);
  background-size: 200% 200%;
  box-shadow:
    0 10px 30px oklch(0.677 0.238 38.3 / 0.32),
    0 4px 14px oklch(0.45 0.28 264 / 0.28),
    inset 0 1px 0 oklch(1 0 0 / 0.25);
  font: 600 14.5px/1 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, background-position .6s ease;
}

.login-form button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, oklch(1 0 0 / 0.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .8s ease;
}

.login-form button:hover {
  transform: translateY(-1px);
  background-position: 100% 100%;
  box-shadow:
    0 14px 38px oklch(0.677 0.238 38.3 / 0.42),
    0 6px 18px oklch(0.45 0.28 264 / 0.36),
    inset 0 1px 0 oklch(1 0 0 / 0.3);
}

.login-form button:hover::before { transform: translateX(100%); }

.login-form button svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 460px) {
  .login-glass { padding: 32px 20px 26px; border-radius: 18px; }
  .login-logo { min-height: 96px; margin-bottom: 18px; }
  .login-logo img { max-width: 170px; max-height: 100px; }
  .login-form input { height: 48px; padding-left: 44px; }
  .login-form button { height: 48px; }
}

@media (min-width: 1280px) {
  .login-led { max-width: 420px; }
  .login-glass { padding: 48px 38px 38px; }
  .login-logo { min-height: 130px; margin-bottom: 28px; }
  .login-logo img { max-width: 240px; max-height: 150px; }
}
/* base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: oklch(0.075 0.018 265); color: oklch(0.985 0.003 247.858); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: inherit; }
button { font-family: inherit; }

