:root {
  --bg: #0b0f19;
  --surface: #131a2a;
  --surface-2: #1b2438;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === ШАПКА (СМАРТФОН + ПЛАНШЕТ) === */
.hero-header {
  position: relative;
  min-height: 300px;
  background: radial-gradient(circle at 20% 20%, #1e3a8a 0%, #0f172a 55%, #090d16 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  border-bottom: 1px solid var(--border);
}

.hero-custom-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,15,25,0.2) 0%, rgba(11,15,25,0.75) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1040px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 42px;
  flex-wrap: wrap;
}

/* Встроенный макет устройств (показывается, пока не добавлена своя картинка) */
.devices-showcase {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
}

.device-phone {
  width: 112px;
  height: 224px;
  background: #0f172a;
  border: 3px solid #334155;
  border-radius: 22px;
  padding: 10px 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.device-phone::before {
  content: "";
  width: 34px;
  height: 4px;
  background: #334155;
  border-radius: 4px;
  margin: 0 auto 6px;
}

.device-tablet {
  width: 320px;
  height: 215px;
  background: #0f172a;
  border: 4px solid #334155;
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mock-widget {
  background: linear-gradient(135deg, rgba(59,130,246,0.28), rgba(99,102,241,0.18));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px 12px;
}

.mock-time { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.mock-sub { font-size: 10px; color: #cbd5e1; margin-top: 2px; }

.mock-tablet-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  flex: 1;
  margin-bottom: 10px;
}

.mock-apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.device-phone .mock-apps { grid-template-columns: repeat(3, 1fr); }

.mock-icon {
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
}

.mock-icon.blue { background: rgba(59,130,246,0.45); }
.mock-icon.purple { background: rgba(139,92,246,0.45); }
.mock-icon.green { background: rgba(34,197,94,0.4); }
.mock-icon.amber { background: rgba(245,158,11,0.4); }

.mock-dock {
  height: 24px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); }

.hero-text { max-width: 380px; }
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #93c5fd;
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.hero-text h1 { font-size: 28px; line-height: 1.2; margin-bottom: 8px; }
.hero-text p { color: var(--muted); font-size: 15px; }

/* === МЕНЮ ПОД ШАПКОЙ === */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(19, 26, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-left::-webkit-scrollbar { display: none; }

/* Неактивный бренд CAEL */
.nav-brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  cursor: default;
  user-select: none;
  pointer-events: none;
  flex-shrink: 0;
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.7px;
  padding: 8px 14px;
  border-radius: 10px;
  transition: 0.2s;
  white-space: nowrap;
}

.nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-link.active { color: #fff; background: var(--accent); }

.nav-profile-btn {
  text-decoration: none;
  color: #fff;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.2s;
  flex-shrink: 0;
}

.nav-profile-btn:hover { border-color: var(--accent); }
.nav-profile-btn.active { background: var(--accent-soft); border-color: var(--accent); color: #93c5fd; }

/* === КОНТЕЙНЕР И КАРТОЧКИ === */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  flex: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* === АВТОРИЗАЦИЯ И ПРОФИЛЬ === */
.auth-wrapper { max-width: 440px; margin: 16px auto; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: 0.2s;
}

.auth-tab.active { background: var(--surface-2); color: #fff; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: rgba(255,255,255,0.25); }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-full { width: 100%; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.35); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.14); border: 1px solid rgba(34,197,94,0.35); color: #86efac; }

/* Карточка профиля */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.profile-identity { display: flex; align-items: center; gap: 18px; }

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.profile-field {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.profile-field-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.profile-field-val { font-size: 15px; font-weight: 600; margin-top: 4px; word-break: break-word; }

/* === СТРАНИЦА ПРИЛОЖЕНИЯ === */
.app-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 28px;
}

.app-title-block { display: flex; align-items: center; gap: 18px; }

.app-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  flex-shrink: 0;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.pill-accent { background: var(--accent-soft); color: #93c5fd; border-color: rgba(59,130,246,0.3); }

.section-title { font-size: 18px; margin: 28px 0 14px; }

/* Скриншоты */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.shot-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.shot-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.shot-card img { width: 100%; height: 100%; object-fit: cover; }

.shot-placeholder {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.shot-placeholder code {
  display: block;
  margin-top: 8px;
  color: #93c5fd;
  font-size: 11px;
  word-break: break-all;
}

.app-description { color: #cbd5e1; font-size: 15px; margin-bottom: 16px; }
.features-list { list-style: none; display: grid; gap: 8px; }
.features-list li::before { content: "✓ "; color: var(--success); font-weight: 700; margin-right: 6px; }

/* Предыдущие версии */
.versions-list { display: flex; flex-direction: column; gap: 10px; }

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.version-info strong { font-size: 15px; }
.version-info p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* === НОВОСТИ === */
.news-list { display: flex; flex-direction: column; gap: 16px; }
.news-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.news-date { font-size: 13px; color: var(--muted); }
.news-card h3 { font-size: 20px; margin-bottom: 8px; }
.news-card p { color: #cbd5e1; }

/* === LIGHTBOX И ФУТЕР === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 95%; max-height: 90vh; border-radius: 12px; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 38px;
  cursor: pointer;
}

.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.loader { text-align: center; padding: 60px 0; color: var(--muted); }

@media (max-width: 720px) {
  .device-tablet { width: 220px; height: 155px; padding: 10px; }
  .device-phone { width: 84px; height: 165px; }
  .hero-text { text-align: center; }
  .card { padding: 20px; }
}