/* ═══════════════════════════════════════════════════════════════
   HOUSE BUILDER — shared.css
   Design tokens, typography, base utilities
   Используется на: index.html, auth.html, admin.html, app.html
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  /* Palette */
  --c-bg:        #080c12;
  --c-surface:   #0e1520;
  --c-surface-2: #141d2b;
  --c-border:    rgba(255,255,255,.08);
  --c-border-2:  rgba(255,255,255,.14);

  --c-text:      #e8eef7;
  --c-muted:     #7a8ea8;
  --c-dim:       #3a4a60;

  --c-accent:    #3d7fff;
  --c-accent-2:  #5a9bff;
  --c-accent-glow: rgba(61,127,255,.18);
  --c-accent-dim:  rgba(61,127,255,.08);

  --c-success:   #22d47b;
  --c-warn:      #f5a524;
  --c-danger:    #ff4d4d;

  /* Typography */
  --f-display: 'Playfair Display', Georgia, serif;
  --f-serif:   'Playfair Display', Georgia, serif;
  --f-body:    'Inter', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.6);
  --glow:      0 0 40px rgba(61,127,255,.15);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font-family: var(--f-body);
  font-size: 15px;
  outline: none;
}

/* ── Shared form elements ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.field input, .field select {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r);
  color: var(--c-text);
  padding: 11px 14px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}
.field input::placeholder { color: var(--c-dim); }

/* ── Shared buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
}
.btn-primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  box-shadow: 0 2px 16px rgba(61,127,255,.3);
}
.btn-primary:hover {
  background: var(--c-accent-2);
  box-shadow: 0 4px 24px rgba(61,127,255,.45);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border-2);
}
.btn-ghost:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-accent-dim);
}
.btn-outline {
  background: transparent;
  color: var(--c-accent);
  border-color: var(--c-accent);
}
.btn-outline:hover {
  background: var(--c-accent);
  color: #fff;
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-full { width: 100%; }
.btn-sm { font-size: 12px; padding: 7px 14px; }
.btn-lg { font-size: 16px; padding: 14px 28px; border-radius: var(--r-lg); }

/* ── Shared badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .04em;
}
.badge-blue   { background: var(--c-accent-dim); color: var(--c-accent); border: 1px solid rgba(61,127,255,.25); }
.badge-green  { background: rgba(34,212,123,.1);  color: var(--c-success); border: 1px solid rgba(34,212,123,.25); }
.badge-orange { background: rgba(245,165,36,.1);  color: var(--c-warn);    border: 1px solid rgba(245,165,36,.25); }
.badge-red    { background: rgba(255,77,77,.1);   color: var(--c-danger);  border: 1px solid rgba(255,77,77,.25); }

/* ── Shared nav ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: rgba(8,12,18,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
}
.nav__logo {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav__logo-mark {
  width: 26px; height: 26px;
  background: var(--c-accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.nav__spacer { flex: 1; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Utility ── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.text-muted   { color: var(--c-muted); }
.text-accent  { color: var(--c-accent); }
.text-success { color: var(--c-success); }
.text-danger  { color: var(--c-danger); }

/* ── Toast (shared) ── */
#toast-root {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  pointer-events: all;
  animation: toastIn .2s ease;
  max-width: 340px;
  box-shadow: var(--shadow);
}
.toast-success { background: #0d2a1a; border: 1px solid rgba(34,212,123,.3); color: var(--c-success); }
.toast-error   { background: #2a0d0d; border: 1px solid rgba(255,77,77,.3);  color: var(--c-danger); }
.toast-info    { background: #0d1a2a; border: 1px solid rgba(61,127,255,.3); color: var(--c-accent-2); }
.toast-warn    { background: #2a1e0d; border: 1px solid rgba(245,165,36,.3); color: var(--c-warn); }
.toast__close  { margin-left: auto; cursor: pointer; opacity: .6; background: none; border: none; color: inherit; font-size: 16px; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }

/* ── Error message ── */
.error-msg {
  font-size: 12px;
  color: var(--c-danger);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}
.success-msg {
  font-size: 12px;
  color: var(--c-success);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav { padding: 8px 10px; height: auto; flex-wrap: nowrap; gap: 6px; }
  .nav__spacer { display: none; }
  .nav__links { gap: 6px; flex-wrap: nowrap; width: auto; margin-left: auto; justify-content: flex-end; }
  .nav__links .btn-sm { font-size: 12px; padding: 6px 9px; }
  .btn-lg { font-size: 15px; padding: 12px 22px; }
}
