/* ── Background grid + glow ── */
body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Glow sfumati */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(59,130,246,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 70%, rgba(99,102,241,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 60% 10%, rgba(139,92,246,0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* Light mode: griglia più chiara */
body:not(.dark)::before {
  background-image:
    linear-gradient(rgba(37,99,235,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.06) 1px, transparent 1px);
  background-size: 44px 44px;
}

body:not(.dark)::after {
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(59,130,246,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 70%, rgba(99,102,241,0.08) 0%, transparent 70%);
}

@font-face {
  font-family: 'LetoSans';
  src: url('/fonts/LetoSans-Bold.woff2') format('woff2'),
       url('/fonts/LetoSans-Bold.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}

.font-leto { font-family: 'LetoSans', sans-serif; font-weight: 700; }

/* Assicura che tutto il contenuto sia sopra */
.pt-14 { position: relative; }

nav { position: fixed; z-index: 30; }


/* ── Utils ── */
[x-cloak] { display: none !important; }
.clamp2 { overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical; }
.clamp3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: calc(0.75rem * 1.625 * 3);
}

.text-sm { font-size: 0.8rem !important; }

/* ── Sidebar: flex + width animation (slide da sinistra) ── */

.sidebar-inner {
  width: 240px;
  padding-right: 1.25rem;
  overflow-y: auto;
  max-height: calc(100vh - 7rem);
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.sidebar-inner::-webkit-scrollbar { width: 3px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9px; }
.dark .sidebar-inner::-webkit-scrollbar-thumb { background: #4b5563; }

/* ── Filter section search input ── */
.f-search {
  display: block;
  width: 100%;
  padding: .35rem .6rem;
  margin-bottom: .5rem;
  font-size: .8rem;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: .375rem;
  color: #111827;
  outline: none;
  transition: border-color .15s;
}
.f-search::placeholder { color: #9ca3af; }
.f-search:hover { border-color: #93c5fd; }
.f-search:focus { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.dark .f-search { background: transparent; border-color: #4b5563; color: #f9fafb; }
.dark .f-search::placeholder { color: #9ca3af; }
.dark .f-search:hover { border-color: #60a5fa; }

/* ── Bar button ── */
.bar-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem;
  font-size: .8rem; font-weight: 500;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: .375rem;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s;
  line-height: 1.25rem;
}
.bar-btn:hover { border-color: #93c5fd; background: transparent; }
.bar-btn:focus { outline: none; border-color: #3b82f6; }
.bar-btn.active { border-color: #2563eb !important; color: #2563eb !important; background: transparent !important; }

.dark .bar-btn { color: #d1d5db; border-color: #4b5563; }
.dark .bar-btn:hover { border-color: #60a5fa; background: transparent; }
.dark .bar-btn.active { border-color: #3b82f6 !important; color: #93c5fd !important; background: transparent !important; }

/* ── Dropdown panel ── */
.dd-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  width: 264px;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: .625rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  padding: .625rem;
}
.dark .dd-panel { background: #1f2937; border-color: #374151; box-shadow: 0 4px 24px rgba(0,0,0,.4); }

/* ── Skeleton ── */
@keyframes sk { 0%,100%{opacity:1} 50%{opacity:.4} }
.sk { animation: sk 1.4s ease-in-out infinite; }

/* ── Neon Oneskill ── */
.neon { color: #00D4FF; text-shadow: 0 0 8px rgba(0,212,255,.45); }

/* ── Modal prose ── */
.prose-md p { margin-bottom: .4rem; }

/* ── Hover uniforme su input/select ── */
input[type="search"]:hover,
input[type="number"]:hover,
select:hover {
  border-color: #93c5fd !important;
}
.dark input[type="search"]:hover,
.dark input[type="number"]:hover,
.dark select:hover {
  border-color: #60a5fa !important;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* LAYOUT PRINCIPALE — !important per evitare override Tailwind/Flowbite */
.layout-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 0;
}
.layout-side {
  overflow: hidden;
  flex-shrink: 0;
  width: 0;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.layout-side.is-open {
  width: 260px;
  min-width: 260px;
}
.layout-cards {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

/* ── Pannello modale (flat-moderno, coerente con la griglia) ── */
.modal-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 20px 60px -15px rgba(16,24,40,.25);
}
.dark .modal-panel {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 20px 60px -15px rgba(0,0,0,.6);
}

/* Pannello: clip per arrotondare anche lo sfondo header */
.modal-panel { overflow: hidden; }

/* Header con griglia accennata (coerente col background del sito) */
.modal-head-grid {
  background-color: #f6f8ff;
  background-image:
    linear-gradient(rgba(37,99,235,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.06) 1px, transparent 1px);
  background-size: 22px 22px;
}
.dark .modal-head-grid {
  background-color: #0f172a;
  background-image:
    linear-gradient(rgba(99,102,241,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.10) 1px, transparent 1px);
  background-size: 22px 22px;
}

@keyframes bookmark-pop {
  0%   { transform: scale(1); }
  15%  { transform: scale(0.85); }
  40%  { transform: scale(1.25); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes bookmark-remove {
  0%   { transform: scale(1) translateY(0); opacity: 1; }
  100% { transform: scale(0.7) translateY(4px); opacity: 0.3; }
}
.bookmark-pop    { animation: bookmark-pop 0.5s cubic-bezier(.34,1.56,.64,1); }
.bookmark-remove { animation: bookmark-remove 0.25s ease-out; }

@keyframes plus-pop {
  0%   { transform: scale(1) rotate(0deg); }
  30%  { transform: scale(1.35) rotate(90deg); }
  60%  { transform: scale(0.9) rotate(90deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.plus-pop { animation: plus-pop 0.4s cubic-bezier(.17,.67,.35,1.35); }

/* ── Sidebar percorsi ── */
.sidebar-percorsi {
  position: fixed;
  top: 3.5rem;
  right: 0;
  bottom: 0;
  width: 320px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
  overflow: visible;
}
.sidebar-percorsi.is-open {
  transform: translateX(0);
}

.sidebar-percorsi.is-open .sidebar-tab svg {
  transform: rotate(180deg);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  top: 3.5rem;
  background: rgba(0,0,0,0.3);
  z-index: 39;
}

@media (max-width: 767px) {
  .sidebar-percorsi { width: 85vw; max-width: 360px; }
}

@keyframes slide-in-course {
  0%   { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}
.slide-in-course { animation: slide-in-course 0.3s ease-out; }

@keyframes check-fade {
  0%   { opacity: 1; transform: scale(1); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}
.check-fade { animation: check-fade 2.5s ease-out forwards; }

/* Sidebar percorsi – effetto glass moderato */
.sidebar-percorsi {
  background: rgba(255, 255, 255, 0.6);   /* light semi‑solido */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(209, 213, 219, 0.5);
}

.dark .sidebar-percorsi {
  background: rgba(31, 41, 55, 0.6);      /* dark semi‑solido */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(75, 85, 99, 0.5);
}

.bulkbar-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-top: 1px solid rgba(209, 213, 219, 0.5);
}

.dark .bulkbar-glass {
  background: rgba(31, 41, 55, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-top: 1px solid rgba(75, 85, 99, 0.5);

}

/* Toggle tab – forma, posizione e vetro */
.sidebar-tab {
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 48px;
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s;

  /* effetto vetro */
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(209, 213, 219, 0.8);
  border-right: none;
}

.dark .sidebar-tab {
  background: rgba(31, 41, 55, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(75, 85, 99, 0.8);
  border-right: none;
}

.sidebar-tab:hover {
  background: rgba(255, 255, 255, 0.9);
}
.dark .sidebar-tab:hover {
  background: rgba(31, 41, 55, 0.9);
}

/* Icona interna ruota di 180° quando la sidebar è aperta */
.sidebar-tab svg {
  transition: transform 0.3s ease;
}
.sidebar-percorsi.is-open .sidebar-tab svg {
  transform: rotate(180deg);
}

@media (max-width: 767px) {
  body.sidebar-open {
    overflow: hidden;
  }
}



/* ── Accordion fluido (stile Flowbite) ── */
.collapse-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-in-out, opacity 0.3s ease-in-out;
}
.collapse-content.open {
  max-height: 500px;   /* valore sufficiente a contenere la lista corsi */
  opacity: 1;
}

/* Scrollbar globale sottile */
* {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
*::-webkit-scrollbar { width: 3px; height: 3px; }
*::-webkit-scrollbar-track { background: transparent; border-radius: 9px; }
*::-webkit-scrollbar-thumb { 
  background: #d1d5db; 
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.dark * { scrollbar-color: #4b5563 transparent; }
.dark *::-webkit-scrollbar-thumb { 
  background: #4b5563;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.dark *::-webkit-scrollbar-thumb:hover { background: #6b7280; }

input[type="checkbox"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
input[type="checkbox"]:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

input[type="checkbox"]:hover {
  border-color: #93c5fd !important;
}
.dark input[type="checkbox"]:hover {
  border-color: #60a5fa !important;
}

.logo-img { filter: none; }
.dark .logo-img { filter: brightness(0) invert(1); }

input[type="search"]::-webkit-search-cancel-button {
  filter: brightness(0);
}
.dark input[type="search"]::-webkit-search-cancel-button {
  filter: brightness(0) invert(1);
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

@media (max-width: 767px) {
  .hero-headline-wrap {
    min-height: 6rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
  }
}

body.modal-open {
  overflow: hidden;
}