/* =====================================
   Italy Reborn RP Remastered - Styles
   ===================================== */
:root {
  --bg: #0a0b0f;
  /* nero caldo dal logo */
  --card: #141116;
  /* card scuro con lieve tono rosso */
  --accent: #e71e27;
  /* rosso fenice principale */
  --accent-2: #11a24a;
  /* verde bandiera per secondario */
  --text: #f3f5f7;
  /* testo principale */
  --muted: #b8c0cf;
  /* testo secondario */
  --danger: #ff3b3b;
  /* alert coerente col rosso logo */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji",
    sans-serif;
}

/* Page transition: simple content entrance and overlay exit */
body { transition: opacity .45s cubic-bezier(.2,.9,.3,1), transform .45s cubic-bezier(.2,.9,.3,1); }
body:not(.page--loaded) { opacity: 0; transform: translateY(6px); }

.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10,11,15,0.0), rgba(10,11,15,0.95));
  opacity: 0;
  transition: opacity .45s cubic-bezier(.2,.9,.3,1);
}
.transition-overlay.visible { opacity: 1; pointer-events: auto; }

.grid-flex {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #e71e27, #b3131b);
  /* rosso → rosso scuro */
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, opacity 0.2s ease;
  will-change: transform;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px) scale(1.04);
  opacity: 0.95;
}

.btn.secondary {
  background: #1f2636;
}

.btn.danger {
  background: var(--danger);
}

.btn.small {
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Opzionale: bottone tricolore */
.btn.tricolore {
  background: linear-gradient(90deg, #11a24a 0%, #ffffff 50%, #e71e27 100%);
  color: #0a0b0f;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 15, 0.65);
  width: 100%;
  /* tono su palette */
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.brand .title {
  font-weight: 800;
  letter-spacing: 0.3px;
  width: 300px;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-weight: 600;
  color: var(--muted);
}

.nav-links a {
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.hero {
  position: relative;
  min-height: 82vh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(231, 30, 39, 0.18),
    rgba(10, 11, 15, 0.88) 65%,
    var(--bg)
  );
  /* overlay con velatura rossa */
  z-index: 1;
}

.hero .bg {
  position: absolute;
  inset: 0;
  background: url("../assets/img/home_background.jpg") center/cover no-repeat;
  /* 1920x1080 px — file: home_background.jpg */
  filter: saturate(105%) contrast(105%) brightness(0.9);
}

.hero .content {
  position: relative;
  z-index: 2;
  padding: 3rem 0;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0.2rem 0 0.6rem;
  font-weight: 900;
  line-height: 1.05;
}

.hero p {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  margin: 0 auto 1.6rem;
  max-width: 760px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffd6d8;
  /* testo badge con tinta calda */
  font-weight: 700;
  font-size: 0.9rem;
}

.badge img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.grid {
  display: grid;
  gap: 1.1rem;
}

/* Shop categories (visual navigation) */
.shop-categories {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.shop-categories .category {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.006));
  border: 1px solid rgba(255,255,255,0.04);
  min-width: 140px;
  text-align: center;
  color: var(--muted);
}
.shop-categories .category span {
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text);
}
.shop-categories .category .cat-thumb {
  width: 120px;
  height: 92px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.shop-categories .category .cat-thumb img { width:100%; height:100%; object-fit:cover; }

.shop-section { margin-top: 1.6rem; }
.shop-section h3 { margin: 0 0 0.6rem; font-size: 1.4rem; font-weight: 900; }
.section-cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

/* Slightly larger thumbnails inside shop sections */
.section-cards .card .thumb img { height: 220px; object-fit: fill; }

/* Active category visual */
.shop-categories .category.active {
  box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 0 4px rgba(231,30,39,0.06);
  border-color: rgba(231,30,39,0.12);
  transform: translateY(-4px);
}

.shop-categories .category:focus,
.shop-categories .category:hover { transform: translateY(-2px); }

/* Animated show/hide for shop sections */
.shop-section {
  /* default hidden visual state (animated) */
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  filter: blur(6px) saturate(0.95);
  transition: opacity 420ms cubic-bezier(0.22,0.9,0.3,1), transform 420ms cubic-bezier(0.22,0.9,0.3,1), filter 420ms cubic-bezier(0.22,0.9,0.3,1);
  pointer-events: none;
}
.shop-section.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0) saturate(1);
  pointer-events: auto;
}
.shop-section.animate-out {
  /* exit animation: slide up, slight scale down and blur */
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  filter: blur(6px) saturate(0.9);
  pointer-events: none;
}

