/* === Налоговый вычет (стиль Эвиты, расположение полей как в Камее) === */
.tax-page {
  background: #fff;
  padding: 30px 10% 60px;
  font-family: 'Open Sans', sans-serif;
}

.tax-container {
  max-width: 1100px;
  margin: 0 auto;
}

.tax-page h1 {
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 600;
  text-align: center;
  color: #000;
  margin-bottom: 30px;
}

/* --- Вступительный текст --- */
.tax-intro {
  background: #f9f9f9;
  border-radius: 20px;
  padding: 30px 40px;
  margin-bottom: 30px;
  color: #555;
  font-size: 16px;
  line-height: 1.6;
}

.tax-intro h2 {
  font-size: clamp(18px, 2vw, 26px);
  color: #333;
  margin: 0 0 16px;
}

.tax-intro h3 {
  font-size: clamp(16px, 1.6vw, 20px);
  color: #333;
  margin: 20px 0 10px;
}

.tax-intro p { margin: 0 0 12px; }
.tax-intro ul { margin: 0 0 12px 20px; padding: 0; }
.tax-intro li { margin-bottom: 6px; }

.tax-details { margin-top: 16px; }
.tax-details summary { cursor: pointer; font-weight: 600; color: #b2763c; }
.tax-details ul { margin: 12px 0 0 20px; padding: 0; }
.tax-details li { margin-bottom: 8px; }

/* --- Форма --- */
.tax-form {
  background: #f9f9f9;
  border-radius: 20px;
  padding: 40px;
}

.tax-form__heading {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 600;
  color: #333;
  line-height: 1.25;
  margin: 0 0 16px;
}

.tax-form__heading--patient {
  margin-top: 32px;
}

.tax-note {
  background: #fbf5ee;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #6b5236;
  margin: 0 0 24px;
}

/* Налогоплательщик (каждый следующий отделяется линией) */
.tax-payer {
  position: relative;
}

.tax-payer + .tax-payer {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid #e3d9cf;
}

.tax-card-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px;
  padding-right: 36px;
}

/* При одном налогоплательщике / одном пациенте номер не показываем */
#tax-payers.is-single .tax-card-title,
.tax-patient-list.is-single .tax-subcard-title { display: none; }

/* Сетка полей — 3 колонки, как в Камее */
.tax-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 20px;
  margin-bottom: 20px;
}

.tax-field { min-width: 0; }

.tax-field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

.tax-field input,
.tax-field select,
.tax-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: #333;
  background: #fff;
  border: 1px solid #e0d6cf;
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.tax-field select {
  height: 50px;
  cursor: pointer;
}

.tax-field input::placeholder,
.tax-field textarea::placeholder { color: #aaa; }

.tax-field input:focus,
.tax-field select:focus,
.tax-field textarea:focus {
  border-color: #b2763c;
  box-shadow: 0 0 0 3px rgba(178, 118, 60, .12);
}

.tax-field .is-invalid,
.tax-field input.is-invalid,
.tax-field select.is-invalid { border-color: #D95757; }

.tax-field--comment { margin: 24px 0 20px; }
.tax-field--comment textarea { resize: vertical; min-height: 110px; }

.tax-patients-wrap[hidden],
.tax-age-wrap[hidden] { display: none; }

/* Пациент */
.tax-patient {
  position: relative;
}

.tax-patient + .tax-patient {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px dashed #e3d9cf;
}

.tax-subcard-title {
  font-size: 15px;
  font-weight: 600;
  color: #b2763c;
  margin: 0 0 12px;
  padding-right: 36px;
}

/* --- Низ формы: кнопка слева, согласие справа --- */
.tax-recaptcha { margin: 0 0 16px; min-height: 78px; }

.tax-error {
  color: #D95757;
  font-size: 14px;
  margin-bottom: 14px;
}

.tax-bottom {
  display: flex;
  align-items: center;
  gap: 30px;
}

.tax-submit {
  flex: 0 0 55%;
  background: #C6AEA6;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 18px 20px;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s;
}
.tax-submit:hover { background: #b99d94; }
.tax-submit:disabled { opacity: .7; cursor: not-allowed; }

.tax-agree {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  line-height: 1.45;
  color: #444;
}
.tax-agree input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #b2763c;
  cursor: pointer;
}
.tax-agree label { cursor: pointer; }
.tax-agree a { text-decoration: underline; color: #b2763c; }

.tax-success {
  background: #f1f8f1;
  color: #2e7d32;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  font-size: 18px;
}

/* --- Адаптив --- */
@media (max-width: 900px) {
  .tax-grid { grid-template-columns: repeat(2, 1fr); }
  .tax-bottom { flex-direction: column; align-items: stretch; gap: 16px; }
  .tax-agree { font-size: 16px; }
  .tax-submit { flex: none; width: 100%; }
}

@media (max-width: 640px) {
  .tax-page { padding: 20px 5% 40px; }
  .tax-intro { padding: 20px; font-size: 14px; }
  .tax-form { padding: 24px 16px; }
  .tax-grid { grid-template-columns: 1fr; }
}