:root {
  /* Brand palette */
  --primary: #2b4f60;
  --primary-dark: #1e3946;
  --accent: #845450;
  --accent-dark: #6c4440;
  --cream: #ead3cb;
  --sage: #bdc7c9;

  /* Surfaces & neutrals, tinted warm to sit with the brand palette */
  --bg: #faf7f5;
  --surface: #ffffff;
  --surface-alt: #f5eeea;
  --border: #ddd4ce;
  --text: #26333a;
  --muted: #62727a;

  /* Availability semantics - tied to the brand rather than generic
     traffic-light colors: "no" reuses the accent, "yes"/"maybe" are
     muted tones in the same family. */
  --yes: #3e7a5c;
  --yes-light: #e6f1ea;
  --no: #845450;
  --no-light: #f3e6e3;
  --maybe: #9c6f2e;
  --maybe-light: #f7eedb;

  --shadow-sm: 0 1px 2px rgba(38, 51, 58, 0.06), 0 1px 1px rgba(38, 51, 58, 0.05);
  --shadow-md: 0 6px 16px rgba(38, 51, 58, 0.1), 0 2px 6px rgba(38, 51, 58, 0.06);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

header.topbar {
  background: var(--primary);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--accent);
}

header.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

header.topbar .brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

/* En logotyp ur config.json ersätter den lilla accentrutan. */
header.topbar .brand.has-logo::before { display: none; }

header.topbar .brand-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

header.topbar a.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
}
header.topbar a.nav-link:hover { color: white; }

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
  margin-top: 0;
}

h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
  margin: 1.75rem 0 0.85rem;
}
h2:first-child { margin-top: 0; }

label { display: block; font-weight: 600; margin: 1rem 0 0.35rem; }

input[type=text], input[type=password], input[type=email], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=date]:focus, input[type=datetime-local]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 79, 96, 0.14);
}

textarea { resize: vertical; }

code {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

.hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.65rem 1.15rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

button:hover, .btn:hover { background: var(--primary-dark); }
button:active, .btn:active { transform: translateY(1px); }

button:focus-visible, .btn:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.secondary, .btn.secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover { background: var(--cream); }

.slot-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.slot-row input[type=datetime-local] { flex: 1; }
.slot-row:has(input[type=date]) { flex-wrap: wrap; }
.slot-row input[type=date] { flex: 1 1 10rem; min-width: 0; }
.slot-row .slot-time { display: flex; align-items: center; gap: 0.35rem; }
.slot-row select { width: auto; flex: 0 0 auto; }
.slot-row .time-sep { font-weight: 600; }
.slot-row input[type=text] { flex: 1; }
.slot-row button.remove {
  background: var(--no-light);
  color: var(--no);
  border: 1px solid var(--no);
  padding: 0.4rem 0.6rem;
  box-shadow: none;
  font-weight: 500;
}
.slot-row button.remove:hover { background: var(--no); color: white; }

.error-box {
  background: var(--no-light);
  color: var(--accent-dark);
  border: 1px solid var(--no);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.muted { color: var(--muted); }

.slot-card { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; background: var(--surface); }
.slot-card .datetime { font-weight: 700; color: var(--primary); }

.option-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.option {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  flex: 1;
  min-width: 150px;
  text-align: center;
  font-weight: normal;
  margin: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.option:hover { background: var(--bg); }
.option input { margin-right: 0.4rem; }
.option:has(input:checked).opt-yes { background: var(--yes-light); border-color: var(--yes); color: var(--yes); font-weight: 600; }
.option:has(input:checked).opt-no { background: var(--no-light); border-color: var(--no); color: var(--no); font-weight: 600; }
.option:has(input:checked).opt-maybe { background: var(--maybe-light); border-color: var(--maybe); color: var(--maybe); font-weight: 600; }

.poll-list-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.poll-list-item:last-child { border-bottom: none; }

table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: 0.55rem 0.65rem; text-align: left; font-size: 0.92rem; }
th { background: var(--surface-alt); color: var(--primary); font-weight: 700; }

.answer-cell { text-align: center; font-weight: 600; }
.answer-yes { background: var(--yes-light); color: var(--yes); }
.answer-no { background: var(--no-light); color: var(--no); }
.answer-maybe { background: var(--maybe-light); color: var(--maybe); }
.answer-none { color: var(--muted); font-weight: 400; }

.summary-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; }
.badge { border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.8rem; font-weight: 600; display: inline-block; }
.badge-yes { background: var(--yes-light); color: var(--yes); }
.badge-no { background: var(--no-light); color: var(--no); }
.badge-maybe { background: var(--maybe-light); color: var(--maybe); }
