/* ========== Hero ========== */
.page-main--bfc {
  overflow: hidden;
}

.bfc-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #1a1f26;
}

.bfc-hero__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 14, 20, 0.88) 0%, rgba(10, 14, 20, 0.62) 55%, rgba(10, 14, 20, 0.35) 100%),
    url("../images/cnc-press-brake-euro-pro.webp") center / cover no-repeat;
}

.bfc-hero__inner {
  position: relative;
  z-index: 1;
  padding: 72px 24px;
}

.bfc-hero__content {
  max-width: 720px;
}

.bfc-hero__title {
  margin: 0 0 20px;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--color-white);
}

.bfc-hero__text {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.92);
}

.bfc-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 28px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}

.bfc-hero__cta:hover,
.bfc-hero__cta:focus-visible {
  color: var(--color-text);
  background: var(--color-white);
}

.bfc-hero__cta:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
}

/* ========== Calculator Section ========== */
.bfc-calculator {
  padding: 56px 0 64px;
  background: #f0f1f3;
}

.bfc-calculator__wrap {
  max-width: 920px;
  margin: 0 auto;
}

.bfc-card {
  padding: 28px 32px 32px;
  background: var(--color-white);
  border: 1px solid #e2e6ea;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.bfc-card__title {
  margin: 0 0 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

/* ========== Form Fields ========== */
.bfc-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bfc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bfc-field__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.bfc-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid #c8cdd2;
  border-radius: 2px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.bfc-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 83, 135, 0.12);
}

.bfc-input::placeholder {
  color: #aab0b6;
  font-weight: 400;
}

.bfc-input:disabled {
  background: #f7f8f9;
  color: var(--color-text-muted);
}

/* ========== Custom Material Select ========== */
.bfc-select {
  position: relative;
}

.bfc-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid #c8cdd2;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.bfc-select__trigger:hover {
  border-color: #aab0b6;
}

.bfc-select.is-open .bfc-select__trigger,
.bfc-select__trigger:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 83, 135, 0.12);
}

.bfc-select__value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bfc-select__value.is-placeholder {
  color: #aab0b6;
  font-weight: 400;
}

.bfc-select__chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-left: 12px;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
}

.bfc-select.is-open .bfc-select__chevron {
  transform: rotate(-135deg) translateY(-2px);
}

.bfc-select__panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-white);
  border: 1px solid var(--color-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.bfc-select__panel[hidden] {
  display: none;
}

.bfc-select__search-wrap {
  padding: 8px;
  border-bottom: 1px solid #e8ebee;
}

.bfc-select__search {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid #c8cdd2;
  border-radius: 2px;
}

.bfc-select__search:focus {
  outline: none;
  border-color: var(--color-primary);
}

.bfc-select__list {
  max-height: 240px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.bfc-select__option {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.bfc-select__option:hover,
.bfc-select__option.is-focused {
  background: #f0f4f8;
}

.bfc-select__option.is-selected {
  color: var(--color-white);
  background: var(--color-primary);
}

.bfc-select__option.is-hidden {
  display: none;
}

.bfc-select__empty {
  padding: 14px;
  font-size: 14px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ========== Summary Grid ========== */
.bfc-summary {
  margin-top: 28px;
  border: 1px solid #c8cdd2;
}

.bfc-summary__head,
.bfc-summary__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bfc-summary__head-cell {
  padding: 12px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  color: var(--color-text);
  background: #fafbfc;
  border-right: 1px solid #c8cdd2;
  border-bottom: 1px solid #c8cdd2;
}

.bfc-summary__head-cell:last-child {
  border-right: 0;
}

.bfc-summary__cell {
  min-height: 44px;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: var(--color-text);
  background: var(--color-white);
  border-right: 1px solid #c8cdd2;
}

.bfc-summary__cell:last-child {
  border-right: 0;
}

.bfc-summary__cell:empty::before {
  content: "\00a0";
}

/* ========== Result ========== */
.bfc-result {
  border-top: 1px solid #c8cdd2;
}

.bfc-result__label {
  margin: 0;
  padding: 14px 12px 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: var(--color-text);
  background: #fafbfc;
  border-bottom: 1px solid #c8cdd2;
}

.bfc-result__value-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 20px 16px;
  background: var(--color-white);
}

.bfc-result__value {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  transition: color var(--transition);
}

.bfc-card.has-result .bfc-result__value {
  color: #d32f2f;
}

/* ========== Contact Form (Fluent Forms) ========== */
.bfc-contact {
  background: var(--color-white);
}

.bfc-contact .contact-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
  margin: 0 auto;
}

/* ========== Quote Form (legacy — unused) ========== */
.bfc-quote {
  padding: 64px 0 80px;
  background: var(--color-primary);
}

.bfc-quote__title {
  margin: 0 0 32px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--color-white);
}

.bfc-quote__card {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 36px 44px;
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.bfc-quote-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.bfc-quote-field--full {
  grid-column: 1 / -1;
}

.bfc-quote-field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.bfc-quote-field__control {
  position: relative;
}

.bfc-quote-field input,
.bfc-quote-field select,
.bfc-quote-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f5f5f5;
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text);
  transition: border-color var(--transition), background var(--transition);
}

