/* --- Reset & Base --- */
:root {
  --bg-dark: #0a0a0c;
  --text-light: #f8fafc;
  --accent-primary: #7c3aed;
  --accent-secondary: #2dd4bf;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-main: "Inter", sans-serif;
  --font-heading: "Space Grotesk", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Aurora Effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(124, 58, 237, 0.15) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(45, 212, 191, 0.1) 0%,
      transparent 40%
    );
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 0;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.header__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
}

.header__logo-img {
  width: 32px;
  height: 32px;
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__link {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.8;
}

.header__link:hover {
  opacity: 1;
  color: var(--accent-secondary);
}

.header__cta {
  background: var(--text-light);
  color: var(--bg-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
}

.header__cta:hover {
  transform: scale(1.05);
  background: var(--accent-secondary);
}

.header__burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.header__burger span {
  width: 25px;
  height: 2px;
  background: var(--text-light);
  transition: 0.3s;
}

/* --- Footer --- */
.footer {
  background: rgba(0, 0, 0, 0.5);
  padding: 5rem 0 2rem;
  margin-top: 100px;
  border-top: 1px solid var(--glass-border);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer__logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  display: block;
  margin-bottom: 1rem;
}

.footer__tagline {
  opacity: 0.6;
  font-size: 0.95rem;
}

.footer__title {
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.footer__list li {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

.footer__list a:hover {
  opacity: 1;
  color: var(--accent-secondary);
  padding-left: 5px;
}

.footer__bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.5;
}

/* --- Mobile Responsive --- */
@media (max-width: 992px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header__menu {
    display: none; /* Inserire logica mobile js */
  }
  .header__burger {
    display: flex;
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.4;
  pointer-events: none;
}

.hero__container {
  position: relative;
  z-index: 1;
}

.hero__bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 1.5rem;
}

/* Bento Cards Styling */
.hero__main-card,
.hero__stats-card,
.hero__info-card {
  background: var(--glass);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  transition: transform 0.4s ease;
}

.hero__main-card {
  grid-column: span 3;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__stats-card {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.1),
    rgba(45, 212, 191, 0.1)
  );
}

.hero__info-card {
  grid-column: span 1;
  padding: 2rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Typography in Hero */
.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent-secondary);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.text-gradient {
  background: linear-gradient(to right, var(--accent-secondary), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: 1.2rem;
  max-width: 600px;
  margin-bottom: 2.5rem;
  opacity: 0.8;
}

.highlight {
  color: var(--accent-secondary);
  font-weight: 600;
}

/* Buttons */
.hero__actions {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 1.2rem 2.5rem;
  border-radius: 16px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  display: inline-block;
}

.btn--primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.btn--primary:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(124, 58, 237, 0.4);
}

.btn--secondary {
  border: 1px solid var(--glass-border);
  color: white;
}

.btn--secondary:hover {
  background: var(--glass);
  transform: translateY(-5px);
}

.hero__icon {
  color: var(--accent-secondary);
  margin-bottom: 1rem;
}

.hero__stat-val {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

.hero__check-list {
  margin-top: 1rem;
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Mobile Adaptive for Hero */
@media (max-width: 992px) {
  .hero__bento-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero__main-card {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .hero__bento-grid {
    grid-template-columns: 1fr;
  }
  .hero__main-card,
  .hero__stats-card,
  .hero__info-card {
    grid-column: span 1;
  }
  .hero__actions {
    flex-direction: column;
  }
}

/* --- Vision Section (Editorial Style) --- */
.vision {
  padding: 100px 0;
  border-top: 1px solid var(--glass-border);
}

.vision__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 4rem;
}

.vision__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  max-width: 600px;
}

.vision__line {
  height: 1px;
  background: var(--accent-secondary);
  flex-grow: 1;
  margin-left: 3rem;
  margin-bottom: 1rem;
}

.vision__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.vision__text .lead {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-light);
}

.vision__text p {
  opacity: 0.7;
  margin-bottom: 1.5rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}

.link-arrow:hover {
  border-bottom: 1px solid var(--accent-secondary);
}

.vision__img {
  width: 100%;
  border-radius: 4px;
  filter: grayscale(1) contrast(1.2);
  transition: 0.5s ease;
}

.vision__img:hover {
  filter: grayscale(0);
}

/* --- Pratiche Section (Bento Grid) --- */
.pratiche {
  padding: 100px 0;
  background: rgba(255, 255, 255, 0.02);
}

.section-intro {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  margin-top: 1rem;
}

.pratiche__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 250px;
  gap: 1.5rem;
}

.pratiche__item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: 0.3s ease;
}

.pratiche__item:hover {
  background: rgba(124, 58, 237, 0.05);
  border-color: var(--accent-primary);
  transform: translateY(-5px);
}

.pratiche__item i {
  color: var(--accent-secondary);
  margin-bottom: auto;
}

.pratiche__item h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
}

.pratiche__item p {
  font-size: 0.9rem;
  opacity: 0.6;
}

