/* =============================================
   MEDITERRANEO BLU — Custom CSS
   ============================================= */

/* Google Fonts: Raleway + Lato */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700;800&family=Lato:wght@300;400;700&display=swap');

/* =============================================
   CSS Variables
   ============================================= */
:root {
  --primary-color: #1B4F72;
  --secondary-color: #1A8FBF;
  --accent-color: #00B4CC;
  --primary-dark: #0D2137;
  --text-dark: #2C3E50;
  --text-light: #fff;
  --text-muted: #6c757d;
  --bg-light: #F7F9FB;
  --bg-dark: #0D2137;
  --transition: 0.3s ease;
  --border-radius: 10px;
  --shadow: 0 8px 30px rgba(27, 79, 114, 0.12);
  --shadow-hover: 0 16px 50px rgba(27, 79, 114, 0.22);
}

/* =============================================
   Base
   ============================================= */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', sans-serif;
  color: var(--text-dark);
  font-size: 16px;
  line-height: 1.75;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  color: var(--primary-dark);
}

a {
  color: var(--secondary-color);
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-color);
}

img {
  max-width: 100%;
  height: auto;
}

/* =============================================
   Navbar
   ============================================= */
#mainNavbar {
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
  padding: 1.25rem 0;
}

#mainNavbar.scrolled {
  background: var(--primary-dark) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  padding: 0.6rem 0;
}

#mainNavbar .navbar-brand img {
  height: 52px;
  width: auto;
  transition: height var(--transition);
}

#mainNavbar.scrolled .navbar-brand img {
  height: 42px;
}

#mainNavbar .navbar-toggler {
  border-color: rgba(255,255,255,0.5);
}

#mainNavbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

#mainNavbar .nav-link {
  color: rgba(255,255,255,0.9) !important;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color var(--transition);
}

#mainNavbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: center;
}

#mainNavbar .nav-link:hover,
#mainNavbar .nav-link.active {
  color: var(--accent-color) !important;
}

#mainNavbar .nav-link:hover::after,
#mainNavbar .nav-link.active::after {
  transform: scaleX(1);
}

/* Collapse on mobile */
@media (max-width: 991.98px) {
  #mainNavbar.scrolled,
  #mainNavbar .navbar-collapse.show,
  #mainNavbar .navbar-collapse.collapsing {
    background: var(--primary-dark) !important;
  }
  #mainNavbar .navbar-collapse {
    background: var(--primary-dark);
    padding: 1rem;
    border-radius: 0 0 12px 12px;
  }
}

/* =============================================
   Hero
   ============================================= */
#home {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #001f3f;
  overflow: hidden;
}

.hero-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(13, 33, 55, 0.82) 0%,
    rgba(27, 79, 114, 0.68) 50%,
    rgba(0, 180, 204, 0.30) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1rem;
}

.hero-logo {
  width: 90%;
  height: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.4));
  animation: fadeInDown 0.9s ease both;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
  animation: fadeInUp 1s ease 0.2s both;
}

.hero-content p {
  color: rgba(255,255,255,0.88);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 300;
  max-width: 620px;
  margin: 0 auto 2rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
  animation: fadeInUp 1s ease 0.4s both;
}

.hero-actions {
  animation: fadeInUp 1s ease 0.6s both;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  box-shadow: 0 6px 20px rgba(0,180,204,0.4);
  text-decoration: none;
}

.btn-hero-primary:hover {
  background: #009db3;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,180,204,0.5);
}

.btn-hero-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.7);
  padding: 0.82rem 2.2rem;
  border-radius: 50px;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-hero-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  color: #fff;
  transform: translateY(-2px);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.hero-scroll-indicator a {
  color: rgba(255,255,255,0.7);
  font-size: 1.5rem;
  text-decoration: none;
  transition: color var(--transition);
}

.hero-scroll-indicator a:hover {
  color: var(--accent-color);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* =============================================
   Section Commons
   ============================================= */
.section-padding {
  padding: 90px 0;
}

.section-padding-sm {
  padding: 60px 0;
}

.section-label {
  display: inline-block;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.section-divider {
  width: 52px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.section-divider.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
}

/* =============================================
   Chi Siamo
   ============================================= */
#chi-siamo {
  background: var(--bg-light);
}

.chi-siamo-text p {
  color: var(--text-dark);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.98rem;
  color: var(--text-dark);
}

.feature-list li .feature-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  margin-top: 2px;
}

.partner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, rgba(27,79,114,0.07), rgba(0,180,204,0.07));
  border: 1px solid rgba(0,180,204,0.25);
  border-radius: 50px;
  padding: 0.55rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition);
  margin-top: 1.5rem;
}

