/* ── FORMS ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg4);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

/* ── AUTH PAGES ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(245,166,35,.08) 0%, transparent 70%);
}
.auth-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-box__logo { text-align: center; margin-bottom: 28px; }
.auth-box__title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-box__sub { font-size: 14px; color: var(--text2); text-align: center; margin-bottom: 28px; }
.auth-box__footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text2); }
.auth-box__footer a { color: var(--accent); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text3);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── CATALOG PAGE ─────────────────────────────────────────── */
.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 32px 0;
}
.sidebar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 80px;
}
.sidebar__title { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; }
.filter-group { margin-bottom: 24px; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}
.filter-option:hover { background: var(--bg3); }
.filter-option input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.filter-option.active { background: rgba(245,166,35,.1); color: var(--accent); }

/* Online toggle switch */
.online-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  -webkit-user-select: none;
  user-select: none;
}
.online-toggle:hover { border-color: var(--green); background: rgba(46,204,113,.05); }
.online-toggle input[type="checkbox"] { display: none; }
.online-toggle__track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg4);
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}
.online-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text3);
  transition: transform .2s, background .2s;
}
.online-toggle input:checked ~ .online-toggle__track {
  background: rgba(46,204,113,.25);
  border-color: var(--green);
}
.online-toggle input:checked ~ .online-toggle__track .online-toggle__thumb {
  transform: translateX(16px);
  background: var(--green);
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

.price-range { display: flex; gap: 8px; align-items: center; }
.price-range input { flex: 1; }
.price-range span { color: var(--text3); font-size: 13px; }

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.catalog-count { font-size: 14px; color: var(--text2); }
.sort-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--accent); }

/* ── LOT PAGE ─────────────────────────────────────────────── */
.lot-page { padding: 32px 0; }
.lot-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
}
.lot-main {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.lot-breadcrumb {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.lot-breadcrumb a { color: var(--text2); }
.lot-breadcrumb a:hover { color: var(--accent); }
.lot-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.lot-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.lot-desc { font-size: 15px; color: var(--text2); line-height: 1.7; margin-bottom: 24px; }
.lot-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.lot-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text2);
}

.lot-sidebar-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 80px;
}
.lot-price { font-size: 36px; font-weight: 800; color: var(--green); margin-bottom: 6px; }
.lot-price-note { font-size: 13px; color: var(--text3); margin-bottom: 20px; }
.lot-seller {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.lot-seller__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.lot-seller__name { font-size: 14px; font-weight: 600; }
.lot-seller__rating { font-size: 12px; color: var(--accent); }
.lot-seller__online { font-size: 11px; color: var(--green); }

/* ── PROFILE PAGE ─────────────────────────────────────────── */
.profile-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}
.profile-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
}
.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}
.profile-name { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text2); }
.profile-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}
.profile-stat__num { font-size: 22px; font-weight: 700; color: var(--accent); }
.profile-stat__label { font-size: 12px; color: var(--text3); }

.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.profile-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── CHAT ─────────────────────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(99h - 80px);
  overflow: hidden;
  position: fixed;
  top: 90px;
  left: 0;
  right: 0;
  bottom: 0;
}
.chat-list {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.chat-list__header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 700;
}
.chat-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}
.chat-item:hover, .chat-item.active { background: var(--bg3); }
.chat-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.chat-item__name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.chat-item__preview { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.chat-item__time { font-size: 11px; color: var(--text3); margin-left: auto; flex-shrink: 0; }
.chat-item__unread {
  background: var(--accent);
  color: #0f1117;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
}

.chat-window {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.chat-window__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.msg--in {
  background: var(--bg3);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg--out {
  background: var(--accent);
  color: #0f1117;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg__time { font-size: 10px; opacity: .6; margin-top: 4px; }
.msg--system {
  align-self: center;
  max-width: 90%;
  background: rgba(74,158,255,.1);
  border: 1px solid rgba(74,158,255,.25);
  color: var(--blue);
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}
.chat-input-area {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: var(--bg2);
}
.chat-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 18px;
  color: var(--text);
  font-size: 14px;
  resize: none;
  max-height: 120px;
}
.chat-input:focus { outline: none; border-color: var(--accent); }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal__title { font-size: 18px; font-weight: 700; }
.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text2);
  transition: var(--transition);
}
.modal__close:hover { background: var(--bg4); color: var(--text); }

/* ── TOAST ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn .3s ease;
  max-width: 320px;
}
.toast--success { border-left: 3px solid var(--green); }
.toast--error   { border-left: 3px solid var(--red); }
.toast--info    { border-left: 3px solid var(--blue); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── PAGINATION ───────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 32px;
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #0f1117; border-color: var(--accent); font-weight: 700; }

/* ── RESPONSIVE CATALOG ───────────────────────────────────── */
@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .lot-layout { grid-template-columns: 1fr; }
  .lot-sidebar-card { position: static; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { display: none; }
}