/* Ensure categories and cards animate smoothly when layout changes */
.shop-categories .category,
.section-cards .card {
  transition: transform 260ms ease, box-shadow 260ms ease, opacity 260ms ease;
}


.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.grid.cards.three-equal {
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}

/* Forza la griglia a mostrare le card in colonna (una per riga) */
.grid.cards.stack-vertical {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}



.grid.cards { gap: 1.2rem; }

.card h3 {
  margin: 0.2rem 0 0.2rem;
}

.card .thumb {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card .thumb img {
  width: 100%;
  height: 260px; /* increased image height for larger preview */
  object-fit: fill;
}

@media (max-width: 820px) {
  .card .thumb img { height: 160px; }
}

.section {
  padding: 3.5rem 0;
}

.section h2 {
  font-size: clamp(1.6rem, 3.8vw, 2.2rem);
  margin: 0 0 0.6rem;
  font-weight: 900;
}

.section p.lead {
  color: var(--muted);
  margin: 0.2rem 0 1.4rem;
  max-width: 780px;
}

.rules-embed iframe {
  width: 100%;
  height: 70vh;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.socials {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: #1b2130;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.socials img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  text-align: center;
}

/* Carousel per sezione Community */
.carousel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--card);
  max-width: 1100px;
  margin: 0 auto;
  /* centra la carousel e limita la larghezza */
}

.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.22, 0.9, 0.3, 1);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
  position: relative;
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.carousel-caption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25));
  color: white;
  font-weight: 700;
  backdrop-filter: blur(2px);
}

.carousel-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.4rem;
  pointer-events: none;
}

.carousel-btn {
  pointer-events: auto;
  background: rgba(10, 11, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: white;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  margin: 0 0.35rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

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

.carousel-indicators {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0.6rem;
  display: flex;
  gap: 0.4rem;
}
/* SEZIONE STAFF */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.6rem;
  align-items: center;
}
.staff-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}
.staff-item {
  /* ensure each staff tile has the same vertical footprint */
  justify-content: center;
  height: 140px;
  padding: 0.25rem;
}

.staff-item .muted-small {
  display: block;
  min-height: 1.2em; /* reserve space for one line */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-avatar {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
  .staff-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
@media (max-width: 720px) {
  .staff-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 420px) {
  .staff-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================
   Responsive / Mobile
   ========================= */

/* Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.4rem;
  border-radius: 8px;
  cursor: pointer;
}
.hamburger .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.open .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger.open .bar:nth-child(2) {
  opacity: 0;
}
.hamburger.open .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile nav panel */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 260px;
  background: linear-gradient(
    180deg,
    rgba(20, 17, 17, 0.98),
    rgba(10, 11, 15, 0.98)
  );
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.6rem;
  box-shadow: var(--shadow);
  z-index: 60;
}
.mobile-nav a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
}
.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

/* When open */
.mobile-nav.open {
  display: block;
}

/* Smooth mobile nav appearance */
.mobile-nav {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.mobile-nav.open {
  opacity: 1;
  transform: translateY(0);
}

/* prevent body scroll when mobile menu open */
body.no-scroll {
  overflow: hidden;
}

/* Stack grid/cards on small screens */
@media (max-width: 820px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .container {
    width: min(960px, 94%);
  }
  .grid.cards {
    grid-template-columns: 1fr;
  }
  .card {
    grid-column: auto;
  }
  .card .thumb img {
    height: 220px;
  }
  .carousel-slide img {
    height: 220px;
  }
  .cards-layout {
    flex-direction: column;
  }
  .side-vertical-image {
    order: 2;
    width: 100%;
    flex: 0 0 auto;
  }
  .side-vertical-image img {
    transform: translateY(12px);
    height: auto;
    max-height: 540px;
  }
}

/* Product modal styles */
.product-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); z-index: 200; }
.product-modal[aria-hidden="false"] { display: flex; }
.product-modal-content { background: var(--card); border-radius: 12px; padding: 1.2rem; width: min(920px, 94%); max-height: 88vh; overflow: auto; position: relative; box-shadow: var(--shadow); }
.product-modal .thumb { display: none; }
.product-modal .thumb img { display: none; }
.product-modal h3 { margin-top: 0; text-align: left; }
.product-modal-content { text-align: left; }
.product-body { color: var(--muted); margin-top: .6rem; }
.product-body ul { margin-left: 1.1rem; }
.product-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .8rem; }
.product-actions .btn { padding: .7rem 1rem; }
.modal-close { position: absolute; right: .6rem; top: .4rem; background: transparent; border: none; color: var(--muted); font-size: 1.15rem; cursor: pointer; }

