/* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
  */
/* body {
      font-family: sans-serif;
      /* background: #c9a84c url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1400') center/cover no-repeat; 
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

/* Modal */
.modal {
  background: var(--color-primary);
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  overflow: hidden;
  /* box-shadow: 0 8px 40px rgba(0,0,0,0.18); */
}

/* Header */
.modal-header {
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--color-background);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 500;
  color: #111;
  line-height: 1.3;
}

.btn-close {
  background: var(--color-button_secondary);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-close:hover {
  background: #e0b310;
}

/* Body */
.modal-body {
  padding: 1.75rem 2rem 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--color-background);
}

.field input,
.field select,
.field textarea {
  height: 40px;
  border: 1px solid var(--color-background);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-primary);
  background: var(--color-button_secondary);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-primary);
  /* box-shadow: 0 0 0 3px rgba(240,195,24,0.15); */
}

.field textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.selects-row {
  grid-column: 1 / 2;
}

.selects-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.selects-inner .field {
  margin: 0;
}

.textarea-field {
  grid-column: 2 / 3;
}

.checkbox-row {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.checkbox-row label {
  font-size: 14px;
  color: var(--color-background);
  cursor: pointer;
}

.modal-footer {
  padding: 0 2rem 2rem;
}

.btn-submit {
  width: 100%;
  height: 54px;
  background: var(--color-button_secondary);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-primary);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition:
    background 0.15s,
    transform 0.1s;
}

.btn-submit:hover {
  background: #e0b310;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-open {
  display: none;
  padding: 12px 24px;
  background: #f0c318;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.btn-open.visible {
  display: inline-block;
}

.success-msg {
  display: none;
  margin-top: 12px;
  padding: 12px 16px;
  background: #eafaf1;
  border: 1px solid #a8e6c0;
  border-radius: 8px;
  font-size: 14px;
  color: #1a7a3c;
  text-align: center;
}

/*адаптив*/
@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .selects-row,
  .textarea-field {
    grid-column: 1 / 2;
  }
}
