/* Homepage specific styles */
.bfz-home {
  display: block;
  --bfz-home-blue: #0c4d98;
  --bfz-home-blue-dark: #0a3768;
  --bfz-home-blue-soft: #edf5ff;
  --bfz-home-text: #12304f;
}

.bfz-hero {
  position: relative;
  height: 100vh;
  padding: clamp(28px, 6vw, 62px) 0 64px;
  background: url("../images/prova.webp") center/cover no-repeat;
  overflow: hidden;
}

@media (min-width: 992px) {
  .bfz-hero {
    height: calc(100vh - 85px);
  }
}

@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
  .bfz-hero {
    height: calc(100vh - 85px);
  }

  .bfz-search-panel {
    padding-top: 10vh;
  }
}

.bfz-hero::before,
.bfz-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(rgba(255, 255, 255, 0));
  pointer-events: none;
}

.bfz-search-panel {
  --bfz-form-reserved-space: 292px;
  --bfz-form-height-duration: 0.46s;
  --bfz-form-fade-duration: 0.3s;
  --bfz-form-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bfz-form-shift: -10px;
  position: relative;
  z-index: 2;
  border-radius: 18px;
  padding: clamp(14px, 3vw, 22px) 0 0;
  padding-bottom: var(--bfz-form-reserved-space);
  transition: padding-bottom 0.28s ease, background-color 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.bfz-search-panel.is-form-open {
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(224, 231, 234, 0.44);
  backdrop-filter: blur(8px);
  padding: clamp(20px, 4vw, 34px);
  padding-bottom: clamp(20px, 4vw, 34px);
  box-shadow: 0 12px 36px rgba(20, 36, 53, 0.23);
}

.bfz-search-tabs {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 0;
  flex-wrap: nowrap;
}

.bfz-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  min-width: 148px;
  min-height: 52px;
  padding: 14px 24px;
  font-weight: 800;
  color: var(--bfz-blue);
  background: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(15, 37, 79, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.bfz-search-panel.is-form-open .bfz-pill {
  box-shadow: 0 2px 6px rgba(15, 37, 79, 0.08);
}

.bfz-pill:hover,
.bfz-pill:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(12, 30, 58, 0.12);
  text-decoration: none;
}

.bfz-pill.is-active {
  background: var(--bfz-blue);
  color: var(--bfz-white);
  box-shadow: 0 10px 20px rgba(15, 78, 233, 0.22);
}

.bfz-pill:active {
  transform: translateY(0) scale(0.97);
}

.bfz-search-form-shell {
  overflow: hidden;
  height: 0;
  opacity: 0;
  transform: translateY(var(--bfz-form-shift));
  transform-origin: top center;
  pointer-events: none;
  will-change: height, opacity, transform;
  transition: height var(--bfz-form-height-duration) var(--bfz-form-ease), opacity var(--bfz-form-fade-duration) ease, transform var(--bfz-form-fade-duration) ease;
}

.bfz-search-panel.is-form-open .bfz-search-form-shell {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin-top: 18px;
}

.bfz-search-form .form-label {
  font-size: 0.82rem;
  text-align: center;
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
}

.bfz-search-form .form-control,
.bfz-search-form .form-select {
  border-radius: 10px;
  border: 0;
  min-height: 44px;
  box-shadow: inset 0 0 0 1px rgba(95, 111, 132, 0.2);
}

.bfz-search-btn {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--bfz-blue);
  color: var(--bfz-white);
  min-width: 162px;
  min-height: 44px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 20px rgba(15, 78, 233, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background-color 0.18s ease;
}

.bfz-search-btn:hover,
.bfz-search-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(15, 78, 233, 0.28);
  filter: brightness(1.04);
}

.bfz-search-btn:active {
  transform: translateY(0) scale(0.97);
}

.bfz-home-block {
  position: relative;
  overflow: hidden;
  padding: clamp(58px, 7vw, 104px) 0;
}

.bfz-home-block--featured,
.bfz-home-block--split {
  color: var(--bfz-white);
  background: var(--bfz-home-blue);
}

.bfz-home-block--featured-light {
  color: var(--bfz-home-text);
  background: #ffffff;
}

.bfz-home-block--featured-light .bfz-home-block__intro h2,
.bfz-home-block--featured-light .bfz-home-block__intro p {
  color: var(--bfz-home-text);
}

.bfz-home-block--light {
  color: var(--bfz-home-text);
  background: #ffffff;
}

.bfz-home-transition {
  height: clamp(64px, 7vw, 118px);
  pointer-events: none;
}

