/* ! Main */
main{
  display: flex;
  width: 100%;
  height: fit-content;
  display: flex;justify-content: center;align-items: center;flex-direction: column;
  margin-top: 45px;
  position: relative;
}

:root {
  /* ! Brand colors */
  --phonetastico-color: #ff3131;

  /* Menu */
  --menu-bg: #FFFFFF;
  --menu-color:  #0B0D12;

  /* White System */
  --white-premium: #FFFFFF;
  --white-soft: #f5f5f7;
  --white-muted: #EEF1F6;

  /* Black Premium System */
  --black-premium: #0B0D12;   /* hero, background principale */
  --black-soft: #12141A;      /* section scure */
  --black-muted: #1A1D24;     /* card scure */
  
  /* Blue Trust */
  --blue-premium: #0A3D91;    /* colore principale di fiducia */
  --blue-soft: #E9F0FB;       /* sfondi chiari */
  --blue-accent: #2e75e8;     /* CTA, link, focus */
  --blue-deep: #304e7f;       /* testi scuri o sfondi profondi */
  --blue-muted: #2B4C7E;      /* testi secondari */

  /* Neutral Grays */
  --gray-light: #E5E7EB;
  --gray-medium: #6B7280;
  --gray-dark: #1F2937;
  --gray-deep: #111827;

  /* Status Colors */
  --success-trust: #16A34A;   /* verde fiducia */
  --warning-soft: #F59E0B;    /* arancione warning */
  --error-soft: #DC2626;      /* rosso errore */

  /* Shadow System */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 20px 50px rgba(0, 0, 0, 0.15);
  --shadow-deep: 0 30px 80px rgba(0, 0, 0, 0.25);

  /* ! RGB colors */
  /* Menu */
  --menu-bg-rgb: 29, 29, 31;
  --menu-color-rgb: 255, 255, 255;

  /* White System */
  --white-premium-rgb: 255, 255, 255;
  --white-soft-rgb: 245, 245, 247;
  --white-muted-rgb: 238, 241, 246;

  /* Black Premium System */
  --black-premium-rgb: 11, 13, 18;
  --black-soft-rgb: 18, 20, 26;
  --black-muted-rgb: 26, 29, 36;
  
  /* Blue Trust */
  --blue-premium-rgb: 10, 61, 145;
  --blue-soft-rgb: 233, 240, 251;
  --blue-accent-rgb: 31, 106, 225;
  --blue-deep-rgb: 8, 31, 77;
  --blue-muted-rgb: 43, 76, 126;

  /* Neutral Grays */
  --gray-light-rgb: 229, 231, 235;
  --gray-medium-rgb: 107, 114, 128;
  --gray-dark-rgb: 31, 41, 55;
  --gray-deep-rgb: 17, 24, 39;

  /* Status Colors */
  --success-trust-rgb: 22, 163, 74;
  --warning-soft-rgb: 245, 158, 11;
  --error-soft-rgb: 220, 38, 38;

  /* Shadow System */
  --shadow-soft-rgb: 0, 0, 0, 0.1;
  --shadow-medium-rgb: 0, 0, 0, 0.15;
  --shadow-deep-rgb: 0, 0, 0, 0.25;

  --height: 220px;
  --width: 280px;
}

.hero{
  width: 100%;
  height: 680px;
  padding: 70px 0px 0px 0px;
  display: flex;align-items: center;
  flex-direction: column;
  position: relative;
  border-bottom: 0.8px solid var(--gray-light);

  background-color: var(--white-soft);
  overflow: hidden;
}
.hero h2{
  max-width: 550px;
  color: var(--black-premium);
  text-align: center;
  font-weight: 850;
  color: var(--black-muted);
  position: relative;
  z-index: 2;
}
@media (max-width: 850px) {
  .hero h2{max-width: 500px;}
}
.hero p{
  color: var(--black-muted);
  font-size: 18px;
  margin-top: 10px;
  margin-bottom: 20px;
  text-align: center;
  max-width: 400px;
  position: relative; z-index: 2;
}
.hero-genA{
  position: absolute;
  top: 0;left: 0;
  width: 100%;height: 100%;
  z-index: 3;
}
.hero-cta{
  position: relative;
  z-index: 4;
}

.hero .img-container{
  width: 100%;
  height: 390px;
  margin-top: auto;
  display: flex;justify-content: center;align-items: flex-end;
}

.hero .img-container img{
  height: 100%;width: 100%;
  object-fit: contain;
  z-index: 2;
}

