/* Cple.se shared theme: "Brungrå" – RAL 7013 brown-grey with Swedish yellow and blue accents. Used by the public site, HV and /konto-vantar/.
   Follows the device's light/dark setting. */
@import url('/fonts/fonts.css');

:root {
  color-scheme: light;

  /* Base colour: RAL 7013 Brungrå, #5A5348 (Pantone 19-0822 TCX), with Swedish yellow and blue accents */
  --brand: #5a5348;

  --bg: #ebe9e4;
  --surface: #f7f6f3;
  --surface-2: #dfdbd3;
  --ink: #1f1c18;
  --muted: #625b50;
  --border: #c9c4b9;

  --header-bg: var(--brand);
  --header-ink: #f4f2ed;
  --header-muted: #d6d0c4;

  --accent: var(--brand);
  --accent-hover: #48423a;
  --accent-ink: #f7f6f3;
  --khaki: #735c00;   /* signal text colour (dark yellow), readable on light backgrounds */
  --stripe: #f0b90b;  /* Swedish yellow: header stripe, active tab, focus */
  --link: #0a5a8f;    /* Swedish blue */

  --ok: #2f6b3a;
  --ok-bg: #d8e9d6;
  --danger: #9b2c22;
  --danger-bg: #f3dad6;
  --warn-bg: #fbf0cc;
  --warn-border: #d4a20a;

  --shadow: 0 1px 2px rgb(31 28 24 / 7%), 0 4px 14px rgb(31 28 24 / 6%);
  --radius: 8px;

  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --font-stencil: 'Saira Stencil One', 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #151412;
    --surface: #1e1c19;
    --surface-2: #29261f;
    --ink: #e9e5dd;
    --muted: #a69f93;
    --border: #3a362f;

    --header-bg: #2a2620;  /* deep shade of the brown-grey */
    --header-ink: #ebe7df;
    --header-muted: #a39c90;

    --accent: #b5ab9a;  /* lighter tint of the brown-grey */
    --accent-hover: #c8bfae;
    --accent-ink: #151412;
    --khaki: #f2c230;
    --stripe: #f2c230;
    --link: #74b4e8;

    --ok: #8cc79a;
    --ok-bg: #1e3123;
    --danger: #ef8f82;
    --danger-bg: #3b1d19;
    --warn-bg: #2e2810;
    --warn-border: #d4a20a;

    --shadow: 0 1px 2px rgb(0 0 0 / 45%);
  }
}

/* --- Base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link);
  text-decoration-thickness: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 1.2em 0 0.4em;
}

h2 {
  font-size: 1.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0.6em 0;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--stripe);
  outline-offset: 2px;
}

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

.lead {
  max-width: 65ch;
  font-size: 1.05rem;
}

/* --- Site header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  color: var(--header-ink);
  border-bottom: 3px solid var(--stripe);
}

.site-header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--header-ink);
  text-decoration: none;
  font-family: var(--font-stencil);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand:hover {
  color: var(--header-ink);
}

.brand small {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--header-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.45rem 0.75rem;
  color: var(--header-muted);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current='page'],
.site-nav a.active {
  color: var(--header-ink);
  border-bottom-color: var(--stripe);
}

/* --- Layout ---------------------------------------------------------------- */

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  min-height: 60vh;
}

.page > :first-child {
  margin-top: 0.4em;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 1.25rem 2rem;
}

/* --- Components ------------------------------------------------------------ */

button,
.btn,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 1rem;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

button:hover,
.btn:hover,
.button-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button.primary,
.btn.primary,
.button-link.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

button.primary:hover,
.btn.primary:hover,
.button-link.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
}

.badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.5rem;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted);
  vertical-align: middle;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.closed {
  background: var(--danger-bg);
  color: var(--danger);
}

.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left-width: 5px;
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  margin: 0.75rem 0;
  max-width: 65ch;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--stripe);
  outline-offset: 0;
  border-color: var(--accent);
}

@media (max-width: 700px) {
  .site-header-inner {
    padding: 0.5rem 1rem;
  }

  .page {
    padding: 1.1rem 1rem 2.5rem;
  }

  .brand {
    font-size: 1.45rem;
  }

  h2 {
    font-size: 1.6rem;
  }
}