.bfz-home-transition--blue-to-white {
  background: linear-gradient(180deg, var(--bfz-home-blue) 0%, #ffffff 100%);
}

.bfz-home-transition--white-to-blue {
  background: linear-gradient(180deg, #ffffff 0%, var(--bfz-home-blue) 100%);
}

.bfz-home-featured,
.bfz-home-split,
.bfz-home-grid {
  position: relative;
  z-index: 1;
}

.bfz-home-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
}

.bfz-home-block__intro,
.bfz-home-block__header {
  max-width: 34rem;
}

.bfz-home-block__header {
  margin: 0 auto 34px;
  text-align: center;
}

.bfz-home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 800;
  opacity: 0.86;
}

.bfz-home-block__intro h2,
.bfz-home-block__header h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.bfz-home-block__intro p,
.bfz-home-block__header p {
  margin: 16px 0 0;
  font-size: 1rem;
  line-height: 1.75;
  opacity: 0.88;
}

.bfz-home-block__intro p {
  font-size: 1.25rem;
}

.bfz-home-block__intro-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.28s ease;
}

.bfz-home-block__intro-link:hover {
  transform: translateY(-4px);
}

.bfz-home-block--light .bfz-home-block__header {
  color: var(--bfz-home-text);
}

.bfz-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.bfz-home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.bfz-services-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 54px rgba(9, 22, 44, 0.16);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.bfz-services-card:hover,
.bfz-services-card:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 28px 70px rgba(9, 22, 44, 0.2);
  text-decoration: none;
}

.bfz-services-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: linear-gradient(135deg, rgba(12, 77, 152, 0.08), rgba(12, 77, 152, 0.18));
}

.bfz-services-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.bfz-services-card:hover .bfz-services-card__media img,
.bfz-services-card:focus-visible .bfz-services-card__media img {
  transform: scale(1.05);
}

.bfz-services-card__badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 77, 152, 0.94);
  color: var(--bfz-white);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(12, 77, 152, 0.2);
}

.bfz-services-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.94) 100%);
}