@media (max-width: 768px) {
  .hero{
    height: 500px;
    padding-top: 30px;
    border-bottom: 0.2px solid rgba(var(--gray-light-rgb), 0.1);
  }
  .hero h2{
    line-height: 40px;
    max-width: 400px;
    font-size: 3rem;
  }
  .hero p{
    max-width: 320px;
  }
  .hero .img-container{
    height: 250px;
    width: 100%;
    display: flex;justify-content: center;align-items: flex-end;align-content: flex-end;
    padding-bottom: 0;
  }
  .hero .img-container img{
    height: 90%;
  }
}

/* ! D-square */
.d-square{
  height: 1100px;width: 100%;
  padding: 1% ;margin: 0;
  gap: 1%;
  display: flex;justify-content: center;align-items: center;flex-direction: column;
  user-select: none;
}
.d-square h2{
  color: var(--black-premium);
  text-align: center;
  font-weight: 800;
  color: var(--black-muted);
  margin-bottom: 0px;
}
.d-square p{
  color: var(--black-muted);
  margin-top: 0px;
  margin-bottom: 20px;
  text-align: center;
  max-width: 400px;
}

.square{
  width: 100%;height: 100%;
  display: flex;flex-direction: column;align-items: center;
  padding: 50px 0px 0px 0px;
  background-color: var(--white-soft);
  position: relative;
  overflow: hidden;
}
.square .cta-container{
  width: 100%;height: fit-content;
  display: flex;justify-content: center;align-items: center;
  gap: 10px;
}
.square .square-uniA{
  position: absolute;
  z-index: 2;
  top: 0;left: 0;
  width: 100%;
  height: 100%;
}
.square .cta, .cta2{
  position: relative;z-index: 3;
}

/* ! Square1 */
.square1{
  background-color: var(--black-muted);
}
.square1 .square-uniA{
  z-index: 3;
}
.square1 .img-container{
  height: 65%;width: 100%;
  display: flex;justify-content: center;align-items: flex-end;
  padding: 0px 0px 10px 0px;
  margin: auto 0 0 0;
}
.square1 .img-container img{
  height: 100%;object-fit: contain;
}
.square1 h2{color: var(--white-premium);}
.square1 p{color: var(--white-muted);margin-top: 8px;}
.square1 p span{
  border-radius: 10px;
  padding: 1.5px 4px;
  background-color: var(--phonetastico-color);
  color: var(--white-premium);
}
.square1 h2, p, .img-container{position: relative;z-index: 2;}

.square1-bg{
  top: 0;left: 0;
  object-fit: cover;height: 100%;width: 100%;
  z-index: 1;
  position: absolute;
  opacity: 0.06;
}

.square1 .cta-container{position: relative;z-index: 4;}

/* ! Square2 */
.square2{overflow: hidden;}
.square2 h2{
  font-size: 2.4rem;
  letter-spacing: 0px;
}
.square2 p{
  max-width: 550px;
}

.square2 .square-uniA{
  z-index: 3;
}

.square2 .img-container{
  height: 67%;width: 100%;
  display: flex;justify-content: center;align-items: flex-end;
  padding: 0;
  margin: auto 0 0 0;
}
.square2 .img-container img{
  height: 125%;object-fit: contain;
  transform: translateY(20%);
}

/* ! Square3 */
.square3{
  background-color: var(--blue-deep);
}
.square3 .square-uniA{z-index: 3;}
.square3-bg{
  height: 100%;width: 100%;
  top: 0;left: 0;
  position: absolute;z-index: 0;
  object-fit: cover;
  opacity: 0.4;
}
.square3 h2, p{position: relative;z-index: 2;}
.square3 .img-container{
  height: 65%;width: 100%;
  display: flex;justify-content: center;align-items: center;
  padding: 10px 0px 0px 0px;
  margin: auto 0 0 0;
  position: relative;z-index: 2;
}
.square3 .img-container img{
  height: 90%;object-fit: contain;
}

.square3 .cta-light{
  z-index: 4;position: relative;
}

.square3 h2{margin-bottom: 10px;color: var(--white-premium);}
.square3 p{color: var(--gray-light);}
.square3 p{max-width: 500px;}
.square3 .grid{
  z-index: 1;
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.077) 1px, transparent 1px);
  background-size: 52px 52px;
  animation: gridpulse 4.5s ease-in-out infinite;
}

@keyframes gridpulse {
  0%, 100% { opacity: .2; }
  50%       { opacity: 1; }
}

