:root {
  --paper: #f7f4ee;
  --paper-2: #fffdf8;
  --ink: #1f2421;
  --ink-soft: #4a524d;
  --line: #e2dccf;
  --accent: #0f6e64;       /* mély teal — nyugodt, intézményi */
  --accent-2: #c2543a;     /* meleg terrakotta akcent */
  --ok: #2f7d4f;
  --warn: #b6792a;
  --shadow: 0 1px 2px rgba(31,36,33,.06), 0 8px 24px rgba(31,36,33,.06);
  --radius: 14px;
  --field-bg: #fff;
  --bg-image: url("/public-bg/light");
  --bg-overlay: rgba(247,244,238,.82);
}

:root[data-theme="dark"] {
  --paper: #101513;
  --paper-2: #171f1c;
  --ink: #f3efe4;
  --ink-soft: #c8d0c8;
  --line: #344039;
  --accent: #52b7a9;
  --accent-2: #d88761;
  --ok: #69c28e;
  --warn: #d8a64f;
  --shadow: 0 1px 2px rgba(0,0,0,.22), 0 14px 34px rgba(0,0,0,.28);
  --field-bg: #0f1714;
  --bg-image: url("/public-bg/dark");
  --bg-overlay: rgba(16,21,19,.72);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(var(--bg-overlay), var(--bg-overlay)),
    var(--bg-image) center center / cover fixed no-repeat,
    var(--paper);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 .4em;
}

a { color: var(--accent); }

.wrap { max-width: 720px; margin: 0 auto; padding: 48px 22px 80px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 32px 22px 80px; }

/* --- Publikus űrlap --- */
.public-wrap { position: relative; z-index: 1; }
.masthead { text-align: center; margin-bottom: 36px; }
.masthead .kicker {
  text-transform: uppercase; letter-spacing: .18em; font-size: 12px;
  color: var(--accent); font-weight: 700; margin-bottom: 10px;
}
.masthead h1 { font-size: clamp(30px, 5vw, 46px); }
.masthead p { color: var(--ink-soft); max-width: 48ch; margin: 8px auto 0; }
.masthead .welcome {
  color: var(--ink);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  max-width: 58ch;
  margin-top: 14px;
}

.theme-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: color-mix(in srgb, var(--paper-2) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.theme-choice {
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 10px;
}

.theme-choice.active {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 1080px) {
  body {
    background:
      linear-gradient(var(--bg-overlay), var(--bg-overlay)),
      var(--bg-image) center top / cover fixed no-repeat,
      var(--paper);
  }
  .theme-switcher { position: sticky; top: 0; margin: 12px auto 0; width: max-content; }
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

label { display: block; font-weight: 600; margin-bottom: 8px; }

textarea, input[type="text"], input[type="password"], input[type="email"] {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--field-bg); color: var(--ink);
  font: inherit; resize: vertical;
}
textarea:focus, input:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { min-height: 160px; }

.counter { text-align: right; font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  padding: 13px 24px; border-radius: 10px;
  font: inherit; font-weight: 700;
  transition: transform .05s ease, background .15s ease;
}
.btn:hover { background: #0c5a52; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f0ece2; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-danger { background: var(--accent-2); }

.note { font-size: 13px; color: var(--ink-soft); margin-top: 18px; }

.flash { background: #e8f3ef; border: 1px solid #bfe0d6; color: #0c5a52;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; }
.error { background: #fbeae6; border: 1px solid #f0c4b8; color: #a23b22;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; }
.success-box { text-align: center; padding: 18px; }
.success-box .check {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent);
  color: #fff; display: grid; place-items: center; margin: 0 auto 16px;
  font-size: 28px;
}

.email-gate h2,
.privacy-card h2 {
  font-size: 24px;
  margin-top: 0;
}

.email-gate form + form {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.dev-code {
  background: rgba(182,121,42,.14);
  border: 1px solid rgba(182,121,42,.4);
  border-radius: 10px;
  padding: 10px 12px;
}

/* --- Admin --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); padding: 14px 22px; background: var(--paper-2);
}
.topbar .brand { font-family: "Fraunces", serif; font-weight: 600; font-size: 20px; }
.nav a { margin-left: 18px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--accent); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .num { font-family: "Fraunces", serif; font-size: 34px; line-height: 1; }
.stat .lbl { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
th { background: #efebe1; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.new { background: #eef0ee; color: #4a524d; }
.badge.classified { background: #e8f3ef; color: #0c5a52; }
.badge.needs_review { background: #fdf1e1; color: #9a6418; }
.badge.invalid, .badge.off_topic, .badge.spam { background: #fbeae6; color: #a23b22; }
.issue-line { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 3px 0; }

.progress-card {
  margin-bottom: 24px;
  padding: 22px;
}

.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.progress-head h3 { margin-bottom: 2px; }
.progress-head .note { margin-top: 0; }

.progress-percent {
  min-width: 86px;
  text-align: right;
  font-family: "Fraunces", Georgia, serif;
  font-size: 34px;
  line-height: 1;
  color: var(--accent);
}

.progress-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e2d6;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #52b7a9);
  box-shadow: 0 0 18px rgba(15,110,100,.28);
  transition: width .45s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.progress-done .progress-fill { background: linear-gradient(90deg, var(--ok), #69c28e); }
.progress-error .progress-fill { background: linear-gradient(90deg, var(--accent-2), #d88761); }
.progress-error .progress-percent { color: var(--accent-2); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.spacer { flex: 1; }
.inline-form { display: inline; }
.pill-link { text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); font-size: 14px; }
.pill-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
