/* ========== RESET Y FONDO OSCURO ========== */
* {
  box-sizing: border-box;
}

body {
  background: #0a0a0f !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  margin: 0;
  min-height: 100vh;
  color: #eee;
}

/* Ocultar cualquier barra lateral o header no deseado en el login */
.sidebar, .navigation, .x-panel-header:not(.login-header) {
  display: none !important;
}

/* ========== VENTANA DE LOGIN (CRISTAL) ========== */
/* Selector amplio para cubrir diferentes versiones de Traccar */
.login-panel,
.x-panel.login,
.auth-form,
form[class*="login"],
div[class*="login"] form,
.MuiPaper-root,
.MuiCard-root {
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  padding: 2.5rem !important;
  max-width: 400px !important;
  width: 90% !important;
  margin: 0 auto !important;
}

/* ========== CAMPOS DE TEXTO ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
.MuiInputBase-input,
.MuiOutlinedInput-input {
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 4px !important;
  padding: 0.75rem 1rem !important;
  color: #fff !important;
  font-size: 0.95rem !important;
  width: 100% !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
input:focus,
.MuiInputBase-input:focus {
  border-color: #25D366 !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.25) !important;
}

/* ========== ETIQUETAS ========== */
label,
.MuiFormLabel-root,
.x-form-label {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  margin-bottom: 0.3rem !important;
  display: block !important;
}

/* ========== BOTÓN DE LOGIN ========== */
button[type="submit"],
.MuiButton-containedPrimary,
.MuiButton-root.MuiButton-contained,
.x-btn-primary {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  border-radius: 4px !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  text-transform: none !important;
  letter-spacing: 0.3px !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  width: 100% !important;
  cursor: pointer !important;
  margin-top: 0.5rem !important;
}
button[type="submit"]:hover,
.MuiButton-containedPrimary:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08) !important;
}

/* ========== TÍTULOS ========== */
h1, h2, h3, .MuiTypography-h5, .MuiTypography-h6 {
  color: #fff !important;
  font-weight: 600 !important;
}

/* ========== CHECKBOX ========== */
.MuiCheckbox-root {
  color: rgba(255, 255, 255, 0.5) !important;
}
.MuiCheckbox-root.Mui-checked {
  color: #25D366 !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ========== MENSAJES DE ERROR ========== */
.MuiFormHelperText-root,
.x-form-error-msg {
  color: #ff6b6b !important;
  font-size: 0.8rem !important;
}

/* ========== PANTALLA DE CARGA ========== */
.loader {
  border: 3px solid rgba(255,255,255,0.1) !important;
  border-top-color: #25D366 !important;
}
