@charset "UTF-8";

:root {
  --bg: #020617;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --blue: #0044FF;
  --blue-glow: rgba(0, 68, 255, 0.5);
  --night: #1E3A8A;
  --accent: #38bdf8;
  --success: #10b981;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  scroll-padding-top: 90px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: #fff;
  font-family: 'Sora', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background-image: 
    radial-gradient(900px 500px at 0% 0%, rgba(0, 68, 255, 0.28), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(30, 58, 138, 0.35), transparent 60%),
    radial-gradient(500px 300px at 50% 40%, rgba(56, 189, 248, 0.06), transparent 70%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Glassmorphism */
.glass {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 68, 255, 0.6);
  box-shadow: 0 24px 60px -15px rgba(0, 68, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-blue {
  background: linear-gradient(135deg, #0044FF, #1E3A8A);
  box-shadow: 0 10px 30px -8px rgba(0, 68, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.btn-blue::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
  transition: 0.5s;
}

.btn-blue:hover::after {
  left: 150%;
  transition: 0.7s ease-in-out;
}

.btn-blue:hover {
  box-shadow: 0 14px 38px -6px rgba(0, 68, 255, 0.95);
  transform: translateY(-2px) scale(1.01);
}

.btn-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 10px 30px -8px rgba(16, 185, 129, 0.6);
}

.btn-emerald:hover {
  box-shadow: 0 14px 38px -6px rgba(16, 185, 129, 0.85);
  transform: translateY(-2px) scale(1.01);
}

/* Chips */
.chip {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.chip.on {
  background: #ffffff;
  color: #020617;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.35);
}

/* Inputs */
input, select, textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  width: 100%;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 68, 255, 0.35);
}

select option {
  background: #0f172a;
  color: #fff;
}

:focus-visible {
  outline: 2px solid #6c93ff;
  outline-offset: 2px;
}

/* Bars Animation */
.bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.bars i {
  display: block;
  width: 8px;
  background: #fff;
  transform: skewX(-20deg);
  border-radius: 1px;
}

.load i {
  animation: grow 1s ease-in-out infinite alternate;
}

.load i:nth-child(2) {
  animation-delay: 0.15s;
}

.load i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes grow {
  from {
    transform: skewX(-20deg) scaleY(0.4);
    opacity: 0.5;
  }
  to {
    transform: skewX(-20deg) scaleY(1);
    opacity: 1;
  }
}

/* ==========================================================================
   STRETCHED LOGO BOUNCE ANIMATION (REQUIRED BY USER)
   ========================================================================== */
.stretched-logo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2.5rem auto;
  position: relative;
  z-index: 20;
}

.stretched-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  transform-origin: center bottom;
  animation: logoBounce 2.5s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
  filter: drop-shadow(0 10px 24px rgba(0, 68, 255, 0.65));
  cursor: pointer;
  border-radius: 9999px;
  transition: filter 0.3s ease;
}

.stretched-logo:hover {
  animation-play-state: paused;
  transform: translateY(-16px) scale(1.06);
  filter: drop-shadow(0 20px 40px rgba(0, 68, 255, 1));
}

@keyframes logoBounce {
  0%, 100% {
    transform: translateY(0) scaleX(1.03) scaleY(0.97);
    filter: drop-shadow(0 8px 18px rgba(0, 68, 255, 0.6));
  }
  25% {
    transform: translateY(-20px) scaleX(0.97) scaleY(1.05);
    filter: drop-shadow(0 26px 36px rgba(0, 68, 255, 0.95));
  }
  50% {
    transform: translateY(0) scaleX(1.05) scaleY(0.94);
    filter: drop-shadow(0 6px 14px rgba(0, 68, 255, 0.5));
  }
  75% {
    transform: translateY(-8px) scaleX(0.99) scaleY(1.02);
    filter: drop-shadow(0 14px 22px rgba(0, 68, 255, 0.75));
  }
}

/* Real-time item updated glow highlight */
@keyframes itemHighlight {
  0% {
    border-color: #38bdf8;
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.9), inset 0 0 20px rgba(56, 189, 248, 0.4);
    transform: scale(1.03);
  }
  50% {
    border-color: #0044ff;
    box-shadow: 0 0 30px rgba(0, 68, 255, 0.8);
  }
  100% {
    border-color: var(--line);
    box-shadow: none;
    transform: scale(1);
  }
}

.item-highlight {
  animation: itemHighlight 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Badge pop animation when cart changes */
@keyframes badgePop {
  0% { transform: scale(0.6); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.badge-pop {
  animation: badgePop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Modals & Dialogs */
.fade {
  animation: fade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Radar pulse dot */
.radar-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
}

.radar-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #10b981;
  animation: radarPing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
  75%, 100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(2, 6, 23, 0.8);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 68, 255, 0.5);
}

/* Utility */
.hidden-x {
  display: none !important;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .stretched-logo {
    animation: none !important;
  }
}

/* ==========================================================================
   Multi-pagina: navigazione, snippets, TOS
   ========================================================================== */
.nav-link {
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.nav-link.active:not([data-staff-link]) {
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
}

/* Blocchi di codice */
.code {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #cbd5e1;
  white-space: pre;
  tab-size: 2;
}

.code-preview {
  max-height: 10rem;
  overflow: hidden;
  position: relative;
}

.code-preview::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3rem;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.95));
  pointer-events: none;
}

textarea.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  white-space: pre;
  tab-size: 2;
  overflow: auto;
}

/* Testo dei Termini di Servizio */
.tos h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin: 2rem 0 0.6rem;
}

.tos p {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}
