:root {
  --brand: #8d1b1f;
  --brand-dark: #5f1013;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e5e7eb;
  --soft: #fff6f6;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --radius: 18px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--brand);
  text-decoration: none;
}

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  color: var(--brand-dark);
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.nav-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  color: var(--ink);
}

.lang-select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 10px 12px;
  font-weight: 600;
}

.hero {
  padding: 56px 0 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.86rem;
}

h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
  margin: 0.6rem 0 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 65ch;
}

.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.hero-card,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  overflow: hidden;
}

.hero-card .pad {
  padding: 18px;
}

.section {
  padding: 28px 0;
}

.section h2 {
  font-size: 2rem;
  margin: 0 0 10px;
}

.section p.section-intro {
  color: var(--muted);
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.course-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.meta div {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.badge {
  display: inline-block;
  background: #f3f4f6;
  color: #111827;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.86rem;
  font-weight: 700;
}

.page-hero {
  padding: 44px 0 18px;
}

.page-title {
  font-size: clamp(1.8rem, 3vw, 3rem);
  margin: 0.5rem 0;
}

.info-list {
  display: grid;
  gap: 12px;
}

.info-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.footer {
  margin-top: 40px;
  padding: 28px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.team-card {
  padding: 20px;
}

.team-placeholder {
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(180deg, #fff, #f6f7fb);
  border: 1px dashed #c7ccd8;
  border-radius: 16px;
  color: #6b7280;
  padding: 20px;
}

.kpi {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.kpi .pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}

.cover {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  background: #e5e7eb;
}

.notice {
  background: var(--soft);
  border: 1px solid #f0c9c9;
  border-radius: 16px;
  padding: 18px 20px;
}

.cta-box {
  background: linear-gradient(180deg, #fff, #fff9f9);
  border: 1px solid #ecd0d0;
  border-radius: 18px;
  padding: 22px;
}

.link-list a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gallery-card {
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.gallery-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
}

.gallery-card .pad {
  padding: 16px;
}

.rtl {
  direction: rtl;
}

small.note {
  display: block;
  color: var(--muted);
  margin-top: 10px;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  font-weight: 600;
  padding: 10px 6px;
}

.dropbtn:hover {
  color: var(--brand);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 270px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px 0;
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 10px 14px;
  color: var(--ink);
  white-space: nowrap;
}

.dropdown-content a:hover {
  background: #f8f8f8;
  color: var(--brand);
}

.dropdown-content.show {
  display: block;
}

.course-info-block {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  line-height: 1.75;
  margin-top: 0;
  width: 100%;
  max-width: 900px;
  margin-left: 0;
  margin-right: auto;
}

body.page-asls .course-info-block {
  max-width: 1200px;
}

body.page-pals .course-info-block {
  max-width: 1150px;
}

body.page-acls .course-info-block {
  max-width: 1100px;
}

body.page-aclsep .course-info-block {
  max-width: 950px;
}

.course-info-block h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 2rem;
  color: #8d1b1f;
}

.course-info-block h2 span {
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
}

.course-info-block p {
  margin: 0 0 18px 0;
  color: #1f2937;
}

.course-info-block strong {
  color: #111827;
}

.course-info-note {
  margin: 24px 0;
  padding: 20px;
  background: #fff6f6;
  border: 1px solid #f0c9c9;
  border-radius: 14px;
}

.course-info-note h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #8d1b1f;
  font-size: 1.15rem;
}

.course-info-note ul {
  margin: 10px 0 0 20px;
  padding: 0;
}

.course-info-note li {
  margin-bottom: 8px;
}

.course-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.course-main-button,
.course-secondary-button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
}

.course-main-button {
  background: #8d1b1f;
  color: #ffffff;
}

.course-main-button:hover {
  background: #5f1013;
}

.course-secondary-button {
  background: #ffffff;
  color: #8d1b1f;
  border: 1px solid #8d1b1f;
}

.course-secondary-button:hover {
  background: #fff6f6;
}

.course-hero-image-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  margin-bottom: 0 !important;
}

.course-hero-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  margin-bottom: 0 !important;
}

.hero-buttons {
  position: absolute;
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
}

.image-top-left-button,
.image-second-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, background 0.15s ease;
}

.image-top-left-button {
  background: rgba(148, 22, 22, 0.92);
  color: #fff;
}

.image-second-button {
  background: rgba(15, 18, 28, 0.9);
  color: #fff;
}

.image-top-left-button:hover,
.image-second-button:hover {
  transform: translateY(-1px);
}

