/* ---- POPUPS ---- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}
.modal__dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: visible;
  background: rgb(var(--bg-1-rgb) / 0.85);
  border: 1px solid rgb(var(--gold-1-rgb) / 0.45);
  border-radius: 4px;
  padding: 40px 32px;
  box-shadow: 0 0 0 4px rgb(var(--bg-1-rgb) / 0.6), 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.4s var(--ease-out);
}
.modal__dialog--wide { width: min(900px, 100%); }
.modal__close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  font-size: 1.5rem;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.modal__close:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.modal__content h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-align: center;
  margin-bottom: 6px;
  color: var(--gold-3);
  text-shadow: 0 0 24px rgb(var(--gold-1-rgb) / 0.4);
}
.modal__subtitle {
  text-align: center; font-size: 0.7rem; letter-spacing: 0.2em;
  color: var(--text-2); margin-bottom: 28px;
}
.modal__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.dl-row {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; margin-bottom: 14px;
  background: linear-gradient(90deg, rgb(var(--gold-1-rgb) / 0.06), rgb(var(--bg-1-rgb) / 0.5));
  border: 1px solid rgb(var(--gold-1-rgb) / 0.25);
}
.dl-row__label { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.04em; }
.dl-row__btns { display: flex; gap: 12px; flex-wrap: wrap; }
.dl-row--instr { display: block; padding: 0; }
.dl-row--instr summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; cursor: pointer; list-style: none;
}
.dl-row--instr summary::-webkit-details-marker { display: none; }
.dl-row--instr summary .dl-row__label { font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; }
.dl-row__steps { padding: 0 24px 20px 48px; color: var(--text-2); font-size: 0.9rem; line-height: 1.7; }
.dl-row__steps li { margin-bottom: 6px; }

/* ---- TOAST ---- */
.toast-container {
  position: fixed; top: 100px; right: 24px; z-index: 100001;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 14px 20px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  font-size: 0.85rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.4s var(--ease-out);
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

/* ---- MODAL: ADAPTIVE ---- */
/* телефон */
@media (max-width: 640px) {
  .modal__dialog { padding: 32px 20px; }
  .dl-row:not(.dl-row--instr) { padding: 14px 16px; }
  .dl-row--instr summary { padding: 14px 16px; }
}

/* ---- FORMS В ПОПАПАХ (.field) ----
   Класс .field также используется как обёртка в формах CMS, поэтому эти правила цепляют и их (см. .cms-content .field span в pages/cms.css). */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 0.75rem; letter-spacing: 0.05em; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-1); color: var(--text-1);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 2px;
}
.field input:focus { outline: none; border-color: var(--gold-2); }
