﻿:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --warning: #d97706;
  --success: #059669;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --overlay: rgba(15, 23, 42, 0.45);
  --input-bg: #ffffff;
  --toast-bg: #0f172a;
  --toast-text: #f8fafc;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --max: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app > main { flex: 1 0 auto; }
#site-footer {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo__mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav__link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav__link:hover, .nav__link--active {
  color: var(--accent);
  background: var(--accent-soft);
}
.nav__link--cta {
  color: #fff !important;
  background: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 700;
}
.nav__link--cta:hover,
.nav__link--cta.nav__link--active {
  color: #fff !important;
  background: #0d9488;
  border-color: #0d9488;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-auth {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.header-auth--login {
  padding: 8px 16px;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--surface);
}
.header-auth--login:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.header-auth--user {
  padding: 6px 12px 6px 6px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  max-width: 220px;
}
.header-auth--user:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.header-auth__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}
.header-auth__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-auth-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-auth-bar__email {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-auth-bar__role {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  white-space: nowrap;
}
.header-auth--cabinet {
  padding: 8px 14px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
}
.header-auth--cabinet:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow);
}
.header-auth--logout {
  padding: 8px 14px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
}
.header-auth--logout:hover {
  color: var(--danger, #dc2626);
  border-color: var(--danger, #dc2626);
  background: #fef2f2;
}
@media (max-width: 900px) {
  .header-auth-bar__email { max-width: 140px; }
  .header-auth-bar { gap: 6px; }
  .header-auth--cabinet, .header-auth--logout { padding: 7px 10px; font-size: 0.82rem; }
}

/* Личный кабинет */
.cabinet-wrap { padding: 32px 0 56px; }
.cabinet-title { margin: 0 0 20px; font-size: 1.6rem; }
.cabinet-section { margin-top: 28px; }
.cabinet-guest { text-align: center; padding: 40px 0; }
.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.cabinet-profile__head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cabinet-profile__avatar { width: 56px; height: 56px; font-size: 1rem; }
.cabinet-profile__name { font-size: 1.2rem; font-weight: 700; }
.cabinet-profile__meta { color: var(--muted); font-size: 0.9rem; margin: 4px 0 8px; }
.cabinet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.cabinet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin: 16px 0;
}
.cabinet-form-title {
  margin: 24px 0 12px;
  font-size: 1rem;
}
.cabinet-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cabinet-form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .cabinet-form-grid { grid-template-columns: 1fr; }
}
.cabinet-chips { display: flex; flex-direction: column; gap: 12px; }
.cabinet-chip {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cabinet-chip img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}
.cabinet-chip__meta { color: var(--muted); font-size: 0.85rem; }
.profile-hero--edit .profile-hero__inner { align-items: flex-start; }
.badge--edit { margin-left: auto; background: var(--accent-soft); color: var(--accent-hover); }
.btn--sm { padding: 8px 14px; font-size: 0.85rem; }

/* Views */
.view { display: none; flex: 1; }
.view--active { display: block; }

/* Hero + search */
.hero {
  padding: 48px 0 40px;
  text-align: center;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero__subtitle {
  margin: 0 auto 28px;
  max-width: 520px;
  color: var(--muted);
  font-size: 1.05rem;
}
.search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.search__input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search__input::placeholder {
  color: var(--muted);
}
.search__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.search__icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
/* Trust block */
.trust {
  padding: 24px 0 48px;
}
.trust__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.trust__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.trust__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 14px;
}
.trust__card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}
.trust__card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Section */
.section { padding: 0 0 48px; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.section__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.section__meta { font-size: 0.85rem; color: var(--muted); }

/* Agent cards */
.agents { display: grid; gap: 16px; }
@media (min-width: 640px) {
  .agents { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .agents { grid-template-columns: repeat(3, 1fr); }
}
.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}
.agent-card__rank {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.agent-card__bayesian {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.agent-card__bayesian strong { color: var(--accent); }
.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.agent-card__top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.agent-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}
.agent-card__name {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 1rem;
}
.agent-card__inn {
  font-size: 0.75rem;
  color: var(--muted);
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--warning);
}
.rating__star { color: #fbbf24; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.agent-card__stats {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.agent-card__stats strong { color: var(--text); display: block; font-size: 1rem; }

/* Profile */
.profile-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}
.profile-hero__inner {
  display: grid;
  gap: 24px;
}
@media (min-width: 768px) {
  .profile-hero__inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}
.profile-hero__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-soft);
}
.profile-hero__name {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 700;
}
.profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-box__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-box__label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.stat-box--readonly {
  border-style: dashed;
  background: #f8fafc;
}
.stat-box__note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.cabinet-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.cabinet-toolbar--head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cabinet-form-grid--profile textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}
.stats-row--readonly { margin-top: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--block { width: 100%; }

/* Reviews */
.reviews { display: flex; flex-direction: column; gap: 12px; }
.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.review__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.review__author { font-weight: 600; font-size: 0.95rem; }
.review__date { font-size: 0.8rem; color: var(--muted); }
.review__text { margin: 0; font-size: 0.95rem; color: var(--text); }
.review__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 500;
}

