/* site/assets/ui-interactions.css — стили для mountModal/mountHeaderMenu/autofill
 * SSOT: docs/ssot/UI_INTERACTION_RULES.md
 * Токены палитры — из DESIGN_SYSTEM.md.
 */

/* =============================================================
 * MODALS
 * ============================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(14, 14, 19, 0.82); /* token: --bg-overlay */
  overflow-y: auto;
}
.modal-overlay.is-open {
  display: flex;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface, #1a1a22);
  color: var(--fg-primary, #f5f5f7);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  padding: 24px 24px 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--fg-primary, #f5f5f7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transition: background 0.15s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}
.modal-close:focus-visible {
  outline: 2px solid var(--primary, #a07cff);
  outline-offset: 2px;
}
.modal-close::before {
  content: "×";
  font-size: 28px;
  font-weight: 400;
}

/* =============================================================
 * HEADER MENU (dropdown)
 * ============================================================= */
.nav-menu[hidden] {
  display: none;
}
.nav-menu.is-open {
  display: block;
}
/* Удаляет дубль логотипа если случайно вложен */
.nav-menu .logo,
.nav-menu .brand,
.nav-menu [data-logo] {
  display: none !important;
}

/* =============================================================
 * AUTOFILL BADGE (калькулятор)
 * ============================================================= */
.autofill-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--bg-surface-muted, rgba(160, 124, 255, 0.08));
  border: 1px solid var(--border-primary, rgba(160, 124, 255, 0.24));
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.4;
}
.autofill-badge strong {
  color: var(--primary, #a07cff);
}
.autofill-change {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.16));
  color: var(--fg-primary, #f5f5f7);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.autofill-change:hover {
  border-color: var(--primary, #a07cff);
  background: rgba(160, 124, 255, 0.06);
}

/* =============================================================
 * MIN SIZES FOR INPUTS (UI_INTERACTION_RULES.md#3)
 * ============================================================= */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
  min-height: 44px;
  font-size: 16px;
  padding: 10px 14px;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  textarea,
  select {
    min-height: 48px;
    font-size: 16px; /* критично для iOS — иначе zoom */
    padding: 12px 16px;
  }
}
