/* =========================================================
   styles.css
   Target: index.html, compila.html, partner.html
   Author: Serafina Agnello
========================================================= */

/* -----------------------------
   Design tokens
------------------------------ */
:root{
  --text:#111827;
  --muted:#4b5563;
  --border:#e5e7eb;

  /* Brand */
  --btn:#133A7E;
  --btn-hover:#2F528D;
  --accent-red:#b91c1c;
  --accent-red-hover:#991b1b;

  /* Shadows (reduced vs original) */
  --shadow-sm: 0 4px 12px rgba(0,0,0,.08);
  --shadow-md: 0 10px 28px rgba(0,0,0,.12);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.16);

  --radius: 10px;
}

/* -----------------------------
   Base / reset
------------------------------ */
*{ box-sizing:border-box; }

/* Safari/Chrome parity:
   - overflow-x su html/body in Safari a volte si comporta diversamente.
   - "clip" è più corretto del "hidden" (non crea scroll container), ma non è ovunque.
*/
html, body{
  /*height:100%;*/
  width: 100%;
  overflow-x: hidden;
}

/* Preferisci clip dove supportato (evita effetti collaterali di hidden su Safari) */
@supports (overflow: clip){
  html, body{ overflow-x: clip; }
}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  line-height:1.45;
  font-size: 20px;

  /* Do NOT disable text selection (accessibility & usability)
  user-select: auto;
  -webkit-user-select: auto;
  -ms-user-select: auto;*/

  position: relative;
}

