@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg-color: #050505;
  --surface-color: rgba(255, 255, 255, 0.03);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text-main: #ffffff;
  --text-muted: #888888;
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --accent-color: #8b5cf6;
  --font-family: 'Outfit', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --navbar-height: 88px;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.3;
  word-wrap: break-word;
}

h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

h4 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin-bottom: 2rem;
}

/* Buttons & Links */
a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--surface-border);
}

.btn-outline:hover {
  background: var(--surface-color);
  border-color: var(--text-muted);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 8rem 0;
  position: relative;
}

/* ============================
   Navbar
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 1000;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
}

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

.nav-logo img {
  height: 40px;
  width: auto;
  /* Rende bianco il logo anche se nero */
  filter: brightness(0) invert(1);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--text-main);
}

/* ============================
   Hero Section
   ============================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--navbar-height);
  background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, rgba(5, 5, 5, 1) 50%);
}

.hero-title {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #fff, #a0a0a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  margin: 0 auto 3rem auto;
  font-size: 1.25rem;
}

/* ============================
   Grid Layouts
   ============================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* ============================
   Info section alignment (desktop)
   ============================ */
#info .grid-2 {
  align-items: start;
}

#info h4 {
  margin-top: 0;
}

#info .info-detail h4 {
  margin-top: 1.5rem;
}

#info .info-detail h4:first-child {
  margin-top: 0;
}

/* ============================
   Events Cards
   ============================ */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.event-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition);
}

.event-card:hover {
  transform: translateY(-5px);
  border-color: var(--text-muted);
}

.event-image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.event-info {
  padding: 1.5rem;
  text-align: center;
}

/* ============================
   Image blocks
   ============================ */
.image-block {
  border-radius: 20px;
  width: 100%;
  height: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  border: 1px solid var(--surface-border);
}

/* ============================
   Partners
   ============================ */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 3rem;
  margin-top: 3rem;
  align-items: center;
  justify-items: center;
}

.partners-grid img {
  /* dimensione fissa uguale per tutti */
  width: 120px;
  height: 60px;
  object-fit: contain;
  /* Rende bianchi i loghi neri */
  filter: brightness(0) invert(1);
  opacity: 0.6;
  transition: var(--transition);
}

.partners-grid img:hover {
  opacity: 1;
}

/* ============================
   Footer
   ============================ */
footer {
  padding: 4rem 0;
  border-top: 1px solid var(--surface-border);
  text-align: center;
}

/* Logo in footer: bianco */
footer img {
  filter: brightness(0) invert(1);
}

.footer-links {
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--text-main);
}

/* ============================
   Forms (login, register, etc.)
   ============================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
  /* Remove system appearance for custom styling */
  appearance: none;
  -webkit-appearance: none;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  background-color: var(--surface-color);
  padding-right: 3rem;
  cursor: pointer;
}

select.form-control option {
  background-color: #1a1a1a;
  color: var(--text-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255,255,255,0.05);
}

/* Form row: two inputs side by side on desktop */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-control {
  flex: 1;
  min-width: 0;
}

/* Consent checkboxes */
.consent-group {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  line-height: 1.5;
}

.consent-label:last-child { margin-bottom: 0; }

.consent-checkbox {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Auth page bottom links (login, register) */
.auth-links {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  gap: 1rem;
}

/* Pagine con hero a due colonne (login, register, ecc.)
   Garantisce che il contenuto non finisca MAI sotto la navbar fissa */
.page-with-navbar {
  padding-top: calc(var(--navbar-height) + 5rem);
  padding-bottom: 4rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

/* ============================
   Cookie Banner
   ============================ */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--surface-border);
  padding: 1.5rem 2rem;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.5s ease-out;
}

#cookie-banner.show {
  transform: translateY(0);
}

.cookie-content {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 800px;
}

.cookie-content a {
  color: var(--primary-color);
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* ============================
   Responsive — Tablet (≤ 992px)
   ============================ */
@media (max-width: 992px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .grid-2 p {
    margin: 0 auto 2rem auto;
  }

  .grid-2 .btn {
    display: block;
    width: fit-content;
    margin: 0 auto;
  }

  .nav-links {
    display: none;
  }

  h2 {
    font-size: 2.5rem;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .partners-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem 2rem;
  }
}

/* ============================
   Responsive — Mobile (≤ 600px)
   ============================ */
@media (max-width: 600px) {
  h2 {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  section {
    padding: 5rem 0;
  }

  /* Tutte le pagine con navbar fissa: contenuto non sovrapposto */
  .page-with-navbar {
    padding-top: calc(var(--navbar-height) + 3rem);
    align-items: flex-start;
  }

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

  .partners-grid img {
    width: 90px;
    height: 50px;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  /* Cookie banner verticale su mobile */
  #cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-buttons {
    width: 100%;
  }

  .cookie-buttons .btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }

  /* Mobile: stack form-row (nome+cognome, password+conferma) */
  .form-row {
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Login / Register: bottom auth links stack vertically */
  .auth-links {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .auth-links div {
    text-align: center !important;
  }

  .nav-btn-desktop {
    display: none !important;
  }
}