/* Form */
.form-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 0 56px;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}
.form-card__hint {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 0.15s, background 0.2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.field textarea { min-height: 120px; resize: vertical; }
.field__hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.stars-input {
  display: flex;
  gap: 6px;
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.stars-input input { display: none; }
.stars-input label {
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--border);
  transition: color 0.1s;
}
.stars-input label:hover,
.stars-input label:hover ~ label,
.stars-input input:checked ~ label { color: #fbbf24; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay--open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h2 { margin: 0 0 8px; font-size: 1.2rem; }
.modal p { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; }
.modal__actions { display: flex; gap: 10px; margin-top: 16px; }
.modal__actions .btn { flex: 1; }

/* Footer */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 20px;
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  padding: 0;
}
.back-link:hover { color: var(--accent); }

.empty { text-align: center; padding: 32px; color: var(--muted); }

/* Auth / вход */
.auth-wrap { max-width: 440px; padding: 40px 0 56px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-title { margin: 0 0 8px; font-size: 1.5rem; font-weight: 700; }
.auth-subtitle { margin: 0 0 24px; color: var(--muted); font-size: 0.95rem; }
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.auth-links a, .auth-foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.auth-links a:hover, .auth-foot a:hover { text-decoration: underline; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 0.9rem; }
.auth-notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.95rem;
  line-height: 1.45;
}
.field__error { color: #b91c1c; font-size: 0.8rem; min-height: 1.25em; margin-top: 4px; }
.auth-root--busy { opacity: 0.85; pointer-events: none; }
.auth-already {
  text-align: center;
  padding-bottom: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.auth-already:not([hidden]) ~ .auth-role-tabs,
.auth-already:not([hidden]) ~ #panelLogin,
.auth-already:not([hidden]) ~ #panelRegister { display: none !important; }

.auth-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-role-tab {
  padding: 14px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.auth-role-tab:hover { border-color: var(--accent); }
.auth-role-tab--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* Password field: toggle, strength, rules */
.pw-field {
  position: relative;
  display: flex;
  align-items: stretch;
}
.pw-field .field__input,
.pw-field input[type="password"],
.pw-field input[type="text"] {
  width: 100%;
  padding-right: 44px;
}
.pw-field__toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.pw-field__toggle:hover { opacity: 0.85; background-color: var(--accent-soft); }
.pw-field__toggle--visible {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M3 3l18 18M10.6 10.6a2 2 0 002.8 2.8M6.7 6.7C4.6 8.1 3 10 2 12c0 0 3.5 7 10 7 1.8 0 3.4-.5 4.8-1.2M17.3 17.3C19.4 15.9 21 14 22 12c0 0-3.5-7-10-7-1.3 0-2.5.3-3.6.7'/%3E%3C/svg%3E");
}

.pw-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.pw-strength__track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.pw-strength__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--warning);
  transition: width 0.2s, background 0.2s;
}
.pw-strength__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 72px;
  text-align: right;
}
.pw-strength--weak .pw-strength__fill { background: #ef4444; }
.pw-strength--medium .pw-strength__fill { background: var(--warning); }
.pw-strength--strong .pw-strength__fill { background: var(--success); }
.pw-strength--weak .pw-strength__label { color: #ef4444; }
.pw-strength--medium .pw-strength__label { color: var(--warning); }
.pw-strength--strong .pw-strength__label { color: var(--success); }

.pw-rules {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}
.pw-rules li {
  position: relative;
  padding-left: 1.25rem;
}
.pw-rules li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: var(--border);
}
.pw-rules li.pw-rules__ok {
  color: var(--success);
}
.pw-rules li.pw-rules__ok::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

.field__input--match { border-color: var(--success) !important; }
.field__input--mismatch { border-color: #ef4444 !important; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 300;
  pointer-events: none;
}
.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Город */
.city-bar {
  max-width: 400px;
  margin: 0 auto 24px;
  text-align: left;
}
.city-bar__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.city-bar__select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.city-bar__select:focus {
  outline: none;
  border-color: var(--accent);
}

.agent-card__city {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}
.agent-card__deals30 {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}
.agent-card__portfolio {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.agent-card__thumb {
  flex: 0 0 72px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
}
.agent-card__thumb:hover { border-color: var(--accent); }

.stats-row--4 {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .stats-row--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Сделки / объекты */
.deals-section { padding-bottom: 40px; }
.deal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.deal-tabs__btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.deal-tabs__btn:hover { border-color: var(--accent); color: var(--accent); }
.deal-tabs__btn--active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.deal-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .deal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .deal-grid { grid-template-columns: repeat(3, 1fr); }
}
.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  width: 100%;
}
.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.deal-card__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: var(--border);
}
.deal-card__body { padding: 14px 16px 16px; }
.deal-card__type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 6px;
}
.deal-card__title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}
.deal-card__price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.deal-card__desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deal-card__status {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.deal-card__status--closed { background: var(--accent-soft); color: var(--accent-hover); }
.deal-card__status--progress { background: rgba(217, 119, 6, 0.15); color: var(--warning); }

.modal--deal {
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}
.deal-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
}
.deal-gallery__img {
  flex: 0 0 85%;
  max-width: 400px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.deal-gallery__img--active { outline: 2px solid var(--accent); }
.deal-detail__price {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 12px;
}
.deal-detail__block {
  margin-bottom: 16px;
}
.deal-detail__block h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.deal-detail__block p { margin: 0; font-size: 0.9rem; }
.deal-history {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
  margin-left: 8px;
}
.deal-history li {
  padding: 0 0 12px 16px;
  position: relative;
  font-size: 0.85rem;
}
.deal-history li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.deal-history__date { color: var(--muted); font-size: 0.75rem; }
.deal-archived-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.deal-archived-link:hover { text-decoration: underline; }

.formula-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.formula-box code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.formula-box strong { color: var(--text); }

.about-page { padding: 40px 0 56px; max-width: 720px; margin: 0 auto; }
.about-page h1 { margin: 0 0 16px; font-size: 2rem; }
.about-page h2 { margin: 28px 0 12px; font-size: 1.2rem; }
.about-page p { margin: 0 0 14px; color: var(--muted); }
.about-page ul { margin: 0 0 16px; padding-left: 20px; color: var(--muted); }

.section__link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}
.section__link:hover { text-decoration: underline; }

/* START FROM HERE — подсказка для разработки */
.sfh-banner {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #fff;
  padding: 16px 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  border-bottom: 3px solid #115e59;
}
.sfh-banner a { color: #ccfbf1; font-weight: 600; }
.sfh-banner a:hover { color: #fff; }
.sfh-banner__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.2);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.sfh-banner__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}
.sfh-banner__text { margin: 0 0 10px; opacity: 0.95; }
.sfh-banner__files {
  margin: 0 0 12px;
  padding-left: 18px;
  opacity: 0.95;
}
.sfh-banner__files code {
  background: rgba(0,0,0,0.2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
}
.sfh-banner__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.8rem;
}
.sfh-banner__nav a.sfh-banner__nav--active {
  color: #fff;
  text-decoration: underline;
}

