:root {
  --night: #101a33;
  --night-2: #18264a;
  --red: #b22234;
  --red-d: #8e1a29;
  --gold: #f2c14e;
  --snow: #fbf8f2;
  --ink: #1b1f2a;
  --muted: #6b7180;
  --line: #e6e0d4;
  --green: #1f7a4d;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--night) radial-gradient(ellipse at top, #24386b 0%, var(--night) 60%) no-repeat;
  background-attachment: fixed;
  line-height: 1.5;
}
a { color: var(--red); }
h1, h2 { line-height: 1.2; margin: 0 0 .5em; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 420px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* Hero med julelys */
.hero { position: relative; padding: 34px 26px 22px; overflow: hidden; }
.hero-inner { max-width: 720px; margin: 0 auto; position: relative; }
.hero-img { width: 100%; display: block; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.lights { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.login-btn {
  position: absolute; top: 12px; right: 14px; z-index: 3;
  color: #fff; text-decoration: none; font-weight: 700; font-size: .9rem;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(16,26,51,.75); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px); transition: background .15s;
}
.login-btn:hover { background: var(--red); border-color: var(--red); }
@media (max-width: 560px) { .hero { padding: 48px 18px 18px; } .login-btn { top: 10px; right: 10px; font-size: .8rem; padding: 6px 12px; } }

/* Paneler */
.panel {
  background: var(--snow);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.intro { max-width: 720px; margin: 20px auto; text-align: center; border-top: 6px solid var(--red); }
.intro h1 { color: var(--red); font-size: clamp(1.5rem, 4vw, 2.1rem); }
.intro p { margin: .6em 0; }
.event { font-weight: 600; color: var(--night-2); }
.deadline { display: inline-block; background: #fff3d1; border: 1px solid var(--gold); padding: 6px 14px; border-radius: 999px; }
.closed { text-align: center; }

.group-title {
  color: #fff; font-size: 1.4rem; letter-spacing: .06em; text-transform: uppercase;
  margin: 32px 0 14px; display: flex; align-items: center; gap: 12px;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.25); }

/* Menu-kort */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 3px solid transparent;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
.card input { position: absolute; opacity: 0; pointer-events: none; }
.card:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.card-img { aspect-ratio: 3 / 2; background: #2a2a2c; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.card-title { font-weight: 800; text-transform: uppercase; font-size: .95rem; letter-spacing: .02em; }
.card-desc { color: var(--muted); font-size: .9rem; margin: 6px 0 12px; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 700; }
.pick { font-size: .85rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: #f1ece2; color: var(--ink); }
.pick-on { display: none; }
.card.selected { border-color: var(--red); transform: translateY(-3px); }
.card.selected .pick { background: var(--red); color: #fff; }
.card.selected .pick-on { display: inline; }
.card.selected .pick-off { display: none; }
.card.selected::before {
  content: "✓"; position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); color: #fff; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* Formular */
.form { max-width: 620px; margin: 36px auto 20px; scroll-margin-top: 16px; }
.chosen { background: #fdeaec; border-left: 4px solid var(--red); padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(178,34,52,.15); }
.has-err input, .has-err textarea { border-color: var(--red); background: #fff6f7; }
.err { color: var(--red); font-size: .9rem; margin: 6px 0 0; font-weight: 600; }
.err.big { background: var(--snow); padding: 10px 14px; border-radius: 10px; text-align: center; margin-top: 16px; }
.check { display: flex; gap: 10px; align-items: center; margin: -4px 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.hp { position: absolute; left: -9999px; }
.alert { background: #fdeaec; color: var(--red-d); border: 1px solid #f3b6be; padding: 12px 16px; border-radius: 10px; margin: 16px 0; font-weight: 600; }
.alert.soft { background: #eef6f1; color: var(--green); border-color: #bfe0cd; }

.btn {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px;
}
.btn:hover { background: var(--red-d); }
.btn-big { width: 100%; padding: 15px; font-size: 1.1rem; margin-top: 4px; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }

/* Kvittering */
.thanks { max-width: 620px; margin: 24px auto; text-align: center; }
.thanks-icon { font-size: 3rem; }
.thanks h1 { color: var(--red); }
.receipt { display: flex; gap: 16px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 18px 0; }
.receipt img { width: 130px; aspect-ratio: 3/2; object-fit: cover; border-radius: 8px; }
.receipt-name { font-weight: 800; text-transform: uppercase; }
.receipt-note { color: var(--muted); font-style: italic; }
.receipt-price { font-weight: 700; margin-top: 4px; }

.foot { text-align: center; color: rgba(255,255,255,.6); padding: 30px 16px 40px; font-size: .9rem; }
.foot a { color: rgba(255,255,255,.6); }

/* ---------- Admin ---------- */
.login { margin-top: 12vh; }
.admin-bar { background: rgba(0,0,0,.35); color: #fff; padding: 12px 0; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.admin-bar-in { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.admin-bar nav { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-bar .btn { padding: 8px 14px; font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: var(--snow); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; color: var(--muted); font-size: .9rem; }
.stat-n { font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.tbl-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: left; background: var(--night-2); color: #fff; padding: 8px 10px; font-weight: 600; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:nth-child(even) { background: #f4efe6; }
.tbl tfoot th { background: #fff; color: var(--ink); border-top: 2px solid var(--ink); }
.tbl .r { text-align: right; }
.nowrap { white-space: nowrap; }
.orders tr.is-paid td { color: #4c6b5a; }
.inline { margin: 0; }
.paid-btn { font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 4px 10px; border: 1.5px solid #c9c2b4; background: #fff; color: var(--muted); white-space: nowrap; }
.paid-btn.on { background: var(--green); border-color: var(--green); color: #fff; }
.del-btn { font: inherit; cursor: pointer; border: 0; background: none; color: #b9b3a8; font-size: 1rem; }
.del-btn:hover { color: var(--red); }
details.panel summary { cursor: pointer; font-weight: 700; }
.pw-form { max-width: 360px; margin-top: 14px; }
.print-only { display: none; }
.who { opacity: .7; }
code.pw { font-size: 1.1rem; background: #fff; padding: 2px 8px; border-radius: 6px; }

@media (max-width: 560px) {
  .panel { padding: 18px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: .8rem; }
  .card-desc { font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .pick { text-align: center; }
  .receipt img { width: 96px; }
}

@media print {
  body { background: #fff !important; color: #000; }
  .no-print, .admin-bar nav, .foot { display: none !important; }
  .admin-bar { position: static; background: none; color: #000; padding: 0; }
  .panel, .stat { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .print-only { display: block; }
  .tbl th { background: #222 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .paid-btn { border: 1px solid #000; }
}
