/* ============================================================
   Turbo Remastered – scenelys over lilla natt
   ============================================================ */
:root {
  --night:   #1A1630;   /* bakgrunn */
  --stage:   #262043;   /* flater */
  --rim:     #3A3260;   /* kanter */
  --paper:   #F4F1FA;   /* tekst */
  --dim:     #A79FC4;   /* sekundær tekst */
  --amber:   #F2A93B;   /* scenelys / fokus */
  --go:      #2FAE6A;   /* kan øve */
  --stop:    #DE4B44;   /* blokkert */
  --radius-s: 6px;
  --radius-l: 14px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--paper);
  background: var(--night);
}
a { color: var(--amber); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
code { font-size: .9em; background: var(--night); padding: 1px 5px; border-radius: 4px; }

/* ---------- Forside ---------- */
body.front {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(26,22,48,.25) 0%, rgba(26,22,48,.55) 55%, rgba(26,22,48,.92) 100%),
    url("img/forside.jpg") center / cover no-repeat,
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(242,169,59,.45), transparent 70%),
    var(--night);
}
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(28px, 6vh, 64px);
  padding: 24px;
  text-align: center;
}
.bandname {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 125;
  font-size: clamp(2.8rem, 11vw, 8.5rem);
  line-height: .86;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 60px rgba(242,169,59,.35);
  transform: skewX(-4deg);
}
.logo-wrap { margin: 0; }
.logo {
  display: block;
  width: min(560px, 82vw, 62vh);
  height: auto;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,.6));
}
@media (prefers-reduced-motion: no-preference) {
  .logo { animation: lights-up 1.1s ease-out both; }
}
.login-big {
  display: inline-block;
  min-width: min(320px, 80vw);
  padding: 22px 48px;
  border-radius: 999px;
  background: #fff;
  color: var(--night);
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  letter-spacing: .08em;
  text-decoration: none;
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.login-big:hover { transform: translateY(-2px); box-shadow: 0 14px 50px rgba(242,169,59,.35); }
@media (prefers-reduced-motion: no-preference) {
  .bandname { animation: lights-up 1.1s ease-out both; }
  @keyframes lights-up {
    from { opacity: 0; filter: brightness(.2); }
    to   { opacity: 1; filter: brightness(1); }
  }
}

.login-card {
  width: min(400px, 92vw);
  display: grid;
  gap: 16px;
  padding: 32px 28px;
  background: rgba(38,32,67,.92);
  border: 1px solid var(--rim);
  border-radius: var(--radius-l);
  text-align: left;
  backdrop-filter: blur(6px);
}
.login-card .wordmark { font-size: 1.5rem; margin-bottom: 4px; }
.hint { margin: 0; color: var(--dim); font-size: .9rem; }
.form-error { margin: 0; padding: 10px 12px; border-radius: var(--radius-s); background: rgba(222,75,68,.18); border-left: 3px solid var(--stop); }

/* ---------- Innsiden ---------- */
.wordmark {
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 125;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: -.01em;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(26,22,48,.94);
  border-bottom: 1px solid var(--rim);
  backdrop-filter: blur(8px);
}
.mainnav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.mainnav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}
.mainnav a:hover { color: var(--paper); background: var(--stage); }
.mainnav a[aria-current="page"] { color: var(--night); background: var(--amber); }
.mainnav .logout { margin-left: auto; }

