/* ── SEARCH + FILTER BAR ── */

.search-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.search-filter-input,
.search-filter-price,
.search-filter-select {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-filter-input:focus,
.search-filter-price:focus,
.search-filter-select:focus {
  border-color: var(--accent);
}

.search-filter-input {
  flex: 1;
  min-width: 180px;
}
.search-filter-price {
  width: 100px;
}
.search-filter-select {
  cursor: pointer;
}

.search-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.search-filter-clear:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Count of active filters. Hidden via the [hidden] attribute when zero, so the
   button reads simply "Clear" until a filter is actually applied. */
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 600;
}

.filter-count[hidden] {
  display: none;
}

/* ── AUTH PAGES: LOGIN / REGISTER / PROFILE ── */

.auth-page {
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 7vw;
}

.auth-intro {
  max-width: 620px;
}

.auth-intro .hero-tag {
  margin-bottom: 1rem;
}

.auth-intro h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 1;
  margin-bottom: 1.2rem;
}

.auth-intro p {
  max-width: 520px;
  line-height: 1.8;
  opacity: 0.85;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  justify-self: end;
  padding: 2.2rem;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.auth-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.auth-card .auth-subtitle {
  margin-bottom: 1.5rem;
  opacity: 0.75;
  line-height: 1.6;
}

.auth-form {
  width: 100%;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group label {
  margin-bottom: 0.4rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font-family: 'Jost', sans-serif;
  font-size: 1rem;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.form-group select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font-family: 'Jost', sans-serif;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
}

.form-group select:focus {
  border-color: var(--accent);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.5rem 0 1.4rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.remember-row input {
  width: auto;
  accent-color: var(--accent);
}

.auth-btn {
  width: 100%;
  margin-top: 0.2rem;
}

.auth-switch {
  margin-top: 1.4rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-alert {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.d-none {
  display: none;
}

/* Profile page */
.profile-card {
  max-width: 520px;
}

.profile-info {
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-info p {
  margin: 0.7rem 0;
}

.profile-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-actions .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  text-decoration: none;
}

/* ── Inline field validation ── */

.form-group input.input-error {
  border-color: #c0392b;
  background: rgba(192, 57, 43, 0.05);
}

.field-error {
  display: block;
  margin-top: 0.3rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  color: #c0392b;
}

/* ── Password requirements checklist ── */

.password-reqs {
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.password-req {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}

.password-req.met {
  color: #5a9e6a;
}

.password-req i {
  font-size: 0.72rem;
  flex-shrink: 0;
}

/* ── Post-registration success banner ── */

.auth-success {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(90, 158, 106, 0.45);
  background: rgba(90, 158, 106, 0.08);
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  color: #5a9e6a;
}

/* ── AI Analyse Section ── */

.analyse-section {
  margin-bottom: 1.4rem;
}

.analyse-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.analyse-header > i {
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.analyse-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.analyse-desc {
  font-size: 0.8rem;
  opacity: 0.65;
  line-height: 1.5;
}

.upload-zone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px dashed var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.upload-zone:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.upload-zone > i {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.upload-zone input[type='file'] {
  display: none;
}

.analyse-btn {
  width: 100%;
  margin-left: 0;
}

.analyse-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

/* ── CHAT PAGE ── */

.chat-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 60px);
  border-top: 1px solid var(--border);
}

.chat-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.chat-sidebar-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--accent);
  margin: 0;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.chat-item:hover,
.chat-item.active {
  background: var(--card);
}

.chat-item-icon {
  font-size: 1.5rem;
  color: var(--muted);
  flex-shrink: 0;
}

.chat-item-name {
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
}

.chat-window {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.chat-window-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.chat-window-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--text);
  margin: 0;
}

.chat-placeholder {
  font-family: 'Jost', sans-serif;
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.msg {
  display: flex;
  max-width: 65%;
}

.msg.sent {
  align-self: flex-end;
}

.msg.received {
  align-self: flex-start;
}

.msg-bubble {
  display: inline-block;
  padding: 10px 14px;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  border-radius: 2px;
}

.msg.sent .msg-bubble {
  background: var(--accent);
  color: var(--btn-text);
}

.msg.received .msg-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.msg-img {
  max-width: 200px;
  border: 1px solid var(--border);
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-send-btn {
  padding: 10px 24px;
  flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
    padding: 3rem 6vw;
  }

  .auth-card {
    justify-self: stretch;
    max-width: 100%;
  }

  .auth-intro h1 {
    font-size: 3rem;
  }
}
