/* ═══════════════════════════════════════════════════════════════
   CIUDAD · режим редактирования (admin)
   Подключается на всех страницах, но видимым становится только
   когда включён режим правки (?edit=1 + вход по паролю).
   ═══════════════════════════════════════════════════════════════ */

/* ── подсветка редактируемых блоков в режиме правки ── */
body.ciudad-editing [data-edit] {
  outline: 1px dashed rgba(107, 155, 210, 0.55);
  outline-offset: 4px;
  border-radius: 2px;
  transition: outline-color 0.2s, background-color 0.2s;
  cursor: text;
}
body.ciudad-editing [data-edit]:hover {
  outline-color: var(--ink-light, #6b9bd2);
  background-color: rgba(107, 155, 210, 0.06);
}
body.ciudad-editing [data-edit][contenteditable="true"]:focus {
  outline: 1px solid var(--ink-light, #6b9bd2);
  background-color: rgba(107, 155, 210, 0.09);
}

/* картинки получают рамку-обёртку с кнопкой «Заменить» */
body.ciudad-editing [data-edit-type="image"] {
  cursor: pointer;
  outline-offset: 2px;
}
.ce-img-wrap {
  position: relative;
  display: inline-block;
}
.ce-img-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a0e14;
  background: var(--ink-light, #6b9bd2);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, background-color 0.15s;
}
.ce-img-btn:hover { transform: translateY(-1px); background: #8ab4e0; }

/* ── нижняя панель управления ── */
.ce-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(10, 14, 20, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(107, 155, 210, 0.35);
  font-family: var(--mono, monospace);
  color: #e8edf4;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
body.ciudad-editing .ce-bar { transform: translateY(0); }

.ce-bar-tag {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-light, #6b9bd2);
  white-space: nowrap;
}
.ce-bar-tag .ce-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ad18a;
  box-shadow: 0 0 0 0 rgba(90, 209, 138, 0.6);
  animation: cePulse 1.8s infinite;
}
@keyframes cePulse {
  0% { box-shadow: 0 0 0 0 rgba(90, 209, 138, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(90, 209, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 209, 138, 0); }
}

.ce-bar-hint {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: #8a97a8;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ce-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(107, 155, 210, 0.4);
  background: transparent;
  color: #e8edf4;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s, opacity 0.2s;
}
.ce-btn:hover { border-color: var(--ink-light, #6b9bd2); color: #fff; }
.ce-btn.primary {
  background: var(--ink-light, #6b9bd2);
  border-color: var(--ink-light, #6b9bd2);
  color: #0a0e14;
}
.ce-btn.primary:hover { background: #8ab4e0; }
.ce-btn.primary:disabled { opacity: 0.5; cursor: default; }

/* ── окно входа по паролю ── */
.ce-login {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 10, 15, 0.92);
  backdrop-filter: blur(10px);
}
.ce-login-box {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  background: #0d1219;
  border: 1px solid rgba(107, 155, 210, 0.3);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.ce-login-tag {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-light, #6b9bd2);
  margin-bottom: 14px;
}
.ce-login-title {
  font-family: var(--display, sans-serif);
  font-size: 22px;
  font-weight: 600;
  color: #f0f4f9;
  margin: 0 0 6px;
}
.ce-login-sub {
  font-size: 12px;
  line-height: 1.6;
  color: #8a97a8;
  margin: 0 0 22px;
}
.ce-login-input {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--mono, monospace);
  font-size: 14px;
  color: #f0f4f9;
  background: rgba(107, 155, 210, 0.06);
  border: 1px solid rgba(107, 155, 210, 0.3);
  outline: none;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.ce-login-input:focus { border-color: var(--ink-light, #6b9bd2); }
.ce-login-row { display: flex; gap: 10px; }
.ce-login-row .ce-btn { flex: 1; text-align: center; }
.ce-login-err {
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: #ff6b6b;
  margin: 0 0 14px;
  min-height: 14px;
  letter-spacing: 0.04em;
}

/* ── всплывающее уведомление ── */
.ce-toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translate(-50%, 16px);
  z-index: 99999;
  padding: 12px 22px;
  font-family: var(--mono, monospace);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #f0f4f9;
  background: #131a24;
  border: 1px solid rgba(107, 155, 210, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.ce-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ce-toast.ok { border-color: rgba(90, 209, 138, 0.6); }
.ce-toast.err { border-color: rgba(255, 107, 107, 0.6); }

@media (max-width: 640px) {
  .ce-bar { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .ce-bar-hint { display: none; }
  .ce-btn { padding: 9px 13px; font-size: 10px; }
}
