/* Калькуляторы режимов резания (точение / фрезерование / сверление). Подключается только на этих страницах. */

.ta-amento-page--calc [hidden] { display: none !important; }

/* ---- Вкладки между тремя страницами ---- */
.ta-calc-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 24px;
  padding-bottom: 2px;
}
.ta-calc-tab {
  flex: none;
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 20px;
  border: 1px solid #E5E7EE;
  border-radius: 12px;
  background: #fff;
  color: #14182B;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s;
}
.ta-calc-tab:hover,
.ta-calc-tab:focus-visible {
  border-color: #BD123C;
  color: #14182B;
}
.ta-calc-tab.is-active {
  border-color: #0F1E50;
  background: #0F1E50;
  color: #fff;
}

/* ---- Основная сетка: ввод + результат ---- */
.ta-calc {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.ta-calc__card {
  border: 1px solid #E5E7EE;
  border-radius: 22px;
  background: #fff;
  padding: clamp(20px, 2.6vw, 32px);
}
.ta-calc__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.ta-calc__ico {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  background: #BD123C;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(189, 18, 60, .22);
}
.ta-calc__h {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: #0F1E50;
}

/* Переключатели режимов (фрезерование) */
.ta-calc-modes {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  padding: 16px;
  border-radius: 16px;
  background: #F7F8FA;
  border: 1px solid #EEF0F4;
}
.ta-calc-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.ta-calc-mode__l {
  min-width: 64px;
  font-size: 13px;
  font-weight: 600;
  color: #5E6478;
}
.ta-calc-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #E5E7EE;
}
.ta-calc-seg__opt {
  position: relative;
  cursor: pointer;
}
.ta-calc-seg__opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.ta-calc-seg__opt span {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: #3A3F52;
  transition: background .15s, color .15s;
}
.ta-calc-seg__opt input:checked + span {
  background: #0F1E50;
  color: #fff;
}
.ta-calc-seg__opt input:focus-visible + span {
  outline: 2px solid #BD123C;
  outline-offset: 2px;
}

