/* ═══════════════════════════════════════════════════════════════
   VIVI IN CAMPUS — Export Statico
   Collegi e Residenze Universita Cattolica del Sacro Cuore
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  --blu-navy: #002F56;
  --blu-notte: #00041C;
  --blu-istituzionale: #003057;
  --blu-sportivo: #00609D;
  --grigio: #4A4A4A;
  --celeste: #D0DDEB;
  --giallo: #F3BB02;
  --rosso-toniolo: #C14048;
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Roboto', sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--grigio);
  background: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--blu-navy);
}

h1 { font-size: 90px; line-height: 100px; }
h2 { font-size: 70px; line-height: 80px; }
h3 { font-size: 50px; line-height: 60px; }
h4 { font-size: 40px; line-height: 45px; }
h5 { font-size: 30px; line-height: 40px; }
h6 { font-size: 20px; line-height: 30px; }

p { font-size: 20px; line-height: 33px; }

/* ═══════════════════════════════════════════════════════════════
   HERO — Fullscreen video + Mask CAMPUS
   ═══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  height: 600vh;
}

.hero__viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-x: clip;
  overflow-y: hidden;
}

/* Phase 3 white background */
.hero__phase3-bg {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  z-index: 2;
}

/* Video wrapper — starts fullscreen, shrinks to card */
.hero__video-wrap {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 0;
  z-index: 5;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.hero__video-wrap video {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* White mask overlay (CAMPUS cutout) */
.hero__mask {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hero__mask-img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Phase 2: Dark overlay */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(0,0,0,0.35);
  opacity: 0;
}

/* Phase 2: Hero text */
.phase2 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  z-index: 20;
  opacity: 0;
  transform: translateY(60px);
}

.phase2__content {
  padding: 24px 32px 64px;
  max-width: 900px;
}

.phase2__title {
  font-family: var(--font-heading);
  text-transform: uppercase;
  color: #fff;
  font-size: clamp(36px, 6vw, 70px);
  line-height: 1.05;
  margin-bottom: 24px;
}

.phase2__subtitle {
  color: rgba(255,255,255,0.8);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 40px;
}

.phase2__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Scroll hint indicator */
.hero__scroll-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__scroll-hint span {
  font-family: var(--font-heading);
  text-transform: uppercase;
  color: #fff;
  font-size: 12px;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.hero__scroll-hint svg {
  animation: bounce-hint 2s ease-in-out infinite;
}

@keyframes bounce-hint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Phase 3: Cards + text container */
.hero__phase3 {
  position: absolute;
  inset: 0;
  z-index: 7;
}

/* Photo cards grid (organic layout) */
.hero__card {
  position: absolute;
  overflow: hidden;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.8);
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  z-index: 4;
}

.hero__card img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Phase 3 central text */
.hero__phase3-text {
  position: absolute;
  z-index: 10;
  top: 40%;
  left: 50%;
  transform: translate(-50%, 0) translateY(30px);
  width: 100%;
  max-width: 480px;
  padding: 0 24px;
  text-align: center;
  opacity: 0;
}

.hero__phase3-text .label {
  text-transform: uppercase;
  font-family: var(--font-body);
  color: #888;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.hero__phase3-text h2 {
  font-size: clamp(20px, 3vw, 36px);
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero__phase3-text p {
  color: var(--grigio);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.7;
  margin-bottom: 16px;
}

.hero__phase3-text h3 {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.2;
  margin-top: 20px;
}

/* Video card parallax wrapper */
.hero__video-card {
  position: absolute;
  z-index: 3;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  padding: 16px 32px;
  border-radius: 50px;
  text-align: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background: #fff;
  color: var(--blu-navy);
  border-color: #fff;
}
.btn--primary:hover {
  background: #f0f0f0;
}

.btn--secondary {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.btn--secondary:hover {
  background: rgba(255,255,255,0.1);
}

.btn--submit {
  width: 100%;
  background: var(--rosso-toniolo);
  color: #fff;
  border-color: var(--rosso-toniolo);
  font-size: 18px;
}
.btn--submit:hover {
  background: #a5333a;
  border-color: #a5333a;
}
.btn--submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   TEMI — 5 blocchi tematici (scroll-pinned)
   ═══════════════════════════════════════════════════════════════ */
.temi {
  position: relative;
}

.temi__viewport {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Each tema panel fills the viewport */
.tema {
  position: absolute;
  inset: 0;
}

/* Block 1: fullscreen image with text overlay */
.tema:first-child {
  display: block;
}

.tema:first-child .tema__image {
  position: absolute;
  inset: 0;
}

.tema:first-child .tema__image img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.tema:first-child .tema__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.tema:first-child .tema__overlay {
  position: absolute;
  bottom: 0; left: 0;
  padding: 48px;
  max-width: 600px;
  z-index: 2;
  width: auto; height: auto;
  display: block;
}

/* Blocks 2-5: split panels */
.tema--split {
  display: flex;
  flex-direction: row;
}

.tema--reverse {
  flex-direction: row-reverse;
}

.tema__color-panel {
  width: 50%; height: 100%;
  display: flex;
  align-items: center;
  padding: 48px 60px;
  flex-shrink: 0;
}

.tema__image-panel {
  width: 50%; height: 100%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.tema__image-panel img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.tema__headline {
  color: #fff;
  font-size: clamp(24px, 3.5vw, 44px);
  line-height: 1.1;
  margin-bottom: 20px;
}

.tema:first-child .tema__headline {
  font-size: clamp(28px, 5vw, 56px);
}

.tema__testo {
  color: rgba(255,255,255,0.75);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.7;
  max-width: 440px;
}

.tema:first-child .tema__testo {
  color: rgba(255,255,255,0.8);
  max-width: 520px;
}

/* ═══════════════════════════════════════════════════════════════
   SEDI — Grid di 5 citta
   ═══════════════════════════════════════════════════════════════ */
.sedi {
  background: #fff;
  padding: 96px 24px;
  position: relative;
  z-index: 10;
}

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

.sedi__title {
  text-align: center;
  margin-bottom: 64px;
}

.sedi__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.sede-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s;
}

.sede-card:hover {
  transform: scale(1.02);
}

.sede-card__image {
  aspect-ratio: 4/3;
  background: rgba(0,96,157,0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sede-card__image img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.sede-card__body {
  padding: 24px;
}

.sede-card__body h4 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.sede-card__body p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--grigio);
}

.sede-card__link {
  display: inline-block;
  margin-top: 16px;
  color: var(--blu-sportivo);
  font-weight: 500;
  font-size: 15px;
}

.sede-card:hover .sede-card__link {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   VIDEO STUDENTI
   ═══════════════════════════════════════════════════════════════ */
.video-section {
  background: var(--blu-navy);
  padding: 96px 24px;
  position: relative;
  z-index: 10;
}

.video-section__inner {
  max-width: 960px;
  margin: 0 auto;
}

.video-section__title {
  color: #fff;
  text-align: center;
  font-size: clamp(28px, 5vw, 52px);
  margin-bottom: 12px;
}

.video-section__subtitle {
  color: rgba(255,255,255,0.65);
  text-align: center;
  font-size: clamp(16px, 2vw, 20px);
  margin-bottom: 48px;
}

.video-section__player {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.video-section__player video,
.video-section__player iframe {
  width: 100%; height: 100%;
  object-fit: cover;
  border: none;
}

/* Placeholder when no video is set */
.video-section__placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
}

.video-section__placeholder svg { margin-bottom: 16px; }
.video-section__placeholder span {
  color: rgba(255,255,255,0.4);
  font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   FORM CONTATTI
   ═══════════════════════════════════════════════════════════════ */
.form-section {
  background: #fff;
  padding: 96px 24px;
  position: relative;
  z-index: 10;
}

.form-section__inner {
  max-width: 640px;
  margin: 0 auto;
}

.form-section__title {
  text-align: center;
  margin-bottom: 16px;
}

.form-section__subtitle {
  text-align: center;
  color: var(--grigio);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 48px;
}

.form {
  position: relative;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form__field {
  margin-bottom: 20px;
}

.form__field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--blu-navy);
  margin-bottom: 4px;
}

.form__field input,
.form__field select,
.form__field textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: var(--font-body);
  font-size: 16px;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
  border-color: var(--blu-sportivo);
  box-shadow: 0 0 0 3px rgba(0,96,157,0.2);
}

.form__privacy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 24px;
}

.form__privacy input[type="checkbox"] {
  margin-top: 4px;
  width: 20px; height: 20px;
  flex-shrink: 0;
  accent-color: var(--blu-sportivo);
}

.form__privacy span {
  font-size: 14px;
  color: var(--grigio);
  line-height: 1.5;
}

.form__privacy a {
  color: var(--blu-sportivo);
  text-decoration: underline;
}

.form__privacy a:hover {
  color: var(--blu-navy);
}

.form__error {
  color: #c00;
  text-align: center;
  font-size: 14px;
  margin-top: 12px;
}

.form-success {
  text-align: center;
  padding: 32px;
}

.form-success h4 {
  margin-bottom: 8px;
}

.form-success p {
  color: var(--grigio);
}

.form-section__nav {
  text-align: center;
  margin-top: 32px;
  font-size: 16px;
  color: var(--grigio);
}

.form-section__nav a {
  color: var(--blu-sportivo);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  background: #fff;
  padding: 64px 24px 32px;
  position: relative;
  z-index: 10;
  border-top: 1px solid #E5E7EB;
}

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

.footer__logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
}

.footer__left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer__collab-label {
  text-transform: uppercase;
  color: #6B7280;
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.footer__collab-logos {
  display: flex;
  gap: 40px;
  align-items: center;
}

.footer__logo {
  height: auto;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer__logo:hover { opacity: 1; }

.footer__logo--sm {
  height: 80px;
  width: auto;
}

.footer__logo--lg {
  height: 120px;
  width: auto;
}

.footer hr {
  border: none;
  border-top: 1px solid #E5E7EB;
  margin-top: 40px;
  margin-bottom: 24px;
}

.footer__links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.footer__links a {
  color: #6B7280;
  font-size: 13px;
  margin-right: 24px;
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--blu-navy);
}

.footer__copy {
  text-align: center;
  color: #9CA3AF;
  font-size: 12px;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   COOKIE BANNER
   ═══════════════════════════════════════════════════════════════ */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  animation: cookieSlideUp 0.3s ease-out;
}

@keyframes cookieSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cookie-banner__container {
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.cookie-banner__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  min-width: 200px;
}

.cookie-banner__text p {
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner__links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.cookie-banner__links a {
  color: var(--blu-sportivo);
  font-size: 12px;
  text-decoration: underline;
}

.cookie-banner__links a:hover {
  text-decoration: none;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn--cookie-accept {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 32px;
  border-radius: 8px;
  background: var(--blu-navy);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn--cookie-accept:hover { background: #001f3d; }

.btn--cookie-reject {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  background: transparent;
  color: #666;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn--cookie-reject:hover { border-color: var(--blu-navy); }

.btn--cookie-prefs {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  background: transparent;
  color: var(--blu-navy);
  border: 1px solid var(--blu-navy);
  cursor: pointer;
  transition: background 0.2s;
}
.btn--cookie-prefs:hover { background: rgba(0,47,86,0.05); }

/* Preferences panel */
.cookie-prefs {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.cookie-prefs__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.cookie-prefs__label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin: 0;
}

.cookie-prefs__desc {
  font-size: 12px;
  color: #888;
  margin: 2px 0 0;
}

.cookie-prefs__save {
  margin-top: 16px;
  display: flex;
  align-items: center;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
}

.toggle--locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle__track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #ccc;
  transition: background 0.2s;
}

.toggle input:checked + .toggle__track {
  background: var(--blu-navy);
}

.toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked ~ .toggle__thumb {
  left: 22px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (max-width: 768px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Typography */
  h1 { font-size: 48px; line-height: 56px; }
  h2 { font-size: 38px; line-height: 46px; }
  h3 { font-size: 30px; line-height: 38px; }
  h4 { font-size: 26px; line-height: 32px; }
  h5 { font-size: 22px; line-height: 30px; }
  p { font-size: 16px; line-height: 30px; }

  /* Hero */
  .hero__card { display: none !important; }

  .phase2__content {
    padding: 24px 24px 48px;
  }

  .hero__phase3-text {
    top: 35%;
  }

  /* Temi */
  .tema--split {
    flex-direction: column !important;
  }

  .tema__color-panel {
    width: 100%; height: 50%;
    padding: 24px;
    order: 2;
  }

  .tema__image-panel {
    width: 100%; height: 50%;
    order: 1;
  }

  .tema:first-child .tema__overlay {
    padding: 24px;
  }

  .tema__headline {
    font-size: clamp(22px, 5vw, 32px);
  }

  .tema__testo {
    font-size: 15px;
  }

  /* Sedi */
  .sedi { padding: 64px 20px; }

  .sedi__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sedi__title { margin-bottom: 32px; }

  /* Video section */
  .video-section { padding: 64px 20px; }

  /* Form */
  .form-section { padding: 64px 20px; }

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

  /* Footer */
  .footer__logos {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer__left {
    align-items: center;
  }

  .footer__logo--sm { height: 60px; }
  .footer__logo--lg { height: 90px; }

  .footer__links {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  /* Cookie banner */
  .cookie-banner__main {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner__actions {
    justify-content: center;
  }
}

/* Tablet: 2-column sedi */
@media (min-width: 769px) and (max-width: 1024px) {
  .sedi__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large desktop padding */
@media (min-width: 1025px) {
  .phase2__content {
    padding: 24px 64px 96px;
  }

  .sedi { padding: 96px 48px; }
  .video-section { padding: 96px 48px; }
  .form-section { padding: 96px 48px; }
}
