/* ============================================
   HUB GATE — вход и список проектов
   Палитра согласована со SCRAP (тёмная, мягкий контраст)
   ============================================ */

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

:root {
  --bg: #464958;
  --card: #52556655;
  --card-solid: #525566;
  --line: #6b6f85;
  --text: #e2e4ea;
  --text-dim: #b9bdcc;
  --accent: #638ce6;
  --ok: #57c98a;
  --off: #8a8fa3;
  --danger: #e07a7a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(99, 140, 230, 0.35); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Общий каркас === */

.wrap { max-width: 900px; margin: 0 auto; }

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #f0f1f5;
}

.subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

.linkbtn {
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  transition: border-color 0.15s, color 0.15s;
}
.linkbtn:hover { color: var(--text); border-color: var(--text-dim); text-decoration: none; }

/* === Плитки проектов === */

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

.card {
  display: block;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.card-tagline {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  min-height: 38px;
}

.card-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: var(--off);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Индикатор живости туннеля */
.dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--off);
}
.dot.on::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(87, 201, 138, 0.18);
}
.dot.on { color: var(--ok); }

.note {
  margin-top: 26px;
  font-size: 12.5px;
  color: var(--off);
  line-height: 1.6;
}

/* === Страница входа === */

.center {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login {
  width: 100%;
  max-width: 380px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.login h1 { font-size: 22px; margin-bottom: 4px; }
.login .subtitle { margin-bottom: 22px; }

label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 7px;
}

input[type="password"] {
  width: 100%;
  background: #464958;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
input[type="password"]:focus { border-color: var(--accent); }

button {
  width: 100%;
  margin-top: 16px;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  padding: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--danger);
}

/* === Страница «проект оффлайн» === */

.offline {
  width: 100%;
  max-width: 460px;
  text-align: center;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 30px;
}

.offline .sign { font-size: 40px; margin-bottom: 14px; }
.offline p { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 8px; }
.offline .actions { margin-top: 22px; display: flex; gap: 10px; justify-content: center; }