/* Поля ввода */
.ta-calc__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}
.ta-calc-field { min-width: 0; }
.ta-calc-field__l {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #3A3F52;
}
.ta-calc-field__l b {
  min-width: 26px;
  font-size: 15px;
  font-weight: 700;
  color: #BD123C;
}
.ta-calc-input { position: relative; }
.ta-calc-input input {
  width: 100%;
  height: 54px;
  box-sizing: border-box;
  padding: 0 72px 0 16px;
  border: 1px solid #D9DCE5;
  border-radius: 14px;
  background: #fff;
  color: #14182B;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ta-calc-input input::placeholder {
  color: #B3B8C7;
  font-weight: 500;
}
.ta-calc-input input:hover { border-color: #B8BCC8; }
.ta-calc-input input:focus {
  border-color: #BD123C;
  box-shadow: 0 0 0 4px rgba(189, 18, 60, .12);
}
.ta-calc-input input[aria-invalid="true"] {
  border-color: #BD123C;
  background: #FFF7F9;
}
.ta-calc-input__u {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 8px;
  background: #F4F5F8;
  color: #5E6478;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.ta-calc-field__h {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #8A8FA3;
}
.ta-calc-field__err {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #BD123C;
}
.ta-calc__note {
  margin: 20px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8A8FA3;
}

/* ---- Результат (тёмная карточка) ---- */
.ta-calc__out {
  position: sticky;
  top: 110px;
  border-color: transparent;
  background: linear-gradient(150deg, #0F1E50 0%, #1B2F70 100%);
  color: #fff;
  overflow: hidden;
}
.ta-calc__out::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.ta-calc__out::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(189, 18, 60, .5), transparent 70%);
  pointer-events: none;
}
.ta-calc__out > * { position: relative; z-index: 1; }
.ta-calc__out .ta-calc__h { color: #fff; }
.ta-calc-res {
  display: grid;
  gap: 10px;
}
.ta-calc-res__row {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
}
.ta-calc-res__row.is-accent {
  background: rgba(189, 18, 60, .28);
  border-color: rgba(255, 143, 169, .35);
}
.ta-calc-res__l {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: #C9D0E6;
}
.ta-calc-res__l b {
  font-size: 14px;
  font-weight: 700;
  color: #FF8FA9;
}
.ta-calc-res__v {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.ta-calc-res__num {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ta-calc-res__row.is-accent .ta-calc-res__num { font-size: clamp(30px, 3vw, 40px); }
.ta-calc-res__num.is-empty { color: rgba(255, 255, 255, .4); }
.ta-calc-res__v i {
  font-style: normal;
  font-size: 14px;
  color: #C9D0E6;
}
.ta-calc-res__sub {
  font-size: 13px;
  color: #FFD3DE;
}
.ta-calc-res__empty {
  margin: 14px 0 0;
  font-size: 13px;
  color: #C9D0E6;
}
.ta-calc-res__empty[hidden] { display: none; }
.ta-calc-acts {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.ta-calc-acts__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ta-calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 18px;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ta-calc-btn--main {
  border: 0;
  background: #BD123C;
  color: #fff;
  box-shadow: 0 12px 26px rgba(189, 18, 60, .35);
}
.ta-calc-btn--main:hover,
.ta-calc-btn--main:focus-visible { background: #A40F34; }
.ta-calc-btn--ghost {
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: #fff;
}
.ta-calc-btn--ghost:hover,
.ta-calc-btn--ghost:focus-visible { border-color: #fff; }

/* ---- Секции под калькулятором ---- */
.ta-calc-sec { margin-top: clamp(40px, 5vw, 64px); }
.ta-calc-sec__h {
  margin: 0 0 20px;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: #0F1E50;
}
.ta-calc-formulas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}
.ta-calc-formula {
  padding: 20px 22px;
  border-radius: 18px;
  background: #F7F8FA;
  border: 1px solid #EEF0F4;
}
.ta-calc-formula__f {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #0F1E50;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ta-calc-formula__d {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #5E6478;
}

/* Рекомендуемые разделы */
.ta-calc-rec {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 14px;
}
.ta-calc-rec__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #E5E7EE;
  background: #fff;
  color: #14182B;
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.ta-calc-rec__card:hover,
.ta-calc-rec__card:focus-visible {
  border-color: #BD123C;
  transform: translateY(-2px);
  color: #14182B;
}
.ta-calc-rec__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.ta-calc-rec__img {
  position: relative;
  flex: none;
  height: 140px;
  margin: 12px 0;
}
.ta-calc-rec__img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ta-calc-rec__go {
  font-size: 13px;
  font-weight: 600;
  color: #BD123C;
}

/* Вопросы */
.ta-calc-faq { border-top: 1px solid #E5E7EE; }
.ta-calc-faq__item { border-bottom: 1px solid #E5E7EE; }
.ta-calc-faq__btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  color: #14182B;
  cursor: pointer;
}
.ta-calc-faq__chev {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: #F4F5F8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}
.ta-calc-faq__a {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.7;
  color: #3A3F52;
  max-width: 860px;
}

/* Нижний баннер */
.ta-calc-cta {
  position: relative;
  overflow: hidden;
  margin-top: clamp(40px, 5vw, 64px);
  border-radius: 24px;
  background: linear-gradient(150deg, #0F1E50, #1B2F70);
  color: #fff;
  padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.ta-calc-cta__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.ta-calc-cta__glow {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(189, 18, 60, .45), transparent 70%);
  pointer-events: none;
}
.ta-calc-cta__text {
  position: relative;
  min-width: 0;
  flex: 1 1 320px;
}
.ta-calc-cta__t {
  margin-bottom: 10px;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -.02em;
}
.ta-calc-cta__text p {
  margin: 0;
  max-width: 640px;
  font-size: 16px;
  color: #C9D0E6;
  text-wrap: pretty;
}
.ta-calc-cta__acts {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.ta-calc-cta__tel,
.ta-calc-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 26px;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.ta-calc-cta__tel {
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
}
.ta-calc-cta__btn {
  border: 0;
  background: #BD123C;
  color: #fff;
}
.ta-calc-cta__btn:hover,
.ta-calc-cta__btn:focus-visible { background: #A40F34; }

/* ---- Адаптив ---- */
@media (max-width: 960px) {
  .ta-calc { grid-template-columns: minmax(0, 1fr); }
  .ta-calc__out { position: relative; top: auto; }
}
@media (max-width: 599px) {
  .ta-calc__fields { grid-template-columns: minmax(0, 1fr); }
  .ta-calc-seg { width: 100%; }
  .ta-calc-seg__opt { flex: 1 1 auto; }
  .ta-calc-seg__opt span { justify-content: center; padding: 0 12px; }
  .ta-calc-cta__acts { width: 100%; }
  .ta-calc-cta__tel,
  .ta-calc-cta__btn { flex: 1 1 100%; }
}