.page { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px) 80px; }
.page-title {
  margin: 0 0 6px;
  font-weight: 900;
  font-variation-settings: "wdth" 118;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
.lede { margin: 0 0 28px; max-width: 68ch; color: var(--dim); }
.muted { color: var(--dim); }
.small { font-size: .875rem; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 20px; }
.span-2 { grid-column: span 2; }
@media (max-width: 720px) { .span-2 { grid-column: auto; } }

.panel {
  background: var(--stage);
  border: 1px solid var(--rim);
  border-radius: var(--radius-l);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.cols .panel { margin-bottom: 0; }
.panel h2 { margin: 0 0 14px; font-size: 1.15rem; font-variation-settings: "wdth" 112; font-weight: 800; }

.flash { margin-bottom: 20px; padding: 12px 16px; border-radius: var(--radius-s); background: rgba(47,174,106,.16); border-left: 3px solid var(--go); }
.flash-error { background: rgba(222,75,68,.16); border-left-color: var(--stop); }

/* ---------- Skjema ---------- */
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
label small { font-weight: 400; color: var(--dim); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=time], textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--rim);
  background: var(--night);
  color: var(--paper);
  font: inherit;
  font-weight: 400;
}
input:focus, textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(242,169,59,.25); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
label.check.inline { display: inline-flex; margin: 0 14px 8px 0; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--amber); }
fieldset { border: 1px solid var(--rim); border-radius: var(--radius-s); padding: 12px 14px 6px; margin: 0; }
legend { padding: 0 6px; font-weight: 600; font-size: .95rem; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row label { flex: 0 0 140px; }
.row .grow { flex: 1 1 220px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--rim);
  background: var(--night);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  justify-self: start;
}
.btn:hover { border-color: var(--dim); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--night); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--amber); }
.btn-ghost { background: transparent; }
.btn-go { background: var(--go); border-color: var(--go); color: #fff; }
.btn-danger { background: var(--stop); border-color: var(--stop); color: #fff; }

.callout { margin-top: 18px; padding: 16px; border-radius: var(--radius-s); background: rgba(242,169,59,.12); border: 1px solid rgba(242,169,59,.4); }
.callout p { margin: 0 0 10px; }

.datelist { list-style: none; margin: 0; padding: 0; }
.datelist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rim); }
.datelist li:last-child { border-bottom: 0; }
.datelist a, .linklike { color: var(--paper); font-weight: 700; text-decoration: none; }
.linklike { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.linklike:hover, .datelist a:hover { color: var(--amber); }

/* ---------- Kalender ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; color: var(--dim); font-size: .92rem; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid var(--rim); }
.sw-green { background: var(--go); border-color: var(--go); }
.sw-red { background: var(--stop); border-color: var(--stop); }
.sw-none { background: var(--night); }
.sw-pending { background: transparent; border: 2px dashed var(--amber); }
.sw-reh { background: var(--night); box-shadow: inset 0 0 0 2px var(--amber); }

.monthnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px 32px; }
.month h2 { margin: 0 0 10px; font-size: 1.3rem; font-weight: 900; font-variation-settings: "wdth" 120; }
.month h2 span { color: var(--dim); font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.wd { text-align: center; font-size: .78rem; color: var(--dim); padding-bottom: 4px; }
.day {
  aspect-ratio: 1;
  min-height: 38px;
  border-radius: var(--radius-s);
  border: 1px solid var(--rim);
  background: var(--night);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  position: relative;
  transition: background-color .12s ease, transform .08s ease;
}
.day:hover:not(:disabled) { border-color: var(--dim); }
.day:active:not(:disabled) { transform: scale(.94); }
.day.green { background: var(--go); border-color: var(--go); color: #fff; }
.day.red { background: var(--stop); border-color: var(--stop); color: #fff; }
.day.pending { border: 2px dashed var(--amber); }
.day.reh::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--amber);
  pointer-events: none;
}
.day.today { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.day.past { opacity: .35; cursor: default; }
.day:disabled { cursor: default; }
.cal-band .day.none, .cal-band .day.red { cursor: default; }
.day.saving { opacity: .6; }
.save-status { min-height: 1.5em; margin-top: 16px; }

.upcoming { margin-top: 32px; max-width: 560px; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(460px, 92vw);
  padding: 26px 26px 22px;
  border: 1px solid var(--rim);
  border-radius: var(--radius-l);
  background: var(--stage);
  color: var(--paper);
}
.dialog::backdrop { background: rgba(10,8,22,.7); }
.dialog h2 { margin: 0 0 4px; font-variation-settings: "wdth" 115; font-weight: 900; font-size: 1.5rem; padding-right: 30px; }
.dialog-close { position: absolute; top: 10px; right: 12px; }
.dialog-close button { background: none; border: 0; color: var(--dim); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.members { list-style: none; padding: 0; margin: 16px 0; }
.members li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--rim); }
.members .a-green { color: var(--go); font-weight: 700; }
.members .a-red { color: var(--stop); font-weight: 700; }
.members .a-none { color: var(--dim); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cancel-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rim); }

/* ---------- Svarside ---------- */
.answers { list-style: none; padding: 0; margin: 0; max-width: 720px; display: grid; gap: 10px; }
.answer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; background: var(--stage); border: 1px solid var(--rim); border-radius: var(--radius-l);
  border-left: 5px solid var(--rim);
}
.answer-green { border-left-color: var(--go); }
.answer-red { border-left-color: var(--stop); }
.answer-open { border-left-color: var(--amber); }
.answer div { display: grid; }
.yn { display: flex; gap: 8px; }

