:root {
  --bg: #0a0a0f;
  --card: #1a1a2e;
  --text: #e0e7ff;
  --accent: #00b7ff;
  --accent-secondary: #8b5cf6;
  --glass: rgba(255, 255, 255, 0.05);
  --maxw: 1000px;
  --radius: 8px;
  --pad: 20px;
  --muted: #a5b4fc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto Mono', monospace;
  color: var(--text);
  background: linear-gradient(135deg, #0a0a0f 0%, #14142b 100%);
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

#pin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  background: var(--card);
  padding: var(--pad);
  border-radius: var(--radius);
  border: 1px solid var(--accent-secondary);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 300px;
  width: 100%;
}

.login-container h2 {
  font-family: 'Orbitron', sans-serif;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.login-container input {
  padding: 10px;
  font-size: 14px;
  text-align: center;
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  width: 100%;
  max-width: 200px;
  margin-bottom: 12px;
}

.login-container button {
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  border-radius: var(--radius);
  transition: transform 0.2s ease;
}

.login-container button:hover {
  transform: translateY(-2px);
}

.login-container p#pin-error {
  color: #ff4d4d;
  margin-top: 10px;
  font-size: 12px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 0;
  visibility: visible;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--glass);
  padding-bottom: 16px;
}

.sig {
  width: 60px;
  height: 60px;
  background: var(--glass);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 183, 255, 0.3);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.sig:hover {
  transform: scale(1.05);
}

.sig svg {
  width: 32px;
  height: 32px;
}

.title {
  flex: 1;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
}

p.lead {
  display: none; /* Скрываем p.lead на всех устройствах */
}

main {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--accent-secondary);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  background: var(--glass);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--accent);
  transition: background 0.3s ease;
}

.badge:hover {
  background: var(--accent);
  color: #0a0a0f;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #1a1a2e 0%, #14142b 100%);
  padding: 24px;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
}

.sidebar h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 20px;
  text-transform: uppercase;
  margin-left: 40px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 12px;
}

.sidebar a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.sidebar a:hover {
  background: var(--glass);
  color: var(--accent);
  transform: translateX(5px);
}

.sidebar a.active {
  background: var(--accent);
  color: #0a0a0f;
  font-weight: bold;
}

.toggle-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  background: var(--accent-secondary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  z-index: 1001;
  transition: background 0.3s ease;
}

.toggle-btn:hover {
  background: var(--accent);
}

article {
  color: var(--text);
}

section {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--glass);
  margin-bottom: 16px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 12px;
}

section h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: #cfeef5;
  margin-bottom: 6px;
}

section p, section li {
  font-size: 14px;
  color: #c7d2fe;
  margin-bottom: 12px;
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

ol, ul {
  padding-left: 20px;
}

.quote {
  font-style: italic;
  color: var(--accent);
  padding: 12px;
  border-left: 4px solid var(--accent-secondary);
  background: rgba(139, 92, 246, 0.1);
  border-radius: var(--radius);
  margin: 12px 0;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-secondary) 100%);
  padding: 10px 16px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 183, 255, 0.3);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.ghost:hover {
  background: var(--accent);
  color: #0a0a0f;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 768px) {
  :root {
    --pad: 16px;
    --radius: 6px;
  }
  body {
    padding: 16px;
  }
  .wrap header {
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 900;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass);
  }
  .toggle-btn, .btn.ghost {
    display: none; /* Скрываем toggle-btn и кнопку Печать */
  }
  .sig {
    width: 50px;
    height: 50px;
  }
  .sig svg {
    width: 28px;
    height: 28px;
  }
  .sidebar {
    width: 100%;
    left: -100%;
    background: rgba(26, 26, 46, 0.9); /* Прозрачный фон */
    box-shadow: none;
    padding: 16px;
  }
  .sidebar.open {
    left: 0;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  :root {
    --pad: 12px;
    --radius: 4px;
  }
  h1 {
    font-size: 20px;
  }
  .sig {
    width: 40px;
    height: 40px;
  }
  .sig svg {
    width: 24px;
    height: 24px;
  }
  .badge {
    font-size: 11px;
    padding: 5px 10px;
  }
  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  .sidebar {
    width: 100%;
    left: -100%;
    background: rgba(26, 26, 46, 0.9);
    box-shadow: none;
    padding: 12px;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  main, section {
    background: none;
    border: none;
    box-shadow: none;
  }
  .btn, .controls, .sidebar, .toggle-btn, #pin-overlay {
    display: none;
  }
  .sig {
    display: none;
  }
  h1, section h2, section h3 {
    color: #000;
  }
  .quote {
    border-left-color: #000;
    background: none;
  }
}