:root {
  --bg: #120626;
  --bg-2: #1b0a36;
  --bg-3: #2a0f55;
  --text: #f5e9ff;
  --muted: #cdb5ff;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --btn-primary: #8b5cf6;
  --btn-primary-hover: #7c3aed;
  --btn-secondary-bg: rgba(255, 255, 255, 0.08);
  --btn-secondary-border: rgba(255, 255, 255, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100vh;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% 10%, rgba(167, 139, 250, 0.22), transparent 40%),
    radial-gradient(900px 900px at 50% 90%, rgba(139, 92, 246, 0.20), transparent 55%),
    radial-gradient(1200px 900px at 120% -20%, rgba(74, 0, 224, 0.25), transparent 60%),
    linear-gradient(180deg, var(--bg-3), var(--bg-2) 40%, var(--bg));
  overflow-x: hidden;
  /* evito scroll orizzontale con le stelle */
}

h1 {
  position: relative;
  z-index: 5;
  text-align: center;
  margin: 1.2rem auto 0.4rem;
  line-height: 1.1;
  letter-spacing: 0.3px;
}

/*====LAYOUT====*/
.wrapper {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

@media (max-width: 980px) {
  .wrapper {
    grid-template-columns: 1fr;
  }
}

/*====EDITOR PANEL====*/
.badge-editor {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.badge-editor-field {
  margin-bottom: 16px;
}

.badge-editor .form-label {
  color: var(--text);
}

.badge-editor .form-control,
.badge-editor .btn {
  border-radius: 12px;
}

.badge-editor .btn-outline-light {
  --bs-btn-color: var(--text);
  --bs-btn-border-color: rgba(255, 255, 255, 0.35);
  --bs-btn-hover-bg: rgba(139, 92, 246, 0.20);
  --bs-btn-hover-border-color: var(--accent);
}

/*====DROPZONE====*/
#dropzone {
  position: relative;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 28px 16px;
  min-height: 140px;
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#dropzone:focus {
  box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.35);
}

#dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.15);
  transform: translateY(-1px);
}

.dz-title {
  font-weight: 700;
}

.dz-sub {
  color: var(--muted);
  margin-top: 4px;
}

/*====AREA PREV====*/
.badge-container {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  min-height: 520px;
  position: relative;
}

#badge {
  max-width: 100%;
  height: auto;
  display: block;
}

/*====BOOTSTRAP BTN CHANGED====*/
.btn-primary {
  background-color: var(--btn-primary) !important;
  border-color: var(--btn-primary) !important;
  color: #fff;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--btn-primary-hover) !important;
  border-color: var(--btn-primary-hover) !important;
}

.btn-primary:active {
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.7) inset;
}

.btn.btn-secondary {
  background-color: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
  color: var(--text);
}

.btn.btn-secondary:hover {
  background-color: rgba(139, 92, 246, 0.20);
  border-color: var(--accent);
}

/*====BG ANIMATO====*/
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars-wrap {
  position: absolute;
  inset: 0;
}

#stars,
#stars2,
#stars3,
#stars4 {
  position: absolute;
  width: 1px;
  height: 1px;
  background: transparent;
  animation: animStar 28s linear infinite;
  will-change: transform;
}

#stars2 {
  animation-duration: 52s;
}

#stars3 {
  animation-duration: 84s;
}

#stars4 {
  animation-duration: 120s;
}

@keyframes animStar {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-200vh);
  }
}

@media (prefers-reduced-motion: reduce) {

  #stars,
  #stars2,
  #stars3,
  #stars4 {
    animation-duration: 240s;
  }
}

/* Segnaposto testo preview */
.preview-empty {
  color: var(--muted);
  opacity: 0.9;
}