/*
  Стилі, специфічні для головної: hero-відео, міні-форма, калькулятор-тизер.
*/

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--color-bg-dark); }
.hero__media {
  position: absolute;
  inset: -12% 0;
  z-index: 0;
  will-change: transform;
}
.hero__video, .hero__poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}
.hero__poster { z-index: 0; }
.hero__video { z-index: 1; }
.hero.is-static .hero__video { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .hero__video { visibility: hidden; }
  .hero__media {
    will-change: auto;
    transform: none;
  }
}
.hero__scrim {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.28) 0%,
      rgba(15, 23, 42, 0.1) 38%,
      rgba(15, 23, 42, 0.48) 100%
    );
}
@media (min-width: 1024px) {
  .hero__scrim {
    background:
      linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.32) 0%,
        rgba(15, 23, 42, 0.08) 48%,
        rgba(15, 23, 42, 0.22) 100%
      );
  }
}

.hero__inner {
  position: relative;
  z-index: 1;
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.hero__content {
  max-width: 40rem;
  color: var(--color-text-inverse);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 6px 28px rgba(0, 0, 0, 0.45);
}
.hero__badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 0.45rem;
  row-gap: 0.15rem;
  box-sizing: border-box;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  font-size: 0.8rem;
  line-height: 1.35;
  margin-bottom: 1.1rem;
  text-align: center;
  text-shadow: none;
  max-width: 100%;
}
.hero__badge-lead,
.hero__badge-rest { white-space: nowrap; }
.hero__title {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 4px 18px rgba(0, 0, 0, 0.55),
    0 12px 40px rgba(0, 0, 0, 0.35);
}
.hero__lead {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: #fff;
  max-width: 36rem;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.65),
    0 6px 22px rgba(0, 0, 0, 0.45);
}
.hero__lead:empty { display: none; }
.hero__actions { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.hero__actions .btn--glass {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.98);
  color: var(--color-text);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.12),
    0 8px 22px rgba(16, 24, 40, 0.2);
}
.hero__actions .btn--glass:hover,
.hero__actions .btn--glass:focus-visible {
  background: #fff;
  color: var(--color-cta-hover);
  border-color: var(--color-cta);
  box-shadow:
    0 2px 6px rgba(176, 143, 92, 0.22),
    0 14px 32px rgba(16, 24, 40, 0.24);
}
.hero__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}
.hero__fact {
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.65),
    0 4px 16px rgba(0, 0, 0, 0.4);
}
.hero__fact-year {
  color: #fff;
  font-family: var(--ff-display);
  font-size: 1.1rem;
  white-space: nowrap;
}
.hero__fact-rest { white-space: nowrap; }

.hero__form-card {
  width: 100%;
  max-width: 26rem;
  min-width: 0;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  color: var(--color-text-inverse);
  text-shadow: none;
}
.hero__quote-open { display: none; }
.hero-sheet {
  width: 100%;
  max-width: 26rem;
  min-width: 0;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero__form-card { background: rgba(15, 23, 42, 0.9); }
}

.hero__form-title {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: #fff;
  text-wrap: pretty;
  hyphens: none;
}
.hero__form .field { margin-bottom: 0.9rem; }
.hero__form .field__label { color: rgba(255, 255, 255, 0.78); }
.hero__form .field__input,
.hero__form .field__select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  box-shadow: none;
  color-scheme: dark;
}
.hero__form .field__input::placeholder { color: rgba(255, 255, 255, 0.42); }
.hero__form .field__input:focus-visible,
.hero__form .field__select:focus-visible {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}
.hero__form .field__select option {
  color: var(--color-text);
  background: var(--color-bg-alt);
  color-scheme: light;
}
.hero__form .field__input:-webkit-autofill,
.hero__form .field__input:-webkit-autofill:hover,
.hero__form .field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.72) inset;
  transition: background-color 99999s ease-out;
}

/* Custom select (frost) — відкривається вниз */
.hero__form-card { overflow: visible; }
.hero__form .pt-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.hero__form .pt-select__trigger:hover {
  background: rgba(255, 255, 255, 0.12);
}
.hero__form .pt-select__trigger:focus-visible {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
  outline: none;
}
.hero__form .pt-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero__form .pt-select__chevron {
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform var(--t-fast);
}
.hero__form .pt-select.is-open .pt-select__chevron {
  transform: rotate(180deg);
}
.hero__form .pt-select.is-placeholder .pt-select__value {
  color: rgba(255, 255, 255, 0.42);
}
.hero__form .pt-select__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-height: min(16rem, 45vh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 6;
  transform-origin: top center;
  transform: translateY(-6px) scaleY(0.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--duration-ui) var(--ease-out),
    transform var(--duration-ui) var(--ease-out),
    visibility var(--duration-ui) var(--ease-out);
}
.hero__form .pt-select.is-open .pt-select__list {
  transform: translateY(0) scaleY(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.hero__form .pt-select.is-reduced-motion .pt-select__list,
.hero__form .pt-select.is-reduced-motion .pt-select__chevron {
  transition: none;
}
.hero__form .pt-select__option {
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.35;
}
.hero__form .pt-select__option:hover,
.hero__form .pt-select__option:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
.hero__form .pt-select__option.is-selected {
  background: rgba(29, 78, 216, 0.88);
  color: #fff;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero__form .pt-select__list { background: rgba(15, 23, 42, 0.96); }
}

@media (min-width: 1024px) {
  .hero__inner {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 3rem;
  }
  .hero__content {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
  }
  .hero__badge {
    margin-bottom: 0;
    align-self: flex-start;
    flex-shrink: 0;
  }
  .hero__title { margin-top: auto; }
  .hero__lead { margin-bottom: 0; }
  .hero__actions {
    margin-top: auto;
    padding-top: 1rem;
    flex-shrink: 0;
  }
  .hero__fact {
    margin-top: 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .hero__form-card {
    margin-bottom: 0.25rem;
    flex-shrink: 0;
  }
}

@media (max-width: 1023px) {
  .hero__content { max-width: none; width: 100%; }
  .hero__badge {
    display: flex;
    width: 100%;
    max-width: none;
    padding: 0.45rem 0.85rem;
  }
}

@media (max-width: 1023px) and (min-width: 768px) {
  .hero__inner { padding-block: clamp(2.75rem, 7vw, 4.5rem) 2.25rem; gap: 1.75rem; }
  .hero-sheet {
    max-width: none;
    width: 100%;
  }
  .hero__form-card {
    max-width: none;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
    row-gap: 0.85rem;
    align-items: end;
  }
  .hero__form-title {
    grid-column: 1 / -1;
    margin-bottom: 0.15rem;
    white-space: nowrap;
  }
  .hero__form .field { margin-bottom: 0; }
  .hero__form .btn--block { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .hero__inner {
    padding-block: 1.15rem 1.35rem;
    gap: 1.15rem;
  }
  .hero__title {
    font-size: clamp(1.55rem, 7.4vw, 2.05rem);
    text-wrap: balance;
  }
  .hero__badge {
    font-size: 0.74rem;
    margin-bottom: 0.7rem;
  }
  .hero__actions {
    width: 100%;
    margin-top: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .btn { min-height: 48px; }
  .hero__quote-open { display: inline-flex; width: 100%; }
  .hero__fact { margin-top: 0.85rem; }
  .hero-sheet { display: none; }
}
