/* ==========================================================================
   AI YAY YAY — стиль по design.md (дизайн-язык Сбера: светло, зелёно, просто)
   ========================================================================== */

:root {
  --bg: #f1f4f6;
  --surface: #ffffff;
  --input-bg: #f5f7f8;
  --border: #e4e9ec;
  --text: #1c2430;
  --muted: #7d8b99;
  --green: #21a038;
  --green-dark: #188a2e;
  --green-bg: #e9f7ec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(28, 36, 48, .1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   Кнопки — «таблетки», как в СберБанк Онлайн
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  text-decoration: none !important;
}

.btn:hover { transform: translateY(-1px); text-decoration: none !important; }

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover { background: var(--green-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover { box-shadow: var(--shadow); }

.btn-block { display: block; width: 100%; }

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none !important;
  letter-spacing: .01em;
}

.logo .mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none !important;
}

.main-nav a:hover { color: var(--green-dark); }

.main-nav .btn { padding: 11px 26px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 88px 0 72px;
  text-align: center;
  background: linear-gradient(180deg, var(--green-bg) 0%, var(--bg) 100%);
}

.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  font-weight: 800;
  max-width: 720px;
  margin: 0 auto 16px;
}

.hero h1 .accent { color: var(--green); }

.hero p {
  color: var(--muted);
  font-size: 18px;
  max-width: 520px;
  margin: 0 auto 30px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.hero-chips span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Секции
   -------------------------------------------------------------------------- */

.section { padding: 64px 0; }

.section-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 34px;
}

/* Карточки моделей */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow .2s, transform .15s;
}

.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.card .icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-bg);
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 14px;
}

.card h3 { font-size: 17px; margin-bottom: 4px; }

.card p { color: var(--muted); font-size: 14px; }

/* Шаги */

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Тарифы */

.plan {
  display: flex;
  flex-direction: column;
  position: relative;
}

.plan.featured { border-color: var(--green); border-width: 2px; }

.plan .badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan h3 { font-size: 16px; color: var(--muted); font-weight: 600; }

.plan .price {
  font-size: 34px;
  font-weight: 800;
  margin: 8px 0 4px;
}

.plan .price small { font-size: 14px; color: var(--muted); font-weight: 500; }

.plan ul {
  list-style: none;
  margin: 16px 0 22px;
  flex-grow: 1;
}

.plan li {
  color: var(--muted);
  font-size: 14px;
  padding: 5px 0 5px 26px;
  position: relative;
}

.plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.pay-note {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 26px;
}

/* CTA-полоса */

.cta {
  background: var(--green-bg);
  text-align: center;
  padding: 60px 0;
}

.cta h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }

.cta p { color: var(--muted); margin-bottom: 26px; }

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer nav { display: flex; gap: 22px; }

.site-footer nav a { color: var(--muted); }

.site-footer .disclaimer {
  margin-top: 16px;
  font-size: 12px;
  color: #a3aeb9;
}

/* --------------------------------------------------------------------------
   Вход
   -------------------------------------------------------------------------- */

.auth-wrap {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background: linear-gradient(180deg, var(--green-bg) 0%, var(--bg) 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 34px 30px;
}

.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }

.auth-card .sub {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--input-bg);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 22px;
}

.auth-tabs button {
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(28, 36, 48, .12);
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  background: var(--surface);
}

.auth-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   Чат
   -------------------------------------------------------------------------- */

.chat-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  height: calc(100vh - 68px);
}

.chat-side {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.chat-side .new-chat { white-space: nowrap; text-align: center; }

.balance {
  background: var(--green-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text);
}

.balance .sum { font-size: 22px; font-weight: 800; display: block; margin: 2px 0 4px; }

.balance a { font-size: 13px; font-weight: 600; }

.chat-list-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.chat-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.chat-list a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list a:hover { background: var(--input-bg); }

.chat-list a.active {
  background: var(--input-bg);
  font-weight: 600;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.chat-topbar select {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-topbar .user { font-size: 14px; color: var(--muted); }

.chat-topbar .user a { margin-left: 14px; font-weight: 600; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 78%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 15px;
  white-space: pre-line;
}

.msg.user {
  align-self: flex-end;
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.msg.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.msg .meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.chat-composer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 20px 10px;
}

.composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.composer-row textarea {
  flex: 1;
  resize: none;
  min-height: 50px;
  max-height: 140px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

.composer-row textarea:focus {
  outline: none;
  border-color: var(--green);
  background: var(--surface);
}

.composer-row .send {
  height: 50px;
  padding: 0 26px;
  border-radius: 999px;
}

.composer-hint {
  text-align: center;
  font-size: 12px;
  color: #a3aeb9;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   «О сервисе» и 404
   -------------------------------------------------------------------------- */

.page { padding: 64px 0 72px; }

.page h1 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 20px; }

.page p { color: var(--muted); margin-bottom: 14px; max-width: 700px; font-size: 17px; }

.page p strong { color: var(--text); }

.page h2 { font-size: 22px; margin: 40px 0 16px; }

.faq { max-width: 700px; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq summary::after { content: "+"; color: var(--green); font-size: 20px; }

.faq details[open] summary::after { content: "–"; }

.faq details p { margin: 8px 0 0; font-size: 15px; }

.error-wrap {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, var(--green-bg) 0%, var(--bg) 100%);
}

.error-wrap .code {
  font-size: clamp(84px, 16vw, 140px);
  font-weight: 800;
  line-height: 1;
  color: var(--green);
}

.error-wrap p { color: var(--muted); margin: 14px 0 28px; font-size: 17px; }

/* --------------------------------------------------------------------------
   Адаптивность
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .chat-layout { grid-template-columns: 1fr; }

  .chat-side { display: none; }

  .main-nav a:not(.btn) { display: none; }

  .site-footer .inner { flex-direction: column; text-align: center; }
}
