/* eLaim: общие стили сайта. Цвета и формы по устройству elama.ru,
   имена и тексты свои. Шрифты локальные, без внешних CDN в браузере. */

:root {
  --accent: #3A64F8;
  --accent-dark: #2c4fd1;
  --text: #292E3D;
  --text-muted: #6B7280;
  --card-bg: #F9FAFB;
  --bg: #FFFFFF;
  --border: #E5E7EB;
  --yellow: #FFD24C;
  --green: #16A34A;
  --red: #DC2626;
  --radius-btn: 5px;
  --radius-pill: 50px;
  --radius-card: 16px;
  --shadow: 0 4px 24px rgba(41, 46, 61, 0.06);
  --font-head: "Manrope", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--text);
}

h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 18px; }

p { line-height: 1.55; color: var(--text); margin: 0 0 12px; }

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

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

/* Шапка */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}
.logo img { width: auto; height: 32px; }

.main-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.main-nav a:hover { color: var(--accent); text-decoration: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, opacity .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-secondary { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #F0F1F3; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { color: var(--accent); text-decoration: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }

/* Значок «бесплатно» */
.badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

/* Герой */
.hero {
  padding: 64px 20px 40px;
  text-align: center;
  background: linear-gradient(180deg, #F3F5FF 0%, #FFFFFF 100%);
}
.hero h1 { max-width: 760px; margin: 0 auto 24px; }
.hero .lead { max-width: 620px; margin: 0 auto 28px; color: var(--text-muted); font-size: 17px; }

/* Вкладки-пилюли */
.pill-tabs {
  display: inline-flex;
  background: var(--card-bg);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  margin: 32px auto 0;
  flex-wrap: wrap;
  justify-content: center;
}
.pill-tabs button {
  border: none;
  background: transparent;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  height: 50px;
}
.pill-tabs button.active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

/* Карточки трёх колонок */
.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 48px 20px;
  max-width: 1120px;
  margin: 0 auto;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 24px;
}
.card ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 14px; }
.card ul li { margin-bottom: 6px; }
.card .tag-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tag {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Секции */
.section { padding: 48px 20px; }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-title p { color: var(--text-muted); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-item {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.feature-item h3 { margin-bottom: 8px; }
.feature-item p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* Тарифы */
.price-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 32px;
  text-align: center;
}
.price-card .price { font-family: var(--font-head); font-weight: 800; font-size: 36px; margin: 12px 0; }
.price-card .price small { font-size: 14px; font-weight: 600; color: var(--text-muted); }

/* Формы */
.form-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 32px;
}
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 14px;
  background: #fff;
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-msg { font-size: 13px; margin-top: 10px; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: var(--red); }
.form-switch { display: flex; gap: 8px; margin-bottom: 20px; }
.form-switch button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.form-switch button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Подвал */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.site-footer a { color: var(--text-muted); margin: 0 8px; }
.footer-links { margin-bottom: 12px; }

/* Мобильная ширина 375px и меньше */
@media (max-width: 640px) {
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .hero { padding: 40px 16px 28px; }
  .cards-row { grid-template-columns: 1fr; padding: 32px 16px; }
  .feature-grid { grid-template-columns: 1fr; }
  .main-nav { order: 3; width: 100%; justify-content: center; }
  .site-header { justify-content: center; text-align: center; }
  .price-card, .form-card { padding: 22px; }
}

/* ===== Кабинет (пульт) ===== */
.kab-shell { display: flex; min-height: 100vh; }
.kab-side {
  width: 220px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
}
.kab-side .logo { padding: 0 8px 20px; }
.kab-side nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.kab-side nav a:hover, .kab-side nav a.active { background: #fff; box-shadow: var(--shadow); text-decoration: none; }
.kab-main { flex: 1; padding: 24px; min-width: 0; }
.kab-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.kab-topbar h1 { font-size: 22px; margin: 0; }

.kab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kab-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 18px;
}
.kab-card .platform { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.kab-card .sum { font-family: var(--font-head); font-weight: 800; font-size: 22px; margin: 8px 0 2px; }
.kab-card .cur { font-size: 12px; color: var(--text-muted); }
.kab-card .status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-top: 8px;
}
.status-podklyuchen { background: #DCFCE7; color: var(--green); }
.status-oshibka { background: #FEE2E2; color: var(--red); }
.status-zhdet_klyuchey { background: #F1F1F3; color: var(--text-muted); }
.status-otozvan { background: #F1F1F3; color: var(--text-muted); }

.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.connect-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
}
.connect-btn:hover { border-color: var(--accent); }
.connect-btn .plat-name { font-weight: 700; font-size: 14px; }
.connect-btn .plat-hint { font-size: 12px; color: var(--text-muted); }
.connect-btn[disabled] { opacity: .55; cursor: not-allowed; }
.soon-tag { font-size: 11px; background: #F1F1F3; color: var(--text-muted); padding: 2px 8px; border-radius: var(--radius-pill); }

table.kab-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kab-table th, table.kab-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.kab-table th { color: var(--text-muted); font-weight: 600; }

.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: #FFF7ED;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.alert-row.vid-uchet_pod_voprosom { background: #FEF9C3; }
.alert-row .alert-text { font-size: 14px; }
.alert-row .alert-day { font-size: 12px; color: var(--text-muted); }

.change-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
}
.change-card .change-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.change-card .money-delta { font-family: var(--font-head); font-weight: 800; font-size: 18px; }
.money-delta.up { color: var(--red); }
.money-delta.down { color: var(--green); }
.change-actions { display: flex; gap: 10px; margin-top: 12px; }

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

.date-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-range input { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-btn); font-size: 13px; }

.currency-group { margin-bottom: 8px; font-size: 13px; color: var(--text-muted); }

@media (max-width: 900px) {
  .kab-shell { flex-direction: column; }
  .kab-side { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .kab-side nav { display: flex; overflow-x: auto; gap: 4px; }
  .kab-side nav a { white-space: nowrap; margin-bottom: 0; }
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  z-index: 100;
  max-width: 90vw;
}
