/* Inline form errors & banners rendered by forms.js */

.form-field-error {
  color: #c0392b;
  font-size: 13px;
  line-height: 1.3;
  margin-top: 4px;
  padding-left: 2px;
  font-weight: 600;
}

.has-error > input,
.has-error > textarea,
.has-error .order-form-input,
.has-error .order-form-textarea,
.has-error .popup-calc-input {
  border-color: #c0392b !important;
  outline-color: #c0392b !important;
}

/* Dark brown gradient form (.order-form-border wraps the form on:
   - /product/* "Заявка на расчет" (_order_form.twig)
   - /kontakty/ "Есть вопросы?" (_contact_form.twig)
   Calc modal contact step (step 7) has the same dark backdrop.
   Red on brown is unreadable, so use a light amber that pops on dark. */
.order-form-border .form-field-error,
#popup-calc-modal .form-field-error {
  color: #ffd166;
}
.order-form-border .has-error > input,
.order-form-border .has-error > textarea,
.order-form-border .has-error .order-form-input,
.order-form-border .has-error .order-form-textarea,
#popup-calc-modal .has-error > input,
#popup-calc-modal .has-error .popup-calc-input {
  border-color: #ffd166 !important;
  outline-color: #ffd166 !important;
}

.form-banner {
  padding: 12px 16px;
  margin: 0 0 16px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.4;
}

.form-banner-success {
  background: #e6f6ec;
  color: #1f6b3b;
  border: 1px solid #b6e0c2;
}

.form-banner-error {
  background: #fdecea;
  color: #a02620;
  border: 1px solid #f1c7c4;
}

/* ---- File picker (multiple files, ≤ 5) ---- */
.order-form-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-form-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  font-size: 13px;
  color: #4a3a1f;
}
.order-form-file-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-form-file-name small {
  color: #888;
  margin-left: 4px;
}
.order-form-file-remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: none;
  border: 1px solid #c0392b;
  border-radius: 50%;
  color: #c0392b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.order-form-file-remove:hover {
  background: #c0392b;
  color: #fff;
}

/* ---- Success modal (replaces inline success banner) ---- */
.form-success-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}
.form-success-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.form-success-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.form-success-modal__card {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 460px;
  padding: 2.5rem 2rem 2rem;
  border: 2px solid #f7d79d;
  border-radius: 1rem;
  background: #fff;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.form-success-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #80673b;
  cursor: pointer;
  transition: color 0.2s;
}
.form-success-modal__close:hover {
  color: #c0392b;
}
.form-success-modal__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #e6f6ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #1f6b3b;
  line-height: 1;
}
.form-success-modal__title {
  font-family: var(--font-secondary, serif);
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
  color: #80673b;
}
.form-success-modal__text {
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  margin: 0 0 1.5rem;
}
.form-success-modal__btn {
  display: inline-block;
  padding: 0.75rem 2.5rem;
  background: #f7d79d;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #80673b;
  cursor: pointer;
  transition: background 0.2s;
}
.form-success-modal__btn:hover {
  background: #f4c982;
}
