:root {
  --paper: #f4f4ee;
  --paper-deep: #41e215;
  --ink: #3f2e20;
  --ink-soft: #f49178;
  --line: #9e812a;
  --heart: #a8402a;
  --heart-soft: #e7c9bf;
  --cross: #35536b;
  --cross-soft: #cdd9e1;
  --good: #4c7a52;
  --radius: 3px;
  --shadow: 0 1px 0 var(--line);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .brand {
  font-family: "Unbounded", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

code, .mono, .serial, .bits {
  font-family: "IBM Plex Mono", monospace;
}

a { color: var(--ink); }
a.quiet { 
  color: var(--ink-soft);
  text-decoration: none; 
  transition: color 0.2s ease;
  font-size: 14px
}
a.quiet:hover { 
  color: var(--ink);
  text-decoration: none; }

/* ---------- nav ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .brand .dot { width: 8px; height: 8px; background: var(--heart); border-radius: 50%; display: inline-block; }
.topbar nav { display: flex; gap: 20px; align-items: center; font-size: 14px; }
.topbar nav .rank {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: var(--radius);
}

main { flex: 1; padding: 40px 24px 80px; }

.container { max-width: 640px; margin: 0 auto; }
.container.wide { max-width: 980px; }

footer {
  padding: 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  font-family: "IBM Plex Mono", monospace;
}

/* ---------- cards / forms ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; margin-top: 16px; }
label:first-child { margin-top: 0; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--cross);
  outline-offset: 1px;
}


/*окно восстановления пароля */
.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.50); /* Полупрозрачный фон */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

button, .btn {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--ink);
}
button.danger { border-color: var(--heart); background: var(--heart); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.small { padding: 6px 10px; font-size: 12px; }

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

.error { color: var(--heart); font-size: 13px; margin-top: 10px; min-height: 1em; }
.hint { color: var(--ink-soft); font-size: 13px; }
.muted { color: var(--ink-soft); }

.badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.badge.ok { border-color: var(--good); color: var(--good); }
.badge.warn { border-color: var(--heart); color: var(--heart); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 500; font-family: "IBM Plex Mono", monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button {
  background: none; border: none; color: var(--ink-soft);
  padding: 8px 4px; border-radius: 0; border-bottom: 2px solid transparent;
  font-size: 14px;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--heart); font-weight: 500; }

/* ---------- device bezel: signature element ---------- */
.device {
  width: 240px;
  margin: 0 auto 20px;
  background: #14120f;
  border-radius: 22px;
  padding: 18px 18px 26px;
  box-shadow: 0 8px 24px rgba(20, 18, 15, 0.25);
}
.device .screen-frame {
  background: #f6f3ea;
  border-radius: 4px;
  padding: 4px;
  position: relative;
  overflow: hidden;
}
.device canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.device .screen-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(20,18,15,0.06) 0 1px, transparent 1px 3px);
  animation: eink-flicker 0.6s steps(4) 1;
  pointer-events: none;
}
@keyframes eink-flicker {
  0% { opacity: 1; } 100% { opacity: 0; }
}
.device .buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding: 0 6px;
}
.device .buttons button {
  width: 42px; height: 42px; border-radius: 50%;
  border: none; font-size: 16px; padding: 0;
}
.device .buttons .heart { background: var(--heart); color: #fff; }
.device .buttons .cross { background: var(--cross); color: #fff; }
.device .buttons .flip { background: #4a463c; color: #fff; }
.device .status {
  text-align: center; margin-top: 10px;
  font-family: "IBM Plex Mono", monospace; font-size: 11px;
  color: #9a9384;
}

@media (max-width: 640px) {
  .topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
  main { padding: 24px 16px 60px; }
  .card { padding: 20px; }
}