.partner-badge:hover {
  background: linear-gradient(135deg, rgba(27,79,114,0.14), rgba(0,180,204,0.14));
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.chi-siamo-visual {
  position: relative;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  border-top: 3px solid var(--accent-color);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stat-card .stat-number {
  font-family: 'Raleway', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =============================================
   Servizi
   ============================================= */
#servizi {
  background: #fff;
}

.service-card {
  background: #fff;
  border: 1px solid rgba(27,79,114,0.1);
  border-radius: 14px;
  padding: 2rem 1.75rem;
  height: 100%;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: left;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0,180,204,0.2);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon-wrap {
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, rgba(27,79,114,0.1), rgba(0,180,204,0.15));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: all var(--transition);
}

.service-icon-wrap i {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: color var(--transition);
}

.service-card:hover .service-icon-wrap {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.service-card:hover .service-icon-wrap i {
  color: #fff;
}

.service-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

.service-card p {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  margin-top: 1rem;
  transition: gap var(--transition);
}

.service-link:hover {
  gap: 0.7rem;
  color: var(--primary-color);
}

/* H24 card highlight */
.service-card.h24-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  border-color: transparent;
  color: #fff;
}

.service-card.h24-card::before {
  display: none;
}

.service-card.h24-card h4,
.service-card.h24-card p {
  color: #fff;
}

.service-card.h24-card p {
  color: rgba(255,255,255,0.8);
}

.service-card.h24-card .service-icon-wrap {
  background: rgba(255,255,255,0.15);
}

.service-card.h24-card .service-icon-wrap i {
  color: var(--accent-color);
}

.service-card.h24-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 50px rgba(13,33,55,0.4);
}

.service-card.h24-card .service-link {
  color: var(--accent-color);
}

/* =============================================
   Contatti
   ============================================= */
#contatti {
  background: var(--bg-light);
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon-wrap {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

.contact-info-item h6 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.contact-info-item p,
.contact-info-item a {
  font-size: 0.98rem;
  color: var(--text-dark);
  margin: 0;
  text-decoration: none;
  transition: color var(--transition);
}

.contact-info-item a:hover {
  color: var(--accent-color);
}

.map-wrapper {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}

.map-wrapper iframe {
  width: 100%;
  height: 240px;
  border: none;
  display: block;
}

/* Contact Form */
.contact-form-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.contact-form-card .form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--primary-dark);
  margin-bottom: 0.4rem;
}

.contact-form-card .form-control,
.contact-form-card .form-select {
  border: 1.5px solid #e0e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--text-dark);
}

.contact-form-card .form-control:focus,
.contact-form-card .form-select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(26,143,191,0.18);
  outline: none;
}

.contact-form-card textarea.form-control {
  min-height: 130px;
  resize: vertical;
}

.btn-submit {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border: none;
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  transition: all var(--transition);
  width: 100%;
  letter-spacing: 0.3px;
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(27,79,114,0.35);
}

.btn-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

/* Form validation */
.form-control.is-invalid,
.form-check-input.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-check-input.is-invalid ~ .form-check-label {
  color: #dc3545;
}

/* =============================================
   Footer
   ============================================= */
#footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.8);
  padding: 70px 0 0;
}

#footer h5 {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#footer p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.75;
}

.footer-logo {
  max-height: 60px;
  width: auto;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.55rem;
}

.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color var(--transition), padding-left var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a::before {
  content: '›';
  color: var(--accent-color);
  font-size: 1rem;
}

.footer-links a:hover {
  color: var(--accent-color);
  padding-left: 4px;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.footer-contact-item i {
  color: var(--accent-color);
  font-size: 0.95rem;
  margin-top: 3px;
  flex-shrink: 0;
}

.footer-contact-item span,
.footer-contact-item a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-contact-item a:hover {
  color: var(--accent-color);
}

.footer-partner-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition);
  padding: 0.4rem 0;
}

.footer-partner-link:hover {
  color: #fff;
  gap: 0.8rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 3rem;
  padding: 1.25rem 0;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color var(--transition);
  margin: 0 0.25rem;
}

.footer-bottom a:hover {
  color: var(--accent-color);
}

/* =============================================
   Buttons (general)
   ============================================= */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border: none;
  padding: 0.7rem 2rem;
  border-radius: 50px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(27,79,114,0.3);
}

.btn-outline-primary-custom {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
}

.btn-outline-primary-custom:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(27,79,114,0.2);
}

/* =============================================
   Animation helpers
   ============================================= */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.65s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* Stagger for children */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.5s; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 767.98px) {
  .section-padding {
    padding: 60px 0;
  }

  .hero-logo {
    width: 90%;
  }

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

  .contact-form-card {
    padding: 1.5rem;
  }

  #footer {
    padding: 50px 0 0;
  }

  .footer-bottom {
    text-align: center;
  }
}

@media (max-width: 575.98px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-hero-primary,
  .btn-hero-outline {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

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

/* =============================================
   Utilities
   ============================================= */
.text-accent { color: var(--accent-color) !important; }
.text-primary-custom { color: var(--primary-color) !important; }
.bg-primary-custom { background-color: var(--primary-color) !important; }
.bg-accent { background-color: var(--accent-color) !important; }

.wave-divider {
  line-height: 0;
  overflow: hidden;
}

.wave-divider svg {
  display: block;
  width: 100%;
}