/* ---------- Admin ---------- */
.members-table { display: grid; gap: 12px; }
.member-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.4fr 1fr 1fr auto auto auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--rim);
  border-radius: var(--radius-s);
  background: var(--night);
}
.member-row input { background: var(--stage); }
.member-row label { font-size: .82rem; }
.member-row .check { padding-bottom: 10px; }
.member-row.inactive { opacity: .55; }
@media (max-width: 1000px) { .member-row { grid-template-columns: 1fr 1fr; } }
.tablewrap { overflow-x: auto; }
.log { width: 100%; border-collapse: collapse; font-size: .88rem; }
.log th, .log td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rim); vertical-align: top; }
.log td:last-child { word-break: break-all; color: var(--dim); }
.log .ok { color: var(--go); } .log .fail { color: var(--stop); }
.joblog pre { white-space: pre-wrap; margin: 0; font-size: .9rem; }
.push-row { margin: 16px 0 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .mainnav .logout { margin-left: 0; }
  .grid { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Brukere ---------- */
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 20px;
  padding: 14px 18px; border-radius: var(--radius-l); background: rgba(242,169,59,.12); border: 1px solid rgba(242,169,59,.4); }
.userlist { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.user { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; background: var(--stage); border: 1px solid var(--rim); border-radius: var(--radius-l); }
.user.inactive { opacity: .55; }
.user-main { display: grid; gap: 2px; min-width: 240px; }
.user-name { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.user-contact { font-size: .92rem; word-break: break-all; }
.badge { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rim); color: var(--dim); }
.badge-admin { background: var(--amber); border-color: var(--amber); color: var(--night); }
.status { font-size: .88rem; margin-top: 4px; }
.st-ok { color: var(--go); } .st-wait { color: var(--amber); } .st-none, .st-off { color: var(--dim); }
.user-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.edit summary { list-style: none; }
.edit summary::-webkit-details-marker { display: none; }
.edit[open] { flex-basis: 100%; }
.user:has(.edit[open]) .user-actions { flex-basis: 100%; }
.edit-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rim);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.add-form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.add-user { max-width: 900px; }
.logo-small { width: min(220px, 50vw); }
.card-title { margin: 0; font-size: 1.35rem; font-variation-settings: "wdth" 112; font-weight: 900; line-height: 1.2; }

/* ---------- Admin: de andres markeringer som prikker ---------- */
.others-legend { margin: -4px 0 20px; padding: 14px 16px; background: var(--stage); border: 1px solid var(--rim); border-radius: var(--radius-l); display: grid; gap: 8px; }
.others-legend p { margin: 0; }
.others-order { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.others-order li { display: inline-flex; align-items: center; gap: 6px; }
.dotnum { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: .72rem; font-weight: 800; background: var(--night); border: 1px solid var(--rim); color: var(--dim); }
.with-dots .day .num { position: relative; left: -4px; }
.dots { position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: block; box-shadow: 0 0 0 1.5px var(--night); }
.dot-green { background: #49D98A; }
.dot-red { background: #FF6B63; }
.dot-none { background: transparent; box-shadow: inset 0 0 0 1px rgba(244,241,250,.55); }
.cal.hide-dots .dots { display: none; }
.cal.hide-dots .day .num { left: 0; }
@media (min-width: 700px) { .dot { width: 7px; height: 7px; } }
