@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

/* Sempanta — общие стили для информационных/служебных страниц (Фаза 2).
   Палитра и "стекло" повторяют sempanta_web_platform_002.html, чтобы все страницы
   выглядели одним продуктом, а не набором разных прототипов. */

:root {
  --bg-dark: #050914;
  --bg-elevated: #0b1222;
  --panel-bg: rgba(11, 18, 34, 0.78);
  --panel-strong: rgba(14, 23, 42, 0.94);
  --panel-border: rgba(148, 197, 255, 0.13);
  --primary: #0b8bd3;
  --accent: #55c9ff;
  --accent-glow: rgba(56, 189, 248, 0.35);
  --b2b-color: #6366f1;
  --green-action: #22c55e;
  --danger: #f87171;
  --text-main: #f8fafc;
  --text-muted: #9cabc0;
  --gold: #fbbf24;
  --radius-lg: 22px;
  --radius-md: 14px;
  --ease-out: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Space Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 16% 0%, rgba(14, 165, 233, 0.12), transparent 31rem),
    radial-gradient(circle at 88% 18%, rgba(99, 102, 241, 0.10), transparent 28rem),
    linear-gradient(155deg, #050914 0%, #07101f 52%, #050914 100%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

a { color: inherit; text-decoration: none; }

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px 64px;
}

header.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0 20px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--panel-border);
}

.brand { display: flex; align-items: center; gap: 12px; transition: transform .25s var(--ease-out); }
.brand:hover { transform: translateY(-1px); }
.brand-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, #0b8bd3, #55c9ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 850; font-size: 20px; box-shadow: 0 0 28px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-title {
  font-size: 20px; font-weight: 800; letter-spacing: 0.6px;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-subtitle { font-size: 10px; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; }