/* TABELLE CORSI */
.table-wrap {
  overflow-x: auto;
  margin-top: 1.2rem;
}

.course-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 2px solid #d9d9d9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.course-table th,
.course-table td {
  border: 1px solid #d9d9d9;
  padding: 18px;
  vertical-align: top;
  text-align: left;
  line-height: 1.6;
}

.course-table th {
  background: #f6f6f6;
  font-weight: 700;
}

.course-table tbody tr:nth-child(even) {
  background: #fcfcfc;
}

.course-table td:first-child {
  width: 36%;
  font-weight: 700;
  white-space: nowrap;
}

.course-table td:last-child {
  width: 64%;
}

/* POSIZIONAMENTO PULSANTI PAGINE CORSO
   Versione responsive: niente più top fissi in px.
   I pulsanti restano ancorati dentro l’immagine e non si spostano in modo anomalo
   quando ingrandisci o riduci la finestra. */

body.page-asls .page-hero,
body.page-pals .page-hero,
body.page-acls .page-hero,
body.page-aclsep .page-hero {
  padding-bottom: 22px;
}

body.page-asls .section,
body.page-pals .section,
body.page-acls .section,
body.page-aclsep .section {
  padding-top: 24px;
}

body.page-asls .course-hero-image-wrap,
body.page-pals .course-hero-image-wrap,
body.page-acls .course-hero-image-wrap,
body.page-aclsep .course-hero-image-wrap {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 0;
}

body.page-asls .course-hero-image,
body.page-pals .course-hero-image,
body.page-acls .course-hero-image,
body.page-aclsep .course-hero-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  margin-bottom: 0;
}

body.page-asls .hero-buttons,
body.page-pals .hero-buttons,
body.page-acls .hero-buttons,
body.page-aclsep .hero-buttons {
  position: absolute;
  top: auto;
  left: auto;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(8px, 1.2vw, 12px);
  max-width: calc(100% - 24px);
}

body.page-asls .image-top-left-button,
body.page-asls .image-second-button,
body.page-pals .image-top-left-button,
body.page-pals .image-second-button,
body.page-acls .image-top-left-button,
body.page-acls .image-second-button,
body.page-aclsep .image-top-left-button,
body.page-aclsep .image-second-button {
  min-height: clamp(44px, 5vw, 60px);
  padding: 0 clamp(14px, 2vw, 22px);
  font-size: clamp(0.95rem, 1.7vw, 1.45rem);
  font-weight: 800;
  border-radius: 14px;
  white-space: nowrap;
  line-height: 1;
}

body.page-asls .course-info-block,
body.page-pals .course-info-block,
body.page-acls .course-info-block,
body.page-aclsep .course-info-block {
  width: 100%;
  max-width: 100%;
  margin-top: 0;
}

/* RESPONSIVE */
@media (max-width: 960px) {

  .hero-grid,
  .grid-3,
  .grid-2,
  .gallery {
    grid-template-columns: 1fr;
  }

  .nav {
    padding: 10px 0;
  }
}

@media (max-width: 900px) {

  body.page-asls .hero-buttons,
  body.page-pals .hero-buttons,
  body.page-acls .hero-buttons,
  body.page-aclsep .hero-buttons {
    right: 14px;
    bottom: 14px;
    top: auto;
    left: auto;
    gap: 8px;
  }

  .image-top-left-button,
  .image-second-button {
    min-height: 44px;
    padding: 0 14px;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {

  body.page-asls .hero-buttons,
  body.page-pals .hero-buttons,
  body.page-acls .hero-buttons,
  body.page-aclsep .hero-buttons {
    position: static;
    margin-top: 12px;
    width: 100%;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
  }

  body.page-asls .image-top-left-button,
  body.page-asls .image-second-button,
  body.page-pals .image-top-left-button,
  body.page-pals .image-second-button,
  body.page-acls .image-top-left-button,
  body.page-acls .image-second-button,
  body.page-aclsep .image-top-left-button,
  body.page-aclsep .image-second-button {
    width: 100%;
    white-space: normal;
    text-align: center;
    min-height: 48px;
    line-height: 1.2;
    padding: 10px 14px;
  }

  .course-table td:first-child {
    white-space: normal;
    width: 40%;
  }
}

html {
  scroll-behavior: smooth;
}

.hero-card,
.card,
.course-info-block,
.gallery-card {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.topbar-scrolled .brand-badge {
  transform: scale(1.03);
  transition: transform 0.2s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  height: 60px;
  width: auto;
  display: block;
}