.bfz-services-card__eyebrow {
  color: var(--bfz-home-blue);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bfz-services-card h3 {
  margin: 0;
  color: var(--bfz-home-text);
  font-size: clamp(1.12rem, 1.6vw, 1.38rem);
  font-weight: 800;
  line-height: 1.18;
}

.bfz-services-card p {
  margin: 0;
  color: rgba(18, 48, 79, 0.78);
  font-size: 0.95rem;
  line-height: 1.65;
}

.bfz-services-card__cta {
  margin-top: auto;
  color: var(--bfz-home-blue);
  font-weight: 800;
  font-size: 0.9rem;
}

.bfz-services-card--featured {
  min-height: 100%;
}

.bfz-services-card--featured .bfz-services-card__media {
  aspect-ratio: 16 / 10;
}

.bfz-services-card--featured .bfz-services-card__body {
  padding: 30px;
}

.bfz-home-block--light .bfz-services-card {
  background: rgba(255, 255, 255, 0.96);
}

.bfz-home-block--split .bfz-services-card {
  background: rgba(255, 255, 255, 0.98);
}

.bfz-home-split .bfz-services-card--wide {
  min-height: 100%;
}

.bfz-home-split .bfz-services-card--narrow {
  min-height: 100%;
}

.bfz-home-split .bfz-services-card--narrow .bfz-services-card__media {
  aspect-ratio: 16 / 12;
}

.bfz-card:hover h3,
.bfz-card:focus-within h3,
.bfz-card:focus-visible h3 {
  color: #1d4f96;
  transform: translateY(-4px);
}

@media (max-width: 1199.98px) {
  .bfz-home-featured {
    grid-template-columns: 1fr;
  }

  .bfz-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bfz-home-grid .bfz-services-card:last-child {
    grid-column: 1 / -1;
    max-width: 520px;
    margin-inline: auto;
  }

  .bfz-home-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .bfz-home-block {
    padding: 52px 0;
  }

  .bfz-home-block__header {
    margin-bottom: 28px;
  }

  .bfz-home-featured,
  .bfz-home-split,
  .bfz-home-grid {
    grid-template-columns: 1fr;
  }

  .bfz-services-card {
    border-radius: 24px;
  }
}

@media (max-width: 575.98px) {
  .bfz-home-block {
    padding: 42px 0;
  }

  .bfz-home-block__intro,
  .bfz-home-block__header {
    max-width: none;
    text-align: left;
  }

  .bfz-home-block__header {
    margin-bottom: 22px;
  }

  .bfz-home-block__intro h2,
  .bfz-home-block__header h2 {
    font-size: clamp(1.6rem, 7vw, 2.15rem);
  }

  .bfz-home-block__intro p,
  .bfz-home-block__header p {
    font-size: 1.05rem;
  }

  .bfz-home-grid,
  .bfz-home-split {
    gap: 16px;
  }

  .bfz-services-card {
    border-radius: 18px;
  }

  .bfz-services-card__body {
    padding: 20px;
  }

  .bfz-services-card__badge {
    top: 14px;
    left: 14px;
    font-size: 0.66rem;
    padding: 7px 12px;
  }

  .bfz-services-card p {
    font-size: 0.9rem;
  }
}

@media (min-width: 1400px) {
  .bfz-search-panel {
    --bfz-form-reserved-space: 320px;
    --bfz-form-height-duration: 0.54s;
    --bfz-form-fade-duration: 0.34s;
    --bfz-form-shift: -12px;
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .bfz-search-panel {
    --bfz-form-reserved-space: 306px;
    --bfz-form-height-duration: 0.5s;
    --bfz-form-fade-duration: 0.32s;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .bfz-hero {
    min-height: 620px;
    padding: 30px 0 52px;
  }

  .bfz-search-panel {
    --bfz-form-reserved-space: 286px;
    --bfz-form-height-duration: 0.46s;
    --bfz-form-fade-duration: 0.3s;
  }

  .bfz-pill {
    min-width: 138px;
    min-height: 50px;
    padding: 12px 20px;
  }
}

@media (max-width: 991px) {
  .bfz-services-table {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    padding: 0;
  }

  .bfz-card {
    min-height: 280px;
    padding: 36px 24px;
    gap: 18px;
  }

  .bfz-card-circle {
    width: 150px;
    height: 150px;
  }

  .bfz-card h3 {
    font-size: 1.08rem;
  }
}

@media (max-width: 575.98px) {
  .bfz-hero {
    min-height: 500px;
    padding: 18px 0 28px;
  }

  .bfz-search-panel {
    --bfz-form-reserved-space: 236px;
    --bfz-form-height-duration: 0.34s;
    --bfz-form-fade-duration: 0.24s;
    --bfz-form-shift: -6px;
    padding: 16px;
    padding-bottom: var(--bfz-form-reserved-space);
    border-radius: 16px;
  }

  .bfz-search-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .bfz-pill {
    min-width: calc(33.333% - 11px);
    min-height: 48px;
    padding: 11px 12px;
    font-size: 0.92rem;
  }

  .bfz-services-table {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
  }

  .bfz-card {
    min-height: 260px;
    padding: 32px 20px;
    gap: 16px;
  }

  .bfz-card-circle {
    width: 140px;
    height: 140px;
  }

  .bfz-card h3 {
    font-size: 1.04rem;
    max-width: 16ch;
  }

  .bfz-search-form .form-label {
    font-size: 0.75rem;
  }

  .bfz-search-form .form-control,
  .bfz-search-form .form-select,
  .bfz-search-btn {
    min-height: 42px;
  }

  .bfz-search-btn {
    width: 100%;
    min-width: 0;
  }

  .bfz-search-panel.is-form-open .bfz-search-form-shell {
    margin-top: 14px;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .bfz-hero {
    min-height: 560px;
    padding: 24px 0 34px;
  }

  .bfz-search-panel {
    --bfz-form-reserved-space: 260px;
    --bfz-form-height-duration: 0.38s;
    --bfz-form-fade-duration: 0.26s;
    --bfz-form-shift: -8px;
    padding: 20px;
    padding-bottom: var(--bfz-form-reserved-space);
  }

  .bfz-search-tabs {
    gap: 12px;
  }

  .bfz-pill {
    min-width: 132px;
    min-height: 50px;
    padding: 12px 18px;
  }

  .bfz-services-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bfz-card {
    min-height: 220px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .bfz-search-panel {
    --bfz-form-reserved-space: 276px;
    padding-top: 10vh;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .bfz-search-panel {
    --bfz-form-reserved-space: 246px;
    padding-top: 12vh;
  }

  .bfz-search-tabs {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .bfz-pill {
    min-width: auto;
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.8rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
  .bfz-search-tabs {
    flex-wrap: nowrap;
    gap: 10px;
  }

  .bfz-pill {
    min-width: auto;
    flex: 1;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 575.98px) {
  .bfz-search-tabs {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .bfz-pill {
    min-width: auto;
    flex: 1;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfz-pill,
  .bfz-search-btn,
  .bfz-card,
  .bfz-card-circle,
  .bfz-card h3 {
    transition: none;
  }

  .bfz-pill:hover,
  .bfz-pill:focus-visible,
  .bfz-pill:active,
  .bfz-search-btn:hover,
  .bfz-search-btn:focus-visible,
  .bfz-search-btn:active,
  .bfz-card:hover,
  .bfz-card:focus-within,
  .bfz-card:active,
  .bfz-card:hover .bfz-card-circle,
  .bfz-card:focus-within .bfz-card-circle,
  .bfz-card:hover h3,
  .bfz-card:focus-within h3 {
    transform: none;
  }
}
