/* Webbhotellets gemensamma stil: startsida, inloggning, gruppsida och admin. */
:root {
  color-scheme: light dark;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --ink: #1a1d23;
  --muted: #5d6470;
  --line: #dedad1;
  --accent: #2448c8;
  --accent-ink: #ffffff;
  --accent-soft: #e5ebfb;
  --ok: #18794e;
  --ok-soft: #e3f3ea;
  --bad: #b42318;
  --bad-soft: #fbe9e7;
  --warn: #9a5b00;
  --focus: #f0a500;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 20 30 / .05), 0 8px 24px rgb(20 20 30 / .06);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1a1d24;
    --surface-2: #22262f;
    --ink: #eceef2;
    --muted: #a3aab6;
    --line: #2f3440;
    --accent: #8aa7ff;
    --accent-ink: #0c1230;
    --accent-soft: #1f2a4d;
    --ok: #5cd39a;
    --ok-soft: #133426;
    --bad: #ff8a7a;
    --bad-soft: #3a1c19;
    --warn: #f0b25a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(46rem, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: .75rem; top: -3rem; background: var(--surface); padding: .5rem .75rem; border-radius: 8px; z-index: 10; }
.skip:focus { top: .75rem; }

/* Sidhuvud */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand img { width: 2rem; height: 2rem; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; line-height: 1.1; }
.brand span { line-height: 1.15; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: .25rem 1rem; flex-wrap: wrap; justify-content: flex-end; }
.site-header nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 500; padding: .5rem .25rem; }
.site-header nav a:not(.button):hover { color: var(--accent); }
.who { color: var(--muted); font-size: .9rem; }

/* Knappar och fält */
.button, button {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.button:hover, button:hover { filter: brightness(1.08); }
.button.secondary, button.secondary { background: transparent; color: var(--accent); }
button.quiet { background: transparent; border-color: var(--line); color: var(--ink); }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
button.small { min-height: 2.25rem; padding: .3rem .75rem; font-size: .9rem; }
button:disabled { opacity: .5; cursor: default; filter: none; }
label { font-weight: 600; display: block; margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=number] {
  font: inherit; width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); min-height: 2.75rem;
}
input:focus-visible { outline-offset: 0; }
.field { margin-bottom: 1rem; }
.hint { font-size: .9rem; color: var(--muted); margin: .3rem 0 0; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.row .field { margin-bottom: 0; }

/* Kort och paneler */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.card > :last-child { margin-bottom: 0; }
.message { border-radius: 10px; padding: .8rem 1rem; margin: 0 0 1rem; border: 1px solid; }
.message.ok { background: var(--ok-soft); border-color: var(--ok); }
.message.bad { background: var(--bad-soft); border-color: var(--bad); }
.message strong { display: block; }
.message pre { margin: .5rem 0 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 8px; padding: .75rem; font-size: .85rem; max-height: 22rem; overflow: auto; }

.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

/* Startsidan */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background:
    radial-gradient(40rem 22rem at 85% 10%, var(--accent-soft), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.eyebrow { font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 .75rem; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: 0 0 1rem; max-width: 16ch; }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 38rem; margin: 0 0 1.75rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .5rem; }
.section > .wrap > p.muted { margin-top: 0; max-width: 40rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 1.5rem; }
.feature .icon { width: 2.5rem; height: 2.5rem; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: .75rem; }
.feature h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 1.5rem; }
.steps li { counter-increment: step; position: relative; padding-top: 2.75rem; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; }
.steps strong { display: block; margin-bottom: .2rem; }
.steps span { color: var(--muted); }
.rules { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); padding: 0; list-style: none; margin: 1.5rem 0 0; }
.rules li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.alt { background: var(--surface); border-block: 1px solid var(--line); }
.groups { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); margin-top: 1.5rem; padding: 0; list-style: none; }
.groups a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 600; min-height: 3.25rem; }
.groups a:hover { border-color: var(--accent); }
.groups .off { color: var(--muted); font-weight: 500; }
.site-footer { padding: 2rem 0 3rem; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }

/* Inloggning */
.login-page { min-height: calc(100vh - 4rem); display: grid; place-items: center; padding: 2rem 0 4rem; }
.login-card { width: min(26rem, 100% - 2.5rem); }
.login-card h1 { font-size: 1.6rem; margin: 0 0 .35rem; }
.login-card .muted { margin-top: 0; }
.login-card button[type=submit] { width: 100%; margin-top: .5rem; }

/* Gruppsidan och admin */
.page-head { padding: 2rem 0 1rem; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }
main.app { padding-bottom: 4rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
#drop { border: 2px dashed var(--line); border-radius: 12px; padding: 2rem 1rem; text-align: center; transition: border-color .15s, background .15s; }
#drop.over { border-color: var(--accent); background: var(--accent-soft); }
#drop p { margin: 0 0 .25rem; font-weight: 600; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem; }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.button { display: inline-flex; margin: 0; }
label.button:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
progress { width: 100%; height: .6rem; margin-top: 1rem; accent-color: var(--accent); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.25rem; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); padding: .6rem .9rem; min-height: 2.75rem; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 0 -1.4rem; padding: 0 1.4rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tbody th { white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions button + button { margin-left: .35rem; }
.version { color: var(--muted); font-size: .88rem; max-width: 24rem; }
.secret { font-family: var(--mono); background: var(--surface-2); padding: .15rem .45rem; border-radius: 6px; user-select: all; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 1.5rem; width: min(32rem, 100% - 2rem); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(10 12 20 / .45); }
dialog h2 { margin-top: 0; font-size: 1.2rem; }
dialog .row { justify-content: flex-end; margin-top: 1.25rem; }

@media (max-width: 40rem) {
  .brand small { display: none; }
  .site-header nav .hide-small { display: none; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: .5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
[data-user] { display: contents; }
.mt { margin-top: 1rem; }
.flush { margin: 0; }
.health { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
[hidden] { display: none !important; }