.bfc-quote-field input::placeholder,
.bfc-quote-field textarea::placeholder {
  color: #888888;
}

.bfc-quote-field input:focus,
.bfc-quote-field select:focus,
.bfc-quote-field textarea:focus {
  outline: none;
  border-color: #c8cdd2;
  background: #f8f8f8;
}

.bfc-quote-field select {
  appearance: none;
  padding-right: 36px;
  color: #888888;
  background:
    #f5f5f5
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M1 1l4 4 4-4'/%3E%3C/svg%3E")
    no-repeat right 14px center / 10px 6px;
}

.bfc-quote-field select:valid {
  color: var(--color-text);
}

.bfc-quote-field textarea {
  min-height: 140px;
  resize: vertical;
}

.bfc-quote-field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #888888;
  pointer-events: none;
}

.bfc-quote-field--icon input {
  padding-left: 42px;
}

.bfc-quote-field__dial {
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 12px;
  border: 0;
  border-right: 1px solid #e0e0e0;
  border-radius: 4px 0 0 4px;
  background: #ececec;
  color: #666666;
  pointer-events: none;
}

.bfc-quote-field__flag {
  font-size: 18px;
  line-height: 1;
}

.bfc-quote-field--phone input {
  padding-left: 72px;
}

.bfc-quote-captcha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 304px;
  min-height: 78px;
  padding: 0 12px 0 14px;
  border: 1px solid #d3d3d3;
  border-radius: 3px;
  background: #fafafa;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.bfc-quote-captcha__box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.bfc-quote-captcha__check {
  width: 24px;
  height: 24px;
  border: 2px solid #c1c1c1;
  border-radius: 2px;
  background: var(--color-white);
}

.bfc-quote-captcha__text {
  font-size: 14px;
  color: #222222;
}

.bfc-quote-captcha__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bfc-quote-captcha__logo {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  color: #555555;
}

.bfc-quote-captcha__meta {
  font-size: 8px;
  line-height: 1.2;
  color: #888888;
}

.bfc-quote-form__submit {
  margin-top: 24px;
  padding: 14px 36px;
  border: none;
  border-radius: 4px;
  background: #2d3132;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-white);
  cursor: pointer;
  transition: background var(--transition);
}

.bfc-quote-form__submit:hover,
.bfc-quote-form__submit:focus-visible {
  background: #1f2223;
}

.bfc-quote-form__submit:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
}

/* ========== Tablet ========== */
@media (max-width: 900px) {
  .bfc-quote__card {
    padding: 32px 28px 36px;
  }

  .bfc-summary__head,
  .bfc-summary__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bfc-summary__head-cell:nth-child(n + 4),
  .bfc-summary__cell:nth-child(n + 4) {
    border-top: 1px solid #c8cdd2;
  }

  .bfc-summary__head-cell:nth-child(3),
  .bfc-summary__cell:nth-child(3) {
    border-right: 0;
  }

  .bfc-summary__head-cell:nth-child(4),
  .bfc-summary__cell:nth-child(4) {
    border-right: 1px solid #c8cdd2;
  }
}

/* ========== Mobile ========== */
@media (max-width: 640px) {
  .bfc-hero {
    min-height: 480px;
  }

  .bfc-hero__inner {
    padding: 56px 20px;
  }

  .bfc-calculator {
    padding: 40px 0 56px;
  }

  .bfc-card {
    padding: 22px 18px 24px;
  }

  .bfc-summary__head,
  .bfc-summary__row {
    grid-template-columns: 1fr;
  }

  .bfc-summary__head-cell,
  .bfc-summary__cell {
    border-right: 0;
    border-top: 1px solid #c8cdd2;
    text-align: left;
    padding-left: 14px;
    padding-right: 14px;
  }

  .bfc-summary__head-cell:first-child,
  .bfc-summary__cell:first-child {
    border-top: 0;
  }

  .bfc-summary__head-cell::before {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    content: attr(data-short);
  }

  .bfc-input {
    text-align: left;
  }

  .bfc-quote {
    padding: 48px 0 64px;
  }

  .bfc-quote__title {
    margin-bottom: 24px;
  }

  .bfc-quote__card {
    padding: 24px 18px 28px;
  }

  .bfc-quote-form__grid {
    grid-template-columns: 1fr;
  }

  .bfc-quote-form__submit {
    width: 100%;
  }
}
