/* BuyDocs components (r725) — site copy of the design system bundle, without its icon block
   (theme.css owns .icu). Used by bd-dialog.js; ready for pages that move onto .bd-* classes.
   Built from the live rules: r683 buttons (seller-panel.css), .fi fields, .form-card,
   .stat-card, .modal, ticket pills, and the icon base in theme.css.
   Every value is a token from tokens.css; no raw colours, sizes or !important. */

/* ---------- base ---------- */
.bd {
  font-family: var(--font-sans);
  font-size: 0.95rem; line-height: 1.8; font-weight: 500;
  color: var(--dark-primary);
  -webkit-font-smoothing: antialiased;
}
.bd *, .bd *::before, .bd *::after { box-sizing: border-box; }
.bd :focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 2px; }

/* ---------- Button ----------
   .bd-btn                 main action: brand gold, ink label
   .bd-btn--secondary      second action: white, outlined
   .bd-btn--soft           small helper: light gold
   .bd-btn--danger         destructive / report
   .bd-btn--quiet          cancel / close
   .bd-btn--sm             40px row size; .bd-btn--block fills its container */
.bd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 50px; padding: var(--sp-3) 18px;
  border: 1.5px solid transparent; border-radius: var(--r-btn);
  font: inherit; font-size: 1rem; font-weight: 800; line-height: 1.5;
  text-align: center; text-decoration: none; cursor: pointer;
  background: var(--gold-primary); color: var(--btn-ink); box-shadow: var(--shadow-btn);
  transition: filter var(--dur-fast) cubic-bezier(0.16, 1, 0.3, 1),
              transform var(--dur-fast) cubic-bezier(0.16, 1, 0.3, 1),
              background-color var(--dur-fast), border-color var(--dur-fast);
}
.bd-btn--block { width: 100%; }
.bd-btn--secondary {
  min-height: 44px; padding: var(--sp-2) 18px; font-size: 0.88rem;
  background: var(--white); color: var(--dark-primary); border-color: var(--gray-300); box-shadow: none;
}
.bd-btn--soft {
  min-height: 40px; padding: 6px 14px; font-size: 0.88rem;
  background: var(--gold-bg); color: var(--gold-deep); border-color: var(--gold-lighter); box-shadow: none;
}
.bd-btn--danger { background: var(--red-strong); color: var(--white); box-shadow: var(--shadow-danger); }
.bd-btn--danger .icu { --ic-acc: currentColor; }
.bd-btn--quiet { background: var(--gray-100); color: var(--dark-secondary); box-shadow: none; }
.bd-btn--sm { min-height: 40px; padding: 6px 14px; font-size: 0.88rem; }
@media (hover: hover) and (pointer: fine) {
  .bd-btn:hover:not(:disabled) { filter: brightness(0.95); }
  .bd-btn--secondary:hover:not(:disabled) { filter: none; border-color: var(--gold-primary); background: var(--gold-bg); }
  .bd-btn--soft:hover:not(:disabled) { filter: none; background: var(--gold-lighter); }
}
.bd-btn:active:not(:disabled) { transform: scale(0.98); }
.bd-btn:disabled {
  background: var(--gray-100); color: var(--dark-muted); border-color: var(--gray-200);
  box-shadow: none; filter: none; transform: none; cursor: not-allowed;
}

/* ---------- Field ---------- */
.bd-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.bd-label { font-size: 0.88rem; font-weight: 700; color: var(--dark-primary); }
.bd-input {
  width: 100%; padding: 14px var(--sp-4);
  border: 2px solid var(--gray-200); border-radius: var(--r-field);
  font: inherit; font-size: 0.95rem; color: var(--dark-primary); background: var(--white);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.bd-input::placeholder { color: var(--dark-soft); }
.bd-input:focus { outline: none; border-color: var(--gold-primary); box-shadow: 0 0 0 4px var(--focus-ring); }
textarea.bd-input { min-height: 100px; resize: vertical; }
.bd-input[aria-invalid="true"] { border-color: var(--red-primary); }
.bd-hint { font-size: 0.75rem; font-weight: 500; color: var(--dark-muted); }
.bd-error { font-size: 0.75rem; font-weight: 700; color: var(--red-strong); }
.bd-input:disabled { background: var(--gray-50); color: var(--dark-muted); cursor: not-allowed; }

/* ---------- Card ---------- */
.bd-card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--r-card); padding: var(--sp-8);
  box-shadow: var(--shadow-card);
}
.bd-card__title { margin: 0 0 var(--sp-6); font-size: 1.2rem; font-weight: 900; line-height: 1.55; }
.bd-card--stat { padding: var(--sp-5) var(--sp-4); text-align: center; }
.bd-card__value { font-size: 1.6rem; font-weight: 900; line-height: 1.3; font-variant-numeric: tabular-nums; }
.bd-card__label { font-size: 0.8rem; color: var(--dark-muted); }
.bd-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--gray-100);
  border-radius: var(--r-sm); background: var(--white); box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.bd-row:hover { border-color: var(--gold-light); box-shadow: var(--shadow-md); }
@media (max-width: 640px) {
  .bd-card { border-radius: 20px; padding: var(--sp-6) var(--sp-4); }
}

/* ---------- Badge ---------- */
.bd-badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 800; line-height: 1.6; white-space: nowrap;
  background: var(--gray-100); color: var(--dark-secondary);
}
.bd-badge--gold { background: var(--gold-lighter); color: var(--gold-darker); }
.bd-badge--ok { background: var(--green-light); color: var(--green-dark); }
.bd-badge--error { background: var(--red-light); color: var(--red-dark); }
.bd-badge--info { background: var(--blue-light); color: var(--blue-dark); }
.bd-badge .icu { width: 1.1em; height: 1.1em; }

/* ---------- Modal ---------- */
.bd-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  background: var(--overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bd-overlay[hidden] { display: none; }
.bd-modal {
  position: relative; width: 100%; max-width: 440px;
  background: var(--white); border-radius: var(--r-card); padding: var(--sp-8);
  box-shadow: var(--shadow-modal);
}
.bd-modal__title { margin: 0 0 var(--sp-5); font-size: 1.2rem; font-weight: 900; text-align: center; }
.bd-modal__close {
  position: absolute; top: var(--sp-4); inset-inline-end: var(--sp-4);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-pill); background: var(--gray-100); color: var(--dark-secondary); cursor: pointer;
}
.bd-modal__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); }
.bd-modal__actions > * { flex: 1; }
@media (max-width: 640px) {
  .bd-overlay { align-items: flex-end; padding: 0; }
  .bd-modal { max-width: none; border-radius: var(--r-card) var(--r-card) 0 0; padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .bd-btn, .bd-input, .bd-row { transition: none; }
  .bd-btn:active:not(:disabled) { transform: none; }
}

/* ---------- Dialog (bd-dialog.js) ---------- */
.bd-dialog { z-index: 2500; }
.bd-dialog__msg { margin: 0; text-align: center; white-space: pre-line; line-height: 1.9; font-weight: 700; color: var(--dark-primary); }
.bd-dialog .bd-input { margin-top: var(--sp-5); }
.bd-dialog .bd-modal__actions .bd-btn { min-height: 46px; }