@media (max-width: 480px) {
  .brand .title {
    display: none;
  }
  .btn {
    padding: 0.7rem 1rem;
  }
  .hero {
    min-height: 60vh;
  }
  .badge {
    font-size: 0.8rem;
  }
  .mobile-nav {
    right: 8px;
    left: 8px;
    width: auto;
  }
}

/* Utility responsive classes */
.btn--wide {
  width: 300px;
  display: inline-block;
}
.btn--full {
  width: 100%;
  box-sizing: border-box;
}

.side-vertical-image {
  width: 300px;
  flex: 0 0 300px;
}
.side-vertical-image img {
  width: 100%;
  height: 840px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: var(--shadow);
  transform: translateY(58px);
}

/* overlay when mobile menu open */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 55;
}
.mobile-overlay.show {
  display: block;
}

/* refined breakpoints */
@media (max-width: 720px) {
  .btn--wide {
    width: 240px;
  }
  .side-vertical-image img {
    transform: translateY(28px);
    max-height: 520px;
  }
}

@media (max-width: 520px) {
  .btn--wide {
    width: 200px;
  }
  .side-vertical-image {
    width: 100%;
    flex: 0 0 auto;
  }
  .side-vertical-image img {
    transform: translateY(12px);
    height: auto;
    max-height: 420px;
    border-radius: 12px;
  }
}

.carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: none;
}

.carousel-indicators button.active {
  background: var(--accent);
}

@media (max-width: 900px) {
  .carousel-slide img {
    height: 220px;
  }
}

