* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: rgba(2, 6, 23, 0.55);
  --text: rgba(255, 255, 255, 0.92);
  --stroke: rgba(255, 255, 255, 0.14);
  --btn: rgba(255, 255, 255, 0.1);
  --btnHover: rgba(255, 255, 255, 0.18);
  --btnActive: rgba(197, 43, 43, 0.91);
}

body {
  width: 100%;
  min-height: 100vh;
  background-image: url("fondo.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: hidden;
}

.app {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.panel {
  position: relative;
  width: fit-content;
  max-width: 95vw;
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 18px;
  backdrop-filter: blur(10px);
}

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.btn-container {
  width: 140px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--btn);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.12s ease;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 12.5px;
}

.btn-container:hover {
  background: var(--btnHover);
}

.btn-container:active {
  background: var(--btnActive);
  transform: translateY(1px);
}

.no-select {
  user-select: none;
}

.panel-page.hidden,
.hidden {
  display: none;
}

.panel-switch-btn {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition: background 0.2s ease, transform 0.15s ease;
}

.panel-switch-btn:hover,
.panel-switch-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.panel-switch-btn:active {
  transform: scale(0.96);
}

.settings-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.settings-btn:hover,
.settings-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.settings-btn:active {
  transform: scale(0.96);
}

.settings-btn.state-missing {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 18px rgba(239, 68, 68, 0.18);
}

.settings-btn.state-ok {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 18px rgba(34, 197, 94, 0.16);
}

.status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.status-dot.active {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
}

.overlay,
.overlay-btn {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2100;
}

.form-container {
  background-color: rgba(255, 255, 255, 0.96);
  color: #111827;
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: 92%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

form h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

form label {
  font-size: 12px;
  color: rgba(17, 24, 39, 0.75);
  font-weight: 700;
  letter-spacing: 0.2px;
}

form input {
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.15);
  border-radius: 12px;
  outline: none;
  font-size: 14px;
}

form button {
  padding: 12px;
  background-color: #111827;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

form button:hover {
  background-color: #0b1224;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-actions button {
  flex: 1;
}

.btn-secondary {
  background: rgba(17, 24, 39, 0.08);
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.12);
}

.btn-secondary:hover {
  background: rgba(17, 24, 39, 0.12);
}

.hint {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(17, 24, 39, 0.65);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font: 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: min(92vw, 520px);
  text-align: center;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.ok {
  background: rgba(20, 120, 60, 0.92);
}

.toast.err {
  background: rgba(160, 40, 40, 0.92);
}

@media (max-width: 520px) {
  .btn-container {
    width: 125px;
    font-size: 12px;
    min-height: 38px;
  }

  .form-actions {
    flex-direction: column;
  }
}

.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-disabled:hover {
  background: var(--btn);
}

.btn-disabled:active {
  transform: none;
}

.panel-note {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}