/* BeBrand · общие стили портала и админки. Токены сняты с макетов. */
:root {
  --red: #C21F2C;
  --red-dark: #9C1822;
  --red-tint: #F7E4E5;
  --ink: #231F1C;
  --muted: #6F6A64;
  --line: #E6E1DB;
  --field: #D9D3CC;
  --card: #F9F7F4;
  --bg: #FFFFFF;
  --ok: #2F7A3E;
  --radius-card: 12px;
  --radius-ctl: 6px;
  --font: "Manrope", -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── каркас ── */
.wrap { max-width: 1104px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 768px; margin: 0 auto; padding: 0 24px; }

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,0.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 30px; height: auto; }
.brand-name { font-size: 18px; font-weight: 500; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1.2; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.who { text-align: right; line-height: 1.25; }
.who-name { font-size: 14px; font-weight: 500; }
.who-note { font-size: 12px; color: var(--muted); }

.footer { border-top: 1px solid var(--line); margin-top: 72px; }
.footer p { margin: 0; padding: 28px 0; font-size: 13px; color: var(--muted); }

/* ── типографика ── */
.eyebrow { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.h1 { margin: 12px 0 0; font-size: 42px; line-height: 1.12; font-weight: 400; letter-spacing: -0.015em; }
.h2 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 400; letter-spacing: -0.01em; }
.h3 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 500; }
.lead { margin: 14px 0 0; max-width: 620px; color: var(--muted); font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
@media (max-width: 640px) { .h1 { font-size: 32px; } }

/* ── элементы управления ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border: none; border-radius: var(--radius-ctl);
  background: var(--red); color: #fff; font-weight: 500; font-size: 14px; cursor: pointer;
  transition: background-color .15s;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 36px; padding: 0 14px; }
.btn-block { width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 12px; border: 1px solid var(--field); border-radius: var(--radius-ctl);
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; transition: border-color .15s;
}
.btn-ghost:hover { border-color: rgba(194,31,44,0.45); }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.btn-icon { width: 36px; padding: 0; }
.link { color: var(--muted); font-size: 14px; background: none; border: none; cursor: pointer; padding: 6px 4px; }
.link:hover { color: var(--red); }

.field { display: block; }
.field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .textarea {
  width: 100%; border: 1px solid var(--field); border-radius: var(--radius-ctl);
  background: #fff; padding: 0 12px; font-size: 14px; outline: none; transition: border-color .15s;
}
.input { height: 44px; }
.textarea { padding: 10px 12px; min-height: 84px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus { border-color: var(--red); }
.input::placeholder, .textarea::placeholder { color: #B5AEA7; }
.error { color: var(--red); font-size: 13px; margin: 8px 0 0; }
.saved { color: var(--ok); font-size: 13px; }

.icon { width: 18px; height: 18px; flex: none; }

/* ── экран входа (общий для портала и админки) ── */
.auth { display: flex; min-height: 100vh; }
.auth-visual {
  position: relative; width: 45%; flex: none;
  background: #3a0508 url("/static/brand/login-bg.jpg") center / cover no-repeat;
  color: #fff; display: flex; align-items: flex-end; padding: 48px;
}
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.45) 100%); }
.auth-visual > div { position: relative; z-index: 1; }
.auth-visual .eyebrow { color: rgba(255,255,255,0.8); }
.auth-visual-title { margin: 14px 0 0; font-size: 56px; line-height: 1; font-weight: 400; letter-spacing: -0.02em; }
.auth-visual-text { margin: 16px 0 0; font-size: 16px; color: rgba(255,255,255,0.85); max-width: 420px; }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form { width: 100%; max-width: 384px; }
.auth-form .brand { margin-bottom: 40px; }
.auth-form .brand img { width: 36px; }
.auth-form h1 { margin: 0; font-size: 30px; font-weight: 400; letter-spacing: -0.01em; }
.auth-form .field { margin-top: 18px; }
.auth-form .btn { margin-top: 24px; }
@media (max-width: 900px) { .auth-visual { display: none; } }

/* ── модальное окно ── */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(35,31,28,0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius-card); max-width: 540px; width: 100%; max-height: 86vh; overflow: auto; padding: 28px; }
.modal-body { margin: 14px 0 18px; max-height: 280px; overflow: auto; font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); }

/* ── состояния загрузки ── */
.skeleton { background: linear-gradient(90deg, #F2EEE9, #F8F5F1, #F2EEE9); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-card); }
@keyframes shimmer { to { background-position: -200% 0; } }