.bento-large {
  grid-column: span 2;
  grid-row: span 1;
}

.icon-lg {
  width: 48px;
  height: 48px;
}

/* --- Mobile Adaptive --- */
@media (max-width: 992px) {
  .vision__content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .vision__line {
    display: none;
  }
  .pratiche__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .pratiche__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .bento-large {
    grid-column: span 1;
  }
}

/* --- Vantaggi (Tech Style) --- */
.vantaggi {
  padding: 100px 0;
  background: linear-gradient(to bottom, transparent, rgba(124, 58, 237, 0.05));
}

.tech-label {
  font-family: monospace;
  color: var(--accent-secondary);
  letter-spacing: 2px;
  font-size: 0.8rem;
}

.vantaggi__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

.vantaggi__card {
  position: relative;
  padding: 3rem 2rem;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  overflow: hidden;
}

.tech-plus {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--accent-secondary);
  font-family: monospace;
  opacity: 0.5;
}

.card-num {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--accent-secondary);
  border: 1px solid var(--accent-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 2rem;
  display: inline-block;
}

.vantaggi__card h3 {
  margin-bottom: 1rem;
  font-family: var(--font-heading);
}

.vantaggi__card p {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* --- FAQ (Accordion) --- */
.faq {
  padding: 100px 0;
}

.faq__container {
  max-width: 800px;
  margin: 0 auto;
}

.faq__title {
  text-align: center;
  margin-bottom: 3rem;
  font-family: var(--font-heading);
  font-size: 2.5rem;
}

.accordion__item {
  border-bottom: 1px solid var(--glass-border);
}

.accordion__header {
  width: 100%;
  padding: 1.5rem 0;
  background: none;
  border: none;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  text-align: left;
  transition: 0.3s;
}

.accordion__header:hover {
  color: var(--accent-secondary);
}

.accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
  opacity: 0.7;
  font-size: 0.95rem;
}

.accordion__item.active .accordion__content {
  max-height: 200px;
  padding-bottom: 1.5rem;
  transition: max-height 0.4s ease-in;
}

.accordion__item.active i {
  transform: rotate(45deg);
  color: var(--accent-secondary);
}

/* Adaptive */
@media (max-width: 992px) {
  .vantaggi__cards {
    grid-template-columns: 1fr;
  }
}

/* --- Contact Section --- */
.contact {
  padding: 100px 0;
  position: relative;
}

.contact__wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 4rem;
  border-radius: 40px;
}

.contact__info h2 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.contact__details {
  margin-top: 3rem;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--accent-secondary);
}

/* Form Styles */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form__group {
  position: relative;
}

.contact__form input {
  width: 100%;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: white;
  font-family: inherit;
  transition: 0.3s;
}

.contact__form input:focus {
  outline: none;
  border-color: var(--accent-secondary);
  background: rgba(255, 255, 255, 0.08);
}

.error-msg {
  color: #ff4d4d;
  font-size: 0.75rem;
  margin-top: 5px;
  display: none;
}

/* Captcha & Checkbox Styles */
.form__captcha,
.form__privacy {
  margin: 5px 0;
}

.captcha__checkbox,
.privacy__checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.8;
}

.captcha__checkbox input,
.privacy__checkbox input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}

.captcha__checkbox input:checked + .checkmark,
.privacy__checkbox input:checked + .checkmark {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.captcha__checkbox input:checked + .checkmark:after,
.privacy__checkbox input:checked + .checkmark:after {
  display: block;
}

.btn--full {
  width: 100%;
}

.form-status {
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
  display: none;
  font-weight: 600;
}

.form-status.success {
  display: block;
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent-secondary);
}

.form-status.error {
  display: block;
  background: rgba(255, 77, 77, 0.1);
  color: #ff4d4d;
}

@media (max-width: 992px) {
  .contact__wrapper {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
}

/* --- Cookie Popup --- */
.cookie-popup {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  max-width: 400px;
  background: var(--bg-dark);
  border: 1px solid var(--accent-secondary);
  padding: 1.5rem;
  border-radius: 20px;
  z-index: 2000;
  display: none; /* Gestito via JS */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.cookie-popup__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-popup p {
  font-size: 0.85rem;
  flex: 1;
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* --- Styles per Pagine Legali (.pages) --- */
.pages {
  padding: 150px 0 100px;
  line-height: 1.8;
}

.pages h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  margin-bottom: 2rem;
  color: var(--accent-secondary);
}

.pages h2 {
  font-family: var(--font-heading);
  margin: 2.5rem 0 1rem;
}

.pages p {
  margin-bottom: 1.2rem;
  opacity: 0.8;
}

.pages ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.pages li {
  list-style: disc;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.pages a {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* --- Contact Page Cards --- */
.contact-card {
  background: var(--glass);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  transition: border-color 0.3s ease;
}

.contact-card:hover {
  border-color: var(--accent-secondary);
}

.contact-card h3 {
  color: var(--accent-secondary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
}

.contact-card p {
  margin-bottom: 0;
  font-weight: 500;
}