@media (max-width: 620px) {
  .carousel-slide img {
    height: 180px;
  }

  .carousel-caption {
    left: 0.6rem;
    right: 0.6rem;
    font-size: 0.95rem;
  }

  /* FAQ accordion styles */
  .faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
  }

  .faq-list details {
    background: var(--card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  .faq-list summary {
    cursor: pointer;
    font-weight: 800;
    list-style: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.2rem 0;
  }

  .faq-list summary::marker {
    display: none;
  }

  .faq-list details[open] {
    box-shadow: var(--shadow);
  }

  .faq-list details p {
    margin: 0.6rem 0 0;
    color: var(--muted);
    line-height: 1.5;
  }

  .faq-list .faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.36s cubic-bezier(0.22, 0.9, 0.3, 1),
      opacity 0.25s ease;
    opacity: 0;
  }

  .faq-list details[open] .faq-content {
    max-height: 400px;
    opacity: 1;
    padding-top: 0.6rem;
  }

  .faq-list summary .chev {
    transition: transform 0.28s ease;
    color: var(--muted);
    font-weight: 800;
  }

  .faq-list details[open] summary .chev {
    transform: rotate(90deg);
    color: var(--accent);
  }

  /* Tabs per la pagina bandi */
  .tabs {
    display: flex;
    gap: 0.6rem;
    margin: 1rem 0;
  }

  .tab-btn {
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
  }

  .tab-btn.active {
    background: linear-gradient(90deg, #11151d 0%, #1b2130 100%);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .tab-panels {
    margin-top: 1rem;
  }

  .tab-panel {
    display: none;
  }

  .tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
  }

  .tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }

  .form-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* uniform spacing between form blocks */
  }

  .form-panel label {
    font-weight: 700;
    color: var(--muted);
    font-size: 0.95rem;
  }

  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem; /* spazio consistente tra i campi */
    align-items: start;
  }

  /* Ignore empty <p></p> used as manual separators so they don't add extra spacing */
  .form-panel p:empty {
    margin: 0;
    height: 0;
    line-height: 0;
  }

  /* Ensure direct children in the grid don't carry additional margins that break spacing */
  .form-grid > * {
    margin: 0;
  }

  /* Ensure each form grid child stacks label + control with consistent internal gap */
  .form-grid > * {
    display: flex;
    flex-direction: column;
    gap: 3px; /* spazio molto piccolo tra label e input */
  }

  /* Normalize range control appearance and spacing */
  .range-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .range-wrap .range-knowledge {
    flex: 1 1 auto;
  }

  @media (min-width: 900px) {
    .form-grid {
      grid-template-columns: 1fr 1fr;
    }
  }

  .form-panel input[type="text"],
  .form-panel select,
  .form-panel textarea {
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #0f1114;
    color: var(--text);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  }

  .form-panel textarea {
    min-height: 110px;
    resize: vertical;
  }

  .form-panel input[type="text"]::placeholder,
  .form-panel textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
  }

  .form-panel input[type="text"]:focus,
  .form-panel select:focus,
  .form-panel textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(231, 30, 39, 0.08),
      inset 0 2px 6px rgba(0, 0, 0, 0.5);
  }

  .card {
    padding: 1.2rem;
    border-radius: 16px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.01),
        rgba(255, 255, 255, 0.008)
      ),
      var(--card);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  }

  /* Pulsanti nel form */
  .card .btn {
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
  }

  .card .btn.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
  }

  /* File input personalizzato */
  .file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: #0d1317;
    border: 1px dashed rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
  }

  .file-label:hover {
    background: #0f161a;
  }

  .file-label input {
    display: none;
  }

  /* Custom form fields */
  .custom-field {
    position: relative;
  }

  .custom-input {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #0f1114;
    color: var(--text);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  }

  .custom-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(231, 30, 39, 0.08);
  }

  .custom-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #0f1114;
    color: var(--text);
    resize: vertical;
  }

  .textarea-counter {
    position: absolute;
    right: 0.7rem;
    bottom: 0.6rem;
    background: transparent;
    padding: 0.1rem 0.3rem;
  }

  /* Custom select */
  .custom-select {
    position: relative;
    display: inline-block;
    width: 100%;
  }

  .cs-trigger {
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #0f1114;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
  }

  .cs-trigger::after {
    content: "▾";
    float: right;
    opacity: 0.6;
  }

  .cs-options {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    /* dark panel with red border for strong contrast */
    background: #070708; /* near-black */
    border-radius: 12px;
    padding: 0.35rem;
    border: 1px solid var(--accent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
    max-height: 260px;
    overflow: auto;
    display: none;
    z-index: 60;
  }

  .cs-options li {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
    transform-origin: left center;
    color: var(--muted);
  }

  .cs-options li:hover {
    background: linear-gradient(
      90deg,
      rgba(231, 30, 39, 0.06),
      rgba(231, 30, 39, 0.03)
    );
    color: var(--text);
    transform: scale(1.03);
  }

  .custom-select.open .cs-options {
    display: block;
  }

  .custom-select:focus .cs-trigger {
    box-shadow: 0 6px 20px rgba(231, 30, 39, 0.08);
    border-color: var(--accent);
  }

  .file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: #0d1317;
    border: 1px dashed rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
  }

  .file-label:hover {
    background: #0f161a;
  }

  .file-label input {
    display: none;
  }

  .file-name {
    margin-top: 0.45rem;
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
  }

  /* Enhancements: smoother interactions and visual polish */
  .cs-trigger {
    transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
  }

  .custom-select .cs-trigger:hover {
    transform: translateY(-1px);
    color: var(--text);
  }

  .custom-select.open .cs-trigger::after {
    transform: rotate(180deg);
    display: inline-block;
    transition: transform 0.18s ease;
  }

  .cs-options li[aria-selected="true"],
  .cs-options li.selected {
    background: linear-gradient(
      90deg,
      rgba(231, 30, 39, 0.08),
      rgba(231, 30, 39, 0.04)
    );
    color: var(--text);
    font-weight: 800;
  }

  .cs-options li {
    transition: background 0.12s ease, color 0.12s ease;
  }

  /* custom scrollbar for options */
  .cs-options::-webkit-scrollbar {
    height: 8px;
    width: 8px;
  }

  .cs-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
  }

  /* file label drag state */
  .file-label.dragover {
    background: linear-gradient(
      90deg,
      rgba(17, 162, 74, 0.08),
      rgba(231, 30, 39, 0.04)
    );
    border-color: rgba(231, 30, 39, 0.12);
  }

  .file-label svg {
    margin-right: 0.4rem;
  }

  .file-name {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
  }

  /* textarea counter visual */
  .textarea-counter {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.18rem 0.45rem;
    border-radius: 8px;
    font-weight: 700;
    color: var(--muted);
    backdrop-filter: blur(2px);
  }

  /* focus-visible for keyboard users */
  .custom-input:focus-visible,
  .cs-trigger:focus-visible,
  .custom-textarea:focus-visible,
  .file-label:focus-visible {
    outline: 3px solid rgba(231, 30, 39, 0.12);
    outline-offset: 3px;
  }

  /* small thumbnail support (if preview added later) */
  .file-preview {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.5rem;
  }

  .file-preview img {
    width: 84px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  /* ensure consistent disabled look */
  .cs-trigger[disabled],
  .custom-input[disabled],
  .custom-textarea[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* Tab look upgrade */
  .tabs {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.01),
      rgba(255, 255, 255, 0.008)
    );
    padding: 0.4rem;
    border-radius: 12px;
    display: inline-flex;
    gap: 0.5rem;
  }

  .tab-btn {
    padding: 0.6rem 0.95rem;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
  }

  .tab-btn.active {
    background: linear-gradient(90deg, var(--bg), rgba(231, 30, 39, 0.06));
    color: var(--text);
    box-shadow: inset 0 -2px 0 rgba(231, 30, 39, 0.12);
  }

  /* Small helpers */
  .muted-small {
    color: var(--muted);
    font-size: 0.95rem;
  }
}

