:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f4ff;
  --text: #0f172a;
  --muted: #4b5a7a;
  --primary: #0b5cff;
  --primary-dark: #0a46c5;
  --border: #d7e0f3;
  --ok: #00a86b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #f8faff 0%, #eef3ff 40%, #f5f7fb 100%);
  color: var(--text);
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: #fff;
  border-radius: 12px;
  padding: .78rem 1.08rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(11, 92, 255, .24);
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; }

.landing-wrap { padding-bottom: 2.2rem; }

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo { display: inline-flex; align-items: center; gap: .62rem; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  color: #07214a;
  background: linear-gradient(145deg, #ffeaab, #d8a44a 60%, #7bb0ff);
  box-shadow: 0 8px 20px rgba(28, 52, 95, .25);
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  letter-spacing: .05em;
}

.brand-text strong { font-size: 1.04rem; color: #113776; }
.brand-text em { margin-top: .2rem; font-style: normal; font-size: .67rem; color: #55668f; }

.landing-nav { display: inline-flex; gap: 1.2rem; align-items: center; }
.landing-nav a { color: #2f4269; text-decoration: none; font-weight: 500; font-size: .94rem; }

.landing-hero {
  margin-top: .7rem;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 1.2rem;
  align-items: stretch;
}

.hero-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.2rem;
  box-shadow: 0 18px 36px rgba(17, 39, 78, .08);
}

.badge {
  display: inline-block;
  border: 1px solid #c5d3f5;
  border-radius: 999px;
  padding: .34rem .7rem;
  font-size: .77rem;
  color: #2f4f8f;
  background: #f4f8ff;
}

.hero-content h1 {
  margin: .85rem 0;
  font-size: clamp(2rem, 4.4vw, 3.55rem);
  line-height: 1.07;
  letter-spacing: -.02em;
}

.hero-content p {
  color: var(--muted);
  margin: 0;
  max-width: 64ch;
}

.hero-actions { display: flex; gap: .64rem; margin-top: 1.15rem; flex-wrap: wrap; }

.hero-bullets {
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 0;
  display: grid;
  gap: .56rem;
}

.hero-bullets li {
  color: #20345d;
  position: relative;
  padding-left: 1.2rem;
}

.hero-bullets li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  left: 0;
  top: .45rem;
}

.hero-visual {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 80% 18%, rgba(14, 98, 255, .35), transparent 34%),
    radial-gradient(circle at 18% 84%, rgba(16, 186, 255, .24), transparent 40%),
    linear-gradient(135deg, #0f2350 0%, #102d69 48%, #0f2f77 100%);
  overflow: hidden;
  min-height: 460px;
  box-shadow: 0 20px 40px rgba(13, 34, 77, .28);
}

.device-card {
  width: min(380px, 86%);
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(190, 213, 255, .35);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(6, 18, 43, .7);
  color: #e7efff;
  backdrop-filter: blur(4px);
}

.device-head {
  font-weight: 700;
  margin-bottom: .8rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid rgba(197, 216, 255, .2);
}

.device-row {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  padding: .4rem 0;
}

.device-row span { color: #b4c8f2; }
.device-row b { color: #f3f7ff; }
.device-row .ok { color: #58e5a3; }

.speed-pill {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: .5rem .9rem;
  color: #0d224e;
  background: linear-gradient(135deg, #daecff, #9ec4ff);
  font-weight: 700;
  font-size: .82rem;
}

.trust-strip {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trust-strip div {
  border: 1px solid #e1e8f8;
  border-radius: 14px;
  padding: .8rem;
  background: #f8faff;
}

.trust-strip strong { display: block; font-size: 1.04rem; color: #143874; }
.trust-strip span { color: var(--muted); font-size: .82rem; }

.feature-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 42, 82, .06);
}

.feature-card h3 { margin-top: 0; margin-bottom: .45rem; }
.feature-card p { margin: 0; color: var(--muted); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.timeline { margin-top: 1rem; }
.timeline h2 { margin: .1rem 0 .6rem; }
.timeline ol { margin: 0; padding-left: 1.1rem; color: #1d3159; }
.timeline li { margin: .4rem 0; }

.center { text-align: center; }
.footer { color: #5b6f97; padding: 1.1rem 0 2rem; }
.auth-wrap { margin-top: 4rem; }
.error { color: #cf3f52; }

.cabinet-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; }
.inline { display: flex; gap: .5rem; }
input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: .65rem .8rem;
}
small { color: var(--muted); }
.messages {
  min-height: 360px;
  max-height: 55vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem;
  margin-bottom: .8rem;
  background: #f8fbff;
}
.msg {
  border-radius: 10px;
  padding: .55rem .7rem;
  margin-bottom: .5rem;
  max-width: 80%;
}
.msg.user { margin-left: auto; background: #1a57d8; color: #fff; }
.msg.admin { background: #dde8ff; color: #1a2b49; }
.meta { display: block; font-size: .72rem; color: #6d7ea3; margin-top: .2rem; }
.admin-grid { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; }
#dialogs { list-style: none; margin: 0; padding: 0; }
#dialogs li { border: 1px solid var(--border); border-radius: 8px; padding: .6rem; margin-bottom: .5rem; cursor: pointer; background:#fff; }
#dialogs li.active { border-color: var(--primary); }
.hidden { display: none; }

@media (max-width: 980px) {
  .landing-nav { display: none; }
  .landing-hero { grid-template-columns: 1fr; }
  .hero-content { padding: 1.5rem; }
}

@media (max-width: 860px) {
  .feature-grid, .cabinet-grid, .admin-grid, .trust-strip { grid-template-columns: 1fr; }
  .hero-visual { min-height: 340px; }
  .topbar { flex-wrap: wrap; padding-top: 1rem; }
}
