@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* ==========================================
   VARIABILI CSS CUSTOM
   ========================================== */
:root {
  /* Colori custom per eventuali override */
  --primary-color: #4f46e5;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
}

/* ==========================================
   FONT E RESET BASE
   ========================================== */
html,
body {
  font-family: "Poppins", sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ==========================================
   RIMUOVI SPINNER DAI NUMBER INPUT
   ========================================== */
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

/* ==========================================
   ANIMAZIONI CARDS (Legacy dal vecchio sistema)
   ========================================== */
.card {
  transition: all 0.3s ease;
  transform-origin: center;
  overflow: hidden;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #4f46e5, #10b981);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================
   LOADING SPINNER HTMX
   ========================================== */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* ==========================================
   SKIP LINK ACCESSIBILITÀ
   ========================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
  border-radius: 0.375rem;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
  .no-print,
  header,
  footer,
  nav {
    display: none !important;
  }

  body {
    font-size: 12pt;
  }
}

/* Toast starts off-screen */
.fixed.top-4.right-4 {
  transform: translateX(150%);
}

/* Stato base: overlay nascosto */
#loading-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /*backdrop-filter: blur(2px);*/

    transition:
            opacity 300ms ease-out,
            visibility 0s linear 300ms;
}

/* Stato attivo */
#loading-overlay.loading-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition:
            opacity 300ms ease-out,
            visibility 0s linear 0s;
}