/* Social buttons fissi in basso a sinistra */
.social-fixed {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 60;
}

.social-fixed a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  background: #11151d;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.social-fixed a {
  transition: transform 0.15s ease, opacity 0.2s ease;
  will-change: transform;
}

.social-fixed a:hover {
  transform: translateY(-2px) scale(1.04);
  opacity: 0.95;
}

.social-fixed img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.social-fixed a span {
  font-size: 0.95rem;
}

@media (max-width: 700px) {
  .social-fixed {
    left: 0.6rem;
    bottom: 0.6rem;
  }

  .social-fixed a span {
    display: none;
  }
}

/* --- Testi tricolore mirati per l'headline --- */
.tri-green {
  color: #11a24a;
}

/* verde bandiera */
.tri-white {
  color: #ffffff;
}

.tri-red {
  color: #e71e27;
}

/* rosso logo */
.hero h1 span {
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

/* (Opzionale) Variante a gradiente per qualsiasi testo */
.tricolore {
  background: linear-gradient(
    90deg,
    #11a24a 0 33%,
    #ffffff 33% 66%,
    #e71e27 66% 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1.tricolore {
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

@media (max-width: 1000px) {
  .card {
    grid-column: span 6;
  }

  .card.wide {
    grid-column: span 12;
  }

  .navbar .inner {
    padding: 0.8rem 0;
  }
}

@media (max-width: 620px) {
  .nav-links {
    display: none;
  }

  .brand .title {
    font-size: 1.02rem;
  }

  .hero {
    min-height: 78vh;
  }

  .card {
    grid-column: span 12;
  }
}

/* =====================================
   Styles Bandi
   ===================================== */

/* Inline styles specific to this page - custom form controls */
.custom-field {
  position: relative;
}

.custom-input {
  width: 100%;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0f1114;
  color: var(--text);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}

.custom-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(231, 30, 39, 0.08);
}

.custom-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0f1114;
  color: var(--text);
  resize: vertical;
}

.textarea-counter {
  position: absolute;
  right: 0.7rem;
  bottom: 0.6rem;
  background: transparent;
  padding: 0.1rem 0.3rem;
}

.custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
}

