:root {
  --bg: rgb(11, 14, 20);
  --panel: rgb(20, 25, 36);
  --panel-2: rgb(16, 20, 29);
  --line: rgb(35, 43, 58);
  --text: #E7EBF3;
  --text-dim: #7C889D;
  --primary: rgb(124, 147, 255);
  --primary-2: rgb(167, 139, 250);
  --ok: #F2B84B;
  --danger: #FF6B6B;
  --radius: 12px;
  --sussess: #4CAF50;
  --fail: #F44336;
  --maintenance: #FF9800;
  --IsFree: #7C889D;
  --IsPaid: #ffbb00;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* ── Resplandor etéreo: elemento de marca de fondo ── */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, var(--primary-2), transparent 70%);
  z-index: -1;
}

body::after {
  width: 480px;
  height: 480px;
  bottom: -180px;
  right: -140px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
  z-index: -1;
}


.brand-ribbon {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--ok));
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0;
}

a { color: var(--primary-2); }

a:link, a:visited, a:hover, a:active {
  color: var(--primary-2)
}

/* ── Marca / wordmark ── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.topbar-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.topbar-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
}

.topbar-nav a:hover, .topbar-nav a.active {
  color: var(--text);
}

/* ── Menú hamburguesa ── */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  width: auto;
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 3px 0;
  border-radius: 2px;
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: none;
  flex-direction: column;
  min-width: 180px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 10;
}

.nav-menu.open { display: flex; }

.nav-menu a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-menu a:hover, .nav-menu a.active {
  background: var(--panel-2);
  color: var(--text);
}



/* ── Contenedores ── */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 28px 60px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.center-card {
  max-width: 400px;
  margin: 8vh auto;
  padding: 32px 28px;
}

/* ── Formularios ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

/* ── Campo de contraseña con botón de mostrar/ocultar ── */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--panel-2);
}

.field label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  width: 100%;
}
textarea {
  resize: vertical;
  min-height: 80px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-2);
}

button {
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #0B0E14;
  border: none;
  width: auto;
}

button:hover { filter: brightness(1.08); }
button:active { filter: brightness(0.95); }

button.secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
}

button.danger-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.form-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 14px;
}

/* ── Código / mono ── */
.mono {
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ── Tarjeta de la key: envuelve el texto, nunca desborda ── */
.key-display {
  font-family: 'JetBrains Mono', monospace;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.85rem;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.code-block {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* ── Pills / badges ── */
.pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  display: inline-block;
}

.pill.role-owner { color: var(--ok); border-color: var(--ok); }
.pill.role-staff { color: var(--primary-2); border-color: var(--primary-2); }
.pill.role-pro { color: var(--IsPaid); border-color: var(--IsPaid); }
.pill.role-user { color: var(--text-dim); }

/* ── Tablas ── */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--text-dim); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

@media (max-width: 700px) {
  .page { padding: 20px 16px 48px; }
  .topbar { padding: 14px 16px; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  td { border: none; padding: 4px 0; }
  td::before { content: attr(data-label); color: var(--text-dim); display: inline-block; width: 110px; font-size: 0.78rem; }
}


/* --- Endpoits --- */
.services {
  display: grid;
  place-items: center;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.endpoint-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  height: 200px;
  min-width: 250px;
  max-width: 350px;
  align-items: flex-start;
  justify-content: space-between;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  gap: 6px;
}

.endpoint-card .card-header {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  height: 100%;
  width: 100%;
  gap: 6px;
}

.endpoint-card .card-header h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.endpoint-card .card-header h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.endpoint-card .endpoint-method {
  color: var(--primary-2);
  font-size: 0.78rem;
}

.endpoint-card .card-header p {
  margin: 0;
  font-size: 0.80rem;
  color: var(--text-dim);
}

.endpoint-card .card-footer .endpoint-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  width: auto;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #0B0E14;
  font-weight: 600;
  text-decoration: none;
}

.endpoint-card .card-footer .endpoint-link:hover { filter: brightness(1.08); }

.endpoint-card .card-footer {
  margin-top: 12px;
  width: 100%;
  max-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cenpoint-card .card-footer .endpoint-link a {
  margin: 0;
  font-size: 0.82rem;
  padding: 0;
  text-decoration: none;
  width: fit-content;
  height: fit-content;
  color: inherit;
  outline: none;
}

.endpoint-card .card-footer .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  padding: 3px 10px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  overflow: hidden;
}
.endpoint-card .card-footer .pill .status-indicator {
  height: fit-content;
  display: inline-flex;
}
.endpoint-locked {
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.endpoint-card .card-footer .endpoint-status[data-status="loading"] {
  color: var(--primary-2);
  border-color: var(--primary-2);
}
.endpoint-card .card-footer .endpoint-status[data-status="ok"] {
  color: #22c55e;
  border-color: #22c55e;
}
.endpoint-card .card-footer .endpoint-status[data-status="error"] {
  color: var(--danger);
  border-color: var(--danger);
}
.endpoint-card .card-footer .endpoint-status[data-status="maintenance"] {
  color: var(--maintenance);
  border-color: var(--maintenance);
}
.endpoint-locked[data-status="error"] {
  border-color: var(--danger);
}
.endpoint-locked[data-status="maintenance"] {
  border-color: var(--maintenance);
}
.endpoint-card .card-footer .endpoint-status .status-indicator {
  color: inherit;
}
.endpoint-card .card-footer .endpoint-status .status-indicator circle {
  fill: currentColor;
}
.endpoint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.card-header .endpoint-header .bage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  padding: 3px 10px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  overflow: hidden;
}
.card-header .endpoint-header .bage[data-plan="Pro"] {
  color: var(--IsPaid);
  border-color: var(--IsPaid);
}
.card-header .endpoint-header .bage[data-plan="all"] {
  color: var(--IsFree);
  border-color: var(--IsFree);
}

.endpoint-card .card-header .endpoint-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}