/* Soft white veil (useful when background images are present) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.78);
  z-index: 0;
  pointer-events: none;
}

/* Layout wrapper */
.wrap{
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Accessible focus ring */
:focus-visible{
  outline: 3px solid rgba(19,58,126,0.35);
  outline-offset: 2px;
}

/* Screen-reader only */
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* -----------------------------
   Shared footer
------------------------------ */
footer{
  background: var(--btn);
  color: #fff;
  padding: 18px 20px 14px;
  text-align: center;
}

.footer-inner{
  max-width: 1200px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-text{
  font-size: 14px;
  margin: 0;
  opacity: 0.95;
  padding: 30px 0;
}

.footer-text a{
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-text a:hover{
  color: #e7efff;
}

/* -----------------------------
   Shared header (all pages)
------------------------------ */
header{
  background: var(--btn);
  padding: 14px 20px;
}

.header-inner{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.header-left,
.header-center,
.header-right{
  display: flex;
  align-items: center;
}

.header-left{ justify-content: flex-start; }
.header-center{ justify-content: center; }
.header-right{ justify-content: flex-end; }

.header-logo{
  display: block;
  height: 46px;
  width: auto;
  max-width: min(260px, 40vw);
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

nav.menu{
  display: inline-flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

nav.menu a{
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.95;
  padding: 8px 8px;
  border-radius: var(--radius);
  transition: color .15s ease, opacity .15s ease, background .15s ease;
}

nav.menu a:hover{
  color: #f2f2f2;
  opacity: 1;
  background: rgba(255,255,255,0.10);
}

/* Language selector in header */
.lang-header{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius);

  /* Safari needs prefixed backdrop-filter for parity */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lang-header .label{
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
}

.lang-header .lang-btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .04s ease, background .15s ease, border-color .15s ease, color .15s ease;
  min-height: 34px;
}

.lang-header .lang-btn:hover{
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.55);
}

.lang-header .lang-btn:active{ transform: translateY(1px); }

.lang-header .lang-btn.active{
  background: #fff;
  color: var(--btn);
  border-color: transparent;
}

.lang-header .flag{ font-size: 16px; line-height: 1; }

/* Header responsive */
@media (max-width: 860px){
  .header-inner{
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "left right"
      "center center";
    row-gap: 10px;
  }
  .header-left{ grid-area: left; }
  .header-right{ grid-area: right; }
  .header-center{ grid-area: center; }
  nav.menu a{ font-size: 13px; padding: 8px 6px; }
}
@media (max-width: 720px){
  .lang-header .label{ display:none; }
}

/* -----------------------------
   Page backgrounds
------------------------------ */
.page-compila,
.page-partner{
  background: url("sfondo.jpg") center center / cover no-repeat fixed;
}

/* Mobile Safari perf: avoid background-attachment: fixed */
@media (max-width: 900px){
  .page-compila,
  .page-partner{
    background-attachment: scroll;
  }
}

/* Index only */
.page-index{ overflow-x: hidden; }
@supports (overflow: clip){
  .page-index{ overflow-x: clip; }
}

.page-index main{
  flex: 1;
  width: 100%;
  padding: 22px 16px 34px;
  text-align: left;
}

/* -----------------------------
   Shared button style helpers
------------------------------ */
.home-project__cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 29px;
  background: var(--accent-red);
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform .05s ease, background .15s ease;
}
.home-project__cta:hover{ background: var(--btn); }
.home-project__cta:active{ transform: translateY(1px); }

/* -----------------------------
   HOME – Hero (overflow layout)
------------------------------ */
.home-hero--overflow{ width: 100%; }

.home-hero__card--overflow{
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 18px;
  position: relative;
  overflow: visible;
}

.home-hero__card--overflow::before{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--btn);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  z-index: 0;
}

.home-hero__grid{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: center;
}

.home-hero__media{
  position: relative;

  /* Safari/Chrome parity:
     definisci un box “deterministico” per risolvere correttamente %height + object-fit.
     Questo evita che Safari usi l’altezza intrinseca e “zoom” la foto.
  */
  aspect-ratio: 16 / 10;
  width: 100%;
  min-height: 280px;
}

/* img hero: rendi dimensioni esplicite e coerenti */
.home-hero__photo--overflow{
  width: 100%;
  height: 100%;
  min-height: 280px;

  object-fit: cover;
  border-radius: 22px;
  display: block;

  /* transforms: aggiungo prefisso per WebKit */
  -webkit-transform: rotate(-6deg);
  transform: rotate(-6deg);
  transform-origin: center;

  position: relative;
  left: -44px;
  top: -18px;
  margin-bottom: -14px;

  box-shadow: 0 16px 40px rgba(0,0,0,.22);

  /* Workaround Safari: stabilizza compositing/clipping su elementi trasformati */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.home-hero__snow{
  position: absolute;
  right: -60px;
  bottom: -18px;
  width: min(190px, 35vw);
  height: auto;

  -webkit-transform: rotate(10deg);
  transform: rotate(10deg);

  /* prefisso per Safari */
  -webkit-filter: drop-shadow(0 10px 18px rgba(0,0,0,.22));
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.22));

  pointer-events: none;
  user-select: none;
}

.home-hero__content{
  /* Shared width (logo + CTA) */
  --brand-w: min(600px, 90%);
  padding: 4px 12px 10px 6px;
  color: #fff;
}

.home-hero__brand{
  display: block;
  width: var(--brand-w);
  height: auto;
  margin: 0 0 12px auto;

  -webkit-transform: translateY(-30px);
  transform: translateY(-30px);
  font-size: 25px;
  font-weight: 200;
}

.home-hero__ctas{
  width: var(--brand-w);
  margin-left: auto;
  margin-right: 0;
  display: grid;
  gap: 30px;
  justify-items: stretch;
  max-width: none;
}

.home-hero__btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  padding: 10px 12px;
  min-height: 40px;
  border-radius: 9px;

  background: rgba(255,255,255,0.96);
  color: var(--btn);
  text-decoration: none;

  font-weight: 500;
  border: 2px solid rgba(255,255,255,0.28);
  box-shadow: var(--shadow-sm);
  transition: transform .04s ease, background .15s ease;
}

