/* ============================================================
   GLOBAL — лёгкие базовые стили, общие для сайта, авторизации
   и (как база) для админки. Подключается первым.
   ============================================================ */

:root {
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-text: #1f2430;
  --c-muted: #6b7280;
  --c-border: #e5e7eb;
  --c-primary: #2563eb;
  --c-primary-hover: #1d4ed8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; line-height: 1.25; font-weight: 700; }
.h1, h1 { font-size: 1.9rem; }
.h2, h2 { font-size: 1.45rem; }
.h3, h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }

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

small, .muted { color: var(--c-muted); font-size: .875rem; }

/* --- Раскладка --- */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.site-main { flex: 1 0 auto; padding: 32px 16px; }

/* --- Шапка / подвал --- */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--c-text); }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: var(--c-text); }

.site-footer { background: var(--c-surface); border-top: 1px solid var(--c-border); margin-top: auto; }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; color: var(--c-muted); font-size: .9rem; }

/* --- Кнопки --- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #eef0f3;
  color: var(--c-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* --- Формы --- */
.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.form-control:focus,
input:focus, textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.field { margin-bottom: 14px; }

/* --- Карточки --- */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* --- Таблицы --- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--c-border); }
th { font-weight: 600; color: var(--c-muted); }

/* --- Центрированная карточка авторизации --- */
.auth { max-width: 380px; margin: 6vh auto; }
.auth .card { padding: 28px; }
.auth h1, .auth .title { text-align: center; font-size: 1.5rem; margin-bottom: 20px; }

/* --- Утилиты --- */
.text-center { text-align: center; }
.stack > * + * { margin-top: 16px; }

@media (max-width: 600px) {
  .site-nav { gap: 12px; font-size: .95rem; }
  .h1, h1 { font-size: 1.55rem; }
}