.nav-links { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: rgba(8,14,27,.55); border: 1px solid var(--panel-border); border-radius: 999px; backdrop-filter: blur(18px); }
.nav-item {
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  padding: 7px 12px; border-radius: 16px; transition: color .2s, background .2s, transform .2s;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.nav-item.b2b-pill { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, 0.4); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-nav {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--panel-border);
  color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 650; cursor: pointer;
  transition: transform .2s var(--ease-out), background .2s, border-color .2s, box-shadow .2s;
}
.btn-nav:hover { transform: translateY(-1px); background: rgba(255,255,255,.1); border-color: rgba(148,197,255,.28); }
.btn-nav.highlight { background: linear-gradient(135deg, var(--primary), #0369a1); border-color: rgba(85,201,255,.45); box-shadow: 0 10px 30px rgba(2,132,199,.2); }

.panel {
  position: relative;
  background: linear-gradient(145deg, rgba(18, 29, 50, 0.86), rgba(8, 14, 27, 0.82));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(22px);
  animation: panel-in .55s var(--ease-out) both;
}

@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.12; font-weight: 820; letter-spacing: -.025em; margin-bottom: 8px; }
h2 { font-size: 17px; font-weight: 800; margin: 22px 0 10px; color: #fff; }
h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--accent); }
p { font-size: 13.5px; color: #cbd5e1; margin-bottom: 8px; }
ul, ol { padding-left: 20px; margin-bottom: 10px; }
li { font-size: 13.5px; color: #cbd5e1; margin-bottom: 4px; }

.subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.callout {
  background: rgba(56, 189, 248, 0.08); border-left: 4px solid var(--accent);
  padding: 13px 16px; border-radius: 10px; margin: 14px 0; font-size: 13px; color: #e0f2fe;
}
.callout.danger { background: rgba(248, 113, 113, 0.08); border-left-color: var(--danger); color: #fecaca; }

.badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; background: #e0f2fe; color: var(--primary);
  padding: 3px 9px; border-radius: 4px;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12.5px; }
th, td { border: 1px solid var(--panel-border); padding: 8px 10px; text-align: left; }
th { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); font-weight: 700; }

/* Forms — shared across auth/b2b/cabinet pages */
form.stack { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.field input, .field select, .field textarea {
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--panel-border);
  border-radius: 11px; padding: 11px 13px; color: #fff; font-size: 13px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(85,201,255,.72); box-shadow: 0 0 0 4px rgba(56,189,248,.09); background: rgba(255,255,255,.065); }
.field select option { color: #111827; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

button.btn-primary, .btn-cockpit {
  background: linear-gradient(135deg, #0284c7, #0369a1); color: #fff; border: none;
  padding: 11px 18px; border-radius: 22px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 28px rgba(2,132,199,.2); transition: transform .2s var(--ease-out), filter .2s, box-shadow .2s;
}
button.btn-primary:hover, .btn-cockpit:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 14px 34px rgba(2,132,199,.28); }
button.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
button.btn-secondary {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--panel-border); color: #fff;
  padding: 10px 16px; border-radius: 22px; font-size: 12.5px; font-weight: 650; cursor: pointer;
  transition: transform .2s, background .2s, border-color .2s;
}
button.btn-secondary:hover { transform: translateY(-1px); background: rgba(255,255,255,.1); border-color: rgba(148,197,255,.25); }
button.btn-secondary.danger { color: #fca5a5; border-color: rgba(248,113,113,.22); }
button.btn-secondary.danger:hover { background: rgba(248,113,113,.1); }
button.btn-b2b { background: linear-gradient(135deg, #4f46e5, #4338ca); color: #fff; border: none; padding: 11px 18px; border-radius: 22px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .2s, filter .2s; }
button.btn-b2b:hover { transform: translateY(-1px); filter: brightness(1.08); }

.form-error { color: var(--danger); font-size: 12.5px; min-height: 16px; }
.form-success { color: #86efac; font-size: 12.5px; }

.tabs-toggle { display: flex; gap: 6px; background: rgba(0,0,0,0.25); padding: 4px; border-radius: 14px; margin-bottom: 16px; width: fit-content; }
.tabs-toggle button { background: transparent; border: none; color: var(--text-muted); font-size: 12.5px; font-weight: 700; padding: 8px 16px; border-radius: 10px; cursor: pointer; }
.tabs-toggle button.active { background: rgba(56,189,248,0.15); color: var(--accent); }

.list-card {
  background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border);
  border-radius: var(--radius-md); padding: 15px 17px; margin-bottom: 10px;
  transition: transform .22s var(--ease-out), border-color .22s, background .22s;
}
.list-card:hover { transform: translateY(-2px); border-color: rgba(85,201,255,.22); background: rgba(255,255,255,.045); }
.list-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-pill { font-size: 10.5px; font-weight: 800; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,0.08); color: var(--text-muted); }
.status-pill.requested { background: rgba(251, 191, 36, 0.15); color: var(--gold); }
.status-pill.confirmed { background: rgba(56, 189, 248, 0.15); color: var(--accent); }
.status-pill.handed_off, .status-pill.delivered { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.status-pill.completed { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.status-pill.cancelled { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

.chat-box { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding: 10px; background: rgba(0,0,0,0.25); border-radius: 10px; margin-bottom: 10px; }
.chat-msg { font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.05); max-width: 80%; }
.chat-msg.mine { align-self: flex-end; background: rgba(2, 132, 199, 0.25); }
.chat-msg .author { font-size: 10.5px; color: var(--text-muted); margin-bottom: 2px; }

.skeleton { position: relative; overflow: hidden; min-height: 70px; background: rgba(255,255,255,.035); border-radius: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* --- Mobile (phones/small tablets) --- */
@media (max-width: 760px) {
  .page-shell { padding: 14px; }
  header.site-header { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 14px; margin-bottom: 20px; }
  .brand-title { font-size: 17px; }
  #navSlot { width: 100%; }
  .nav-links { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-inline: contain; padding: 4px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; white-space: nowrap; }
  .header-actions { width: 100%; }
  .panel { padding: 16px 16px; border-radius: 14px; }
  h1 { font-size: 21px; }
  h2 { font-size: 15px; }
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  form.stack { max-width: 100%; }
}

@media (max-width: 480px) {
  .field-row { flex-direction: column; gap: 12px; }
  .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; border-radius: 18px; }
  .nav-item { text-align: center; }
  .nav-item.b2b-pill { grid-column: 1 / -1; }
  .cab-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .cab-tabs button { flex: 0 0 auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