/* ! Square 4 */
.square4{position: relative;}
.square4-bg{
  position: absolute;z-index: 0;
  top: 0;left: 0;object-fit: cover;
  height: 100%;width: 100%;
  opacity: 0.6;
  transform: rotate(180deg);
}
.square h2,p{position: relative;z-index: 1;}
.square4 .cta{position: relative;z-index: 4;}

.square4 h2{
  /* Definiamo il gradiente dall'alto verso il basso */
    background: linear-gradient(to bottom, var(--success-trust) 20%, #3db618 100%);
    
    /* Applichiamo il gradiente solo al testo */
    -webkit-background-clip: text;
    background-clip: text;
    
    /* Rendiamo il testo trasparente per mostrare il gradiente sotto */
    -webkit-text-fill-color: transparent;
}
.square4 p{color: var(--black-soft);}

.square4 .img-container{
  position: relative;z-index: 1;
  margin-top: auto;
  width: 100%;height: 65%;
  display: flex;justify-content: center;align-items: flex-end;
}
.square4 .img-container img{
  height: 100%;
}

.square4 .cta {
  background-color:  #16A34A;
  color: var(--white-premium);
}

.square4 .cta:hover {
  background-color:  #16aa4c;
}

/* ── SLIDER ── */
.slider {
  margin: 20px 0px 40px 0px;
  width: 100%;
  height: var(--height);
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 20% 80%, transparent);
  position: relative;
  z-index: 3;
}

.slider .list {
  display: flex;
  width: 100%;
  min-width: calc(var(--width) * var(--quantity));
  position: relative;
}

.slider .list .item {
  width: var(--width);
  height: var(--height);
  position: absolute;
  left: 100%;
  animation: autoRun 40s linear infinite;
  transition: filter 0.5s;
  animation-delay: calc((40s / var(--quantity)) * (var(--position) - 1) - 40s) !important;
  border-radius: 25px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

@supports (corner-shape: squircle) {
  .slider .list .item {
    border-radius: 50px;
    corner-shape: squircle;
  }
}

.slider .list .item img {
  width: 100%;
  border-radius: 25px;
}

@keyframes autoRun {
  from { left: 100%; }
  to   { left: calc(var(--width) * -1); }
}

.slider:hover .item {
  animation-play-state: paused !important;
  filter: grayscale(1) opacity(0.5);
}

.slider .item:hover {
  filter: grayscale(0) opacity(1);
}

.slider[reverse="true"] .item {
  animation: reversePlay 20s linear infinite;
}

@keyframes reversePlay {
  from { left: calc(var(--width) * -1); }
  to   { left: 100%; }
}

/* ── CARD INTERNALS ── */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e8e4dc;
  overflow: hidden;
  border: 2px solid #e0dcd4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Placeholder con iniziale */
.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d4c9b8, #b8a898);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.2;
}

.stars {
  display: flex;
  gap: 2px;
}

.stars span {
  color: #f5a623;
  font-size: 0.85rem;
}

.card-text{
  color: #555;
  line-height: 1.40;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  font-size: 11px;
}

.card-source {
  text-align: center;
  font-size: 0.68rem;
  color: #aaa;
  letter-spacing: 0.02em;
  border-top: 1px solid #f0ece6;
  padding-top: 8px;
  margin-top: auto;
}

/* Second row (reverse) */
.slider + .slider {
  margin-top: 0;
}

@media (max-width: 768px) {
.slider .list .item {
  width: var(--width);
  height: var(--height);
  position: absolute;
  left: 100%;
  animation: autoRun 55s linear infinite;
  animation-delay: calc((55s / var(--quantity)) * (var(--position) - 1) - 55s) !important;
}
.slider{
  mask-image: linear-gradient(to right, transparent, #000 7% 93%, transparent);
}
}

@media (max-width: 1200px) {
  .square1 p{max-width: 350px;}
  .square1 .img-container img{height: 95%;}

  .square2 p{max-width: 300px;}
  .square2 .img-container img{
    height: 108%;transform: translateY(12%);
  }

  .square3 h2{margin-bottom: 5px;}
  .square3 p{max-width: 350px;}

  .square4 h2{font-size: 2.2rem;}
  .square4 p{max-width: 350px;}
}
@media (min-width: 768px) {
  .square3-imgcontainerPC{
    display: block;
  }
  .square3-imgcontainerMobile{
    display: none;
  }
}
@media (max-width: 768px) {
  .square3-imgcontainerPC{
    display: none;
  }
  .square3-imgcontainerMobile{
    display: block;
  }
}