.cs-trigger {
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0f1114;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.cs-trigger::after {
  content: "▾";
  float: right;
  opacity: 0.6;
}

.cs-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  background: #070708; /* near-black */
  border-radius: 12px;
  padding: 0.35rem;
  border: 1px solid var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  max-height: 260px;
  overflow: auto;
  display: none;
  z-index: 60;
}

.cs-options li {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
  transform-origin: left center;
  color: var(--muted);
}

.cs-options li:hover {
  background: linear-gradient(
    90deg,
    rgba(231, 30, 39, 0.06),
    rgba(231, 30, 39, 0.03)
  );
  color: var(--text);
  transform: scale(1.03);
}

.custom-select.open .cs-options {
  display: block;
}

.custom-select:focus .cs-trigger {
  box-shadow: 0 6px 20px rgba(231, 30, 39, 0.08);
  border-color: var(--accent);
}

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: #0d1317;
  border: 1px dashed rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.file-label:hover {
  background: #0f161a;
}

.file-label input {
  display: none;
}

.file-name {
  margin-top: 0.45rem;
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Enhancements: smoother interactions and visual polish */
.cs-trigger {
  transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.custom-select .cs-trigger:hover {
  transform: translateY(-1px);
  color: var(--text);
}

.custom-select.open .cs-trigger::after {
  transform: rotate(180deg);
  display: inline-block;
  transition: transform 0.18s ease;
}

.cs-options li[aria-selected="true"],
.cs-options li.selected {
  background: linear-gradient(
    90deg,
    rgba(231, 30, 39, 0.08),
    rgba(231, 30, 39, 0.04)
  );
  color: var(--text);
  font-weight: 800;
}

.cs-options li {
  transition: background 0.12s ease, color 0.12s ease;
}

/* custom scrollbar for options */
.cs-options::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.cs-options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

/* file label drag state */
.file-label.dragover {
  background: linear-gradient(
    90deg,
    rgba(17, 162, 74, 0.08),
    rgba(231, 30, 39, 0.04)
  );
  border-color: rgba(231, 30, 39, 0.12);
}

/* textarea counter visual */
.textarea-counter {
  background: rgba(255, 255, 255, 0.02);
  padding: 0.18rem 0.45rem;
  border-radius: 8px;
  font-weight: 700;
  color: var(--muted);
  backdrop-filter: blur(2px);
}

/* focus-visible for keyboard users */
.custom-input:focus-visible,
.cs-trigger:focus-visible,
.custom-textarea:focus-visible,
.file-label:focus-visible {
  outline: 3px solid rgba(231, 30, 39, 0.12);
  outline-offset: 3px;
}

/* small thumbnail support (if preview added later) */
.file-preview {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
}

.file-preview img {
  width: 84px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ensure consistent disabled look */
.cs-trigger[disabled],
.custom-input[disabled],
.custom-textarea[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Range slider knowledge (green -> red) */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 6px;
}
.range-knowledge {
  appearance: none;
  -webkit-appearance: none;
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #11a24a 0%, #e71e27 100%);
  position: relative;
  overflow: hidden;
}
.range-knowledge::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
}
.range-knowledge::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  margin-top: -3px;
}
.range-knowledge:focus {
  outline: none;
  box-shadow: 0 8px 26px rgba(231, 30, 39, 0.08);
}
.range-value {
  min-width: 28px;
  display: inline-block;
  text-align: center;
}

/* Track fill using CSS variable and linear-gradient trick */
.range-knowledge[data-fill] {
  background: linear-gradient(
    90deg,
    #11a24a 0%,
    #11a24a var(--fill, 50%),
    #e71e27 var(--fill, 50%) 100%
  );
}

/* ============================================================
   Pulsante Accesso Staff — navbar pubblica
   ============================================================ */
.btn-staff {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  border-radius: 11px;
  background: rgba(231,30,39,0.10);
  border: 1px solid rgba(231,30,39,0.25);
  color: var(--text);
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
  transition: background .18s, border-color .18s, transform .15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-staff:hover {
  background: rgba(231,30,39,0.20);
  border-color: rgba(231,30,39,0.5);
  transform: translateY(-1px);
}
.btn-staff img {
  width: 18px;
  height: 18px;
  filter: invert(1) brightness(10);
  opacity: .9;
}
