:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232d;
  --text: #e8eaf0;
  --muted: #9aa0b0;
  --accent: #e63946;
  --accent-2: #f4a259;
  --ok: #43c484;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hero {
  text-align: center;
  padding: 64px 16px 48px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(230, 57, 70, 0.25), transparent 70%),
    var(--bg);
}

.hero-sub {
  color: var(--accent-2);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 14px;
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 72px);
  letter-spacing: 2px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.hero-meta span {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
}

section {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}

h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

h3 {
  margin: 24px 0 8px;
  font-size: 16px;
  color: var(--accent-2);
}

.cats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cats li {
  background: var(--surface-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

input, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

input:invalid {
  border-color: var(--accent);
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.1); }

button.ghost {
  background: transparent;
  border: 1px solid var(--surface-2);
  color: var(--muted);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 400;
}

.message {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 14px;
}

.message.ok { color: var(--ok); }
.message.err { color: var(--accent); }

button:disabled { opacity: 0.6; cursor: progress; filter: none; }

.hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--accent-2);
}

.hint:empty { display: none; }

option:disabled { color: var(--muted); }

/* Модальное окно успешной записи */
.modal {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--surface-2);
  border-radius: calc(var(--radius) * 1.6);
  background:
    radial-gradient(360px 180px at 50% 0%, rgba(230, 57, 70, 0.22), transparent 70%),
    var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-card { padding: 32px 28px 24px; }

.modal::backdrop {
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(3px);
}

.modal[open] { animation: modal-in 0.25s ease-out; }

/* без scale: сжатие окна в Chromium вызывает полосы прокрутки внутри dialog */
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
}

.modal-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(230, 57, 70, 0.15);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
}

.modal h2 {
  margin: 0 0 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal-lead {
  margin: 0 0 20px;
  color: var(--muted);
}

.modal-lead strong { color: var(--text); }

.modal-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  text-align: left;
  font-size: 14px;
}

.modal-summary dt { color: var(--muted); }
.modal-summary dd { margin: 0; overflow-wrap: anywhere; }

.modal form button { width: 100%; }

#entry-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

#entry-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 14px;
}

#entry-list li .meta { color: var(--muted); }
#entry-list .empty { color: var(--muted); background: transparent; }
.entries-note { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

label.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

label.consent input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.admin {
  max-width: 1000px;
}

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

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.filter-row select {
  width: auto;
  min-width: 160px;
}

.cat-count {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

#entries-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#entries-table th,
#entries-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-2);
  white-space: nowrap;
}

#entries-table th {
  color: var(--muted);
  font-weight: 600;
}

#entries-table td.empty {
  color: var(--muted);
  text-align: center;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px 48px;
  font-size: 13px;
}