.home-hero__btn:hover{ background: #ffffff; }
.home-hero__btn:active{ transform: translateY(1px); }
.home-hero__btn--primary{ border-color: rgba(255,255,255,0.45); }



@media (max-width: 980px){
  .home-hero__grid{ grid-template-columns: 1fr; gap: 16px; }

  .home-hero__media{
    aspect-ratio: 16 / 11;
    min-height: 240px;

  }

  .home-hero__photo--overflow{
    width: 100%;
    height: 100%;
    min-height: 240px;
    left: 0;
    top: -14px;
    margin-bottom: 0;
    -webkit-transform: rotate(-3deg);
    transform: rotate(-3deg);
  }

  .home-hero__content{
    --brand-w: 100%;
    padding: 0 8px 6px;
  }

  .home-hero__brand{
    -webkit-transform: none;
    transform: none;
    margin: 0 0 10px 0;
  }

  .home-hero__ctas{
    width: 100%;
    margin: 0;
    gap: 12px;
  }

  .home-hero__btn{ min-height: 44px; font-size: 16px; }

  .home-hero__snow{
    right: 6px;
    bottom: -10px;
    width: min(170px, 42vw);
  }
}

@media (max-width: 520px){
  .home-hero__card--overflow{ padding: 14px; }
  .home-hero__card--overflow::before{ border-radius: 20px; }
  .home-hero__photo--overflow{ border-radius: 18px; }
  .home-hero__brand{ width: 92%; font-size: 18px;}
}

/* -----------------------------
   HOME – Sezione Progetto (bianco)
------------------------------ */
.home-project{
  background: #fff !important;
  width: 100%;
  padding: 50px 0px;
}

.home-project__inner{
  max-width: 1100px;
  margin: 0 auto;
}

.home-project__head{
  text-align: center;
  background: #fff !important;
}

.home-project__kicker{
  margin: 0 0 14px;
  color: var(--accent-red);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.home-project__title{
  margin: 0;
  color: var(--btn);
  font-size: clamp(30px, 3.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
}

@media (max-width: 520px){
  .home-project__title{
    font-size:40px;
    line-height: 1.05; /* opzionale: lascia invariato se già ti piace */
  }
}

.home-project__date{
  color: rgba(17,24,39,0.60);
  font-size: 18px;
  font-weight: 500;
}

.home-project__rule{
  width: 240px;
  height: 10px;
  background: var(--btn);
  margin: 12px auto 12px;
  border-radius: 0;
}

.home-project__lead{
  margin: 0 auto;
  max-width: 88ch;
  color: rgba(17,24,39,0.74);
  font-size: 18px;
  line-height: 1.75;
}

.home-project__ctaWrap{ margin: 22px 0 0; }

/* -----------------------------
   HOME – Sezione INFO (split)
------------------------------ */
.info-section{
  background: #fff;
  padding: 60px 20px 70px;
  width: 100%;
}

.info-inner{
  max-width: 1200px;
  margin: 0 auto;
}

.info-grid{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: stretch;
}

.info-title{
  color: var(--btn);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}

.info-title--center{
  text-align: center;
  margin-top: 50px;
}

.info-text p{
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 18px;
}

.info-text--center{
  text-align: center;
  max-width: 900px;
  margin: 0 auto 36px;
}

.info-subtitle{
  color: var(--btn);
  font-size: 16px;
  font-weight: 800;
  margin: 30px 0 14px;
}

.age-table_indicazione {
  display: none;
  align-items: center;
  gap: 0.5rem;

  font-size: 0.9rem;
  font-weight: 500;
  color: #0b4f6c;

  background: #e6f4fa;
  border-left: 4px solid #0b4f6c;
  padding: 0.6rem 0.75rem;
  margin-top: 20px;
  /*margin: 1rem 0 0.75rem auto;*/
  border-radius: 4px;
  max-width: fit-content;
}

/* freccia */
.age-table_indicazione .arrow {
  font-size: 1.1rem;
  font-weight: 700;
}

/* visibile solo mobile + tablet verticale */
@media (max-width: 1024px) and (orientation: portrait) {
  .age-table_indicazione {
    display: inline-flex;
  }
}

/* Table (committee) */
.info-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.info-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.info-table th{
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.info-table th:first-child{ width: 50%; }

.info-table td{
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: var(--text);
}

.info-divider{
  width: 2px;
  background-color: var(--accent-red);
  height: 100%;
  min-height: 400px;
}

.info-intro{
  font-size: 17px;
  margin: 0 0 26px;
  color: var(--text);
}

.info-point{ margin: 0 0 24px; }

.info-point-title{
  color: var(--accent-red);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}

.info-point p{
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(17,24,39,0.85);
}

.info-actions{
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 900px){
  .info-section{ padding: 0px 20px;}
  .info-grid{ grid-template-columns: 1fr; gap: 0; }
  .info-divider{ display: none; }
  .info-col{ padding-bottom: 0px; }
  .info-col--left{
    /*border-bottom: 1px solid #e5e7eb;*/
    margin-bottom: 40px;
  }
}

/* -----------------------------
   HOME – Sezione Età (hero + cards + table)
------------------------------ */
.age-section{
  width: 100%;
  margin-top: 34px;
}

.age-hero{
  background: var(--btn);
  color: #fff;
  padding: 58px 16px 86px;

  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.age-hero__inner{
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.age-hero__title{
  margin: 0;
  font-size: clamp(26px, 3.1vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.age-hero__subtitle{
  margin: 12px 0 0;
  font-size: clamp(16px, 1.6vw, 20px);
  opacity: 0.95;
}

.age-hero__desc{
  margin: 18px auto 0;
  max-width: 85ch;
  font-size: 16px;
  line-height: 1.55;
  opacity: 0.9;
}

/* Cards overlay */
.age-cards{
  background: transparent;
  margin-top: -46px;
  padding: 0 16px;
}

.age-cards__inner{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.age-card{
  --age-accent: #1aa6a3;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(17,24,39,0.08);
  border-radius: 12px;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .08s ease, box-shadow .15s ease;
}

.age-card::before{
  content:"";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--age-accent);
}

.age-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(0,0,0,.12);
}

.age-card--teal{   --age-accent:#1aa6a3; }
.age-card--green{  --age-accent:#2f9e44; }
.age-card--orange{ --age-accent:#f08c00; }
.age-card--red{    --age-accent:#e03131; }

.age-card__kicker{
  margin: 2px 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(17,24,39,0.55);
  font-weight: 700;
}

.age-card__range{
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.age-card__text{
  margin: 0 0 14px;
  font-size: 14px;
  color: rgba(17,24,39,0.75);
  line-height: 1.35;
}

.age-card__link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--age-accent);
}

.age-services{
  background: transparent;
  padding: 58px 16px 54px;
  margin-top: 22px;
}

.age-services__inner{
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.age-services__title{
  margin: 0;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 800;
  color: var(--btn);
}

.age-services__subtitle{
  margin: 10px 0 0;
  color: rgba(17,24,39,0.65);
  font-size: 16px;
}

/* Scrollable table wrapper */
.age-tableWrap{
  margin-top: 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  outline: none;
}

.age-table{
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0 16px;
  text-align: left;
}

.age-table thead th{
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(17,24,39,0.55);
  padding: 0 14px 12px;
}

.age-table__leftHead{
  width: 46%;
  padding-left: 16px;
  color: rgba(17,24,39,0.45);
}

.age-table__colHead{ text-align: center; font-weight: 800; }

.age-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  border: 1px solid rgba(17,24,39,0.06);
}

.age-pill--teal{   background: rgba(26,166,163,0.16); color: #0b5c5a; }
.age-pill--green{  background: rgba(47,158,68,0.16);  color: #1b5e2b; }
.age-pill--orange{ background: rgba(240,140,0,0.16);  color: #7a3f00; }
.age-pill--red{    background: rgba(224,49,49,0.16);  color: #7a1414; }

.age-table tbody tr{
  background: rgba(255,255,255,0.98);
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
}

.age-table tbody th,
.age-table tbody td{
  padding: 16px 14px;
  border-top: 1px solid rgba(17,24,39,0.06);
  border-bottom: 1px solid rgba(17,24,39,0.06);
}

.age-table tbody th{
  border-left: 1px solid rgba(17,24,39,0.06);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.age-table tbody td:last-child{
  border-right: 1px solid rgba(17,24,39,0.06);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.age-table__rowTitle{
  font-size: 16px;
  font-weight: 700;
  color: rgba(17,24,39,0.86);
}

.age-table__rowNote{
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(17,24,39,0.55);
}

.age-table__cell{
  text-align: center;
  vertical-align: middle;
}

.tick{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
}

.tick--teal{   background: rgba(26,166,163,0.18); color: #0b5c5a; }
.tick--green{  background: rgba(47,158,68,0.18);  color: #1b5e2b; }
.tick--orange{ background: rgba(240,140,0,0.18);  color: #7a3f00; }
.tick--red{    background: rgba(224,49,49,0.18);  color: #7a1414; }

.dash{ color: rgba(17,24,39,0.35); font-weight: 800; }

@media (max-width: 1100px){
  .age-cards__inner{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .age-hero{ padding: 44px 16px 78px; }
  .age-cards__inner{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  .age-pill{ min-width: 76px; padding: 8px 10px; font-size: 13px; }
}

/* -----------------------------
   HOME – App promo (fixed invalid comment from original)
------------------------------ */
.app-promo-section{
  position: relative;

  width: 100%;
  margin-left: 0;
  margin-right: 0;

  background-image: url('img/imgApp.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  min-height: 350px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.app-promo-section::before{
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.app-promo-inner{
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.app-promo-content{
  flex: 1;
  color: #ffffff;
  text-align: left;
}

.app-promo-title{
  margin: 0 0 14px;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.app-promo-subtitle{
  margin: 0;
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  opacity: 0.95;
}

.app-promo-media{ flex-shrink: 0; }

.app-promo-logo{
  display: block;
  width: auto;
  max-width: 220px;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@media (max-width: 860px){
  .app-promo-section{ min-height: auto; }
  .app-promo-inner{
    flex-direction: column;
    text-align: center;
    padding: 50px 20px;
    gap: 30px;
  }
  .app-promo-content{ text-align: center; order: 1; }
  .app-promo-media{ order: 2; }
  .app-promo-logo{ margin: 0 auto; max-width: 180px; }
}

/* -----------------------------
   HOME – Actions (image + buttons)
------------------------------ */
.actions-section{
  background-color: #ffffff;
  padding: 60px 20px;
  width: 100%;
}

.actions-inner{
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.actions-image{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.12);
  object-fit: cover;
  max-height: 400px;
}

.actions-buttons{
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  padding: 0 20px;
}

.action-btn-custom{
  width: 100%;
  font-size: 18px;
  letter-spacing: 0.05em;
  text-align: center;
  display: flex;
  justify-content: center;
  margin: 0;
  box-shadow: 0 4px 10px rgba(185, 28, 28, 0.2);
}

@media (max-width: 900px){
  .actions-inner{ grid-template-columns: 1fr; gap: 30px; }
  .actions-buttons{ align-items: center; padding: 0; }
  .actions-image{ max-height: 300px; }
}

/* -----------------------------
   COMPILA page
------------------------------ */
.page-compila .wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-compila main{
  flex: 1;
  width: 100%;
  padding: 28px 20px 34px;
}

.compila-hero{
  padding: 26px 0 6px;
  max-width: 1200px;
  margin: 50px auto;
  width: 100%;
  text-align: center;
}

.compila-hero h1{
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.compila-hero p.lead{
  margin: 0 auto 1px;
  color: var(--muted);
  font-size: 20px;
  max-width: 70ch;
}

.cards{
  width: min(1100px, 100%);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.card{
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  /* Safari parity */
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.card h2{
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.01em;
}

.card .sub{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.actions{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

a.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 14px 16px;
  min-width: 210px;
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration:none;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  background: var(--btn);
  transition: transform .04s ease, background .15s ease, border-color .15s ease, color .15s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,.07);
}
a.btn:hover{ background: var(--btn-hover); }
a.btn:active{ transform: translateY(1px); }

@media (max-width: 900px){
  .cards{ grid-template-columns: 1fr; }
  .card{ flex-direction: column; align-items: flex-start; }
  .actions{ width: 100%; justify-content: flex-start; }
  a.btn{ width: 100%; min-width: 0; }
}

/* -----------------------------
   PARTNER page
------------------------------ */
.page-partner main{
  flex: 1;
  width: 100%;
  padding: 26px 20px 34px;
}

.partner-wrap{
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.partner-block{
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.partner-title{
  margin: 0;
  padding: 14px 16px;
  text-align: center;
  background: var(--btn);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 16px;
}

.partner-logos{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 22px;
  align-items: center;
  justify-items: center;
  padding: 22px 22px 26px;
}

.partner-logos img{
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 86px;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.partner-testimonials{ padding: 22px 22px 28px; }

.partner-testimonials p{
  margin: 0;
  color: var(--btn);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.65;
  font-size: 18px;
}

@media (max-width: 520px){
  .partner-logos{
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    padding: 18px 16px 22px;
    gap: 14px 14px;
  }
  .partner-logos img{ max-height: 72px; }
  .partner-testimonials p{ font-size: 16px; }
}

.footer-logo{
  width: min(300px, 50vw);
  display: block;
}

/* Media responsive: evita immagini più larghe del container */
img, svg, video, canvas{
  max-width: 100%;
  height: auto;
}


/* =========================================================
   MEDIA page (media.html)
========================================================= */

.page-media{
  background: #ffffff;
}

.page-media .wrap{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.media-main{
  flex: 1;
  width: 100%;
  padding: 28px 20px 42px;
}

.media-hero{
  max-width: 1200px;
  margin: 34px auto 14px;
  text-align: center;
}

.media-title{
  margin: 0 0 10px;
  font-size: clamp(30px, 3.4vw, 48px);
  letter-spacing: -0.02em;
  color: var(--btn);
}

.media-lead{
  margin: 0 auto;
  max-width: 80ch;
  color: rgba(17,24,39,0.68);
  font-size: 18px;
  line-height: 1.65;
}

/* container più moderno: niente “box” pesante */
.media-gallery{
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 8px 0 0;
}

.media-count{
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 2px 10px;
  font-size: 14px;
  color: rgba(17,24,39,0.62);
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* GRID */
.media-grid{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 8px 2px 6px;
}

@media (max-width: 980px){
  .media-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px){
  .media-grid{ grid-template-columns: 1fr; }
}

/* CARD modern clean */
.media-card{
  border: 1px solid rgba(17,24,39,0.08);
  border-radius: 18px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}

.media-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.10);
  border-color: rgba(19,58,126,0.18);
}

.media-thumb{
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;   /* look più moderno “square grid” */
  object-fit: cover;
}

/* Pagination */
.media-pagination{
  max-width: 1200px;
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 2px 2px;
  flex-wrap: wrap;
}

.media-pageBtn,
.media-numBtn{
  appearance: none;
  border: 1px solid rgba(17,24,39,0.10);
  background: #fff;
  color: rgba(17,24,39,0.84);
  font-weight: 900;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .06s ease, background .18s ease, border-color .18s ease;
}

.media-pageBtn:hover,
.media-numBtn:hover{
  background: rgba(17,24,39,0.04);
  border-color: rgba(17,24,39,0.18);
}

.media-pageBtn:disabled{
  opacity: 0.42;
  cursor: not-allowed;
}

.media-numBtn.active{
  background: var(--btn);
  color: #fff;
  border-color: transparent;
}

.media-ellipsis{
  font-weight: 900;
  color: rgba(17,24,39,0.45);
  padding: 0 4px;
}

/* Lightbox */
body.is-modal-open{
  overflow: hidden;
}

.lightbox{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.lightbox.is-open{ display: block; }

.lightbox-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.76);
}

.lightbox-dialog{
  position: relative;
  max-width: min(1100px, calc(100% - 28px));
  margin: 24px auto;
  border-radius: 18px;
  background: rgba(10,12,16,0.94);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 28px 70px rgba(0,0,0,0.45);
  overflow: hidden;
  min-height: min(76vh, 720px);
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
}

@media (max-width: 700px){
  .lightbox-dialog{
    grid-template-columns: 48px 1fr 48px;
    margin: 14px auto;
    min-height: min(82vh, 720px);
  }
}

.lightbox-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover{
  background: rgba(255,255,255,0.14);
}

.lightbox-nav{
  height: 100%;
  appearance: none;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 44px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0.92;
}

.lightbox-nav:hover{
  background: rgba(255,255,255,0.06);
  opacity: 1;
}

.lightbox-figure{
  margin: 0;
  padding: 44px 14px 18px;
  height: 100%;
  display: grid;
  align-items: center;
}

.lightbox-img{
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
