/* =========================================================================
   KarlCasino.co — designsystem
   Metod: BEM. Tema: kunglig blå + guld (måttfull, lugn ton).
   ========================================================================= */

:root {
  --blue-900: #0a2240;
  --blue-800: #0e2a4d;
  --blue-700: #123a66;
  --blue-600: #005b99;
  --blue-500: #1f6fb0;
  --blue-100: #e5eff7;
  --gold-400: #fcd116;
  --gold-300: #ffe27a;
  --gold-600: #c79a12;
  --ink-900: #1c2733;
  --ink-700: #3a4a5a;
  --ink-500: #5a6b7e;
  --line: #d8e0ea;
  --paper: #f4f7fb;
  --white: #ffffff;
  --ok: #2e7d32;
  --warn: #c1272d;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 6px 24px rgba(10, 34, 64, .10);
  --shadow-lg: 0 12px 40px rgba(10, 34, 64, .18);
  --container: 1160px;
  --font: "Roboto", -apple-system, Segoe UI, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--blue-800); margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Knappar ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 600; cursor: pointer; border: 0;
  padding: 12px 22px; border-radius: var(--radius-sm);
  transition: background .15s, transform .05s, box-shadow .15s;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gold-400); color: var(--blue-900); }
.btn--primary:hover { background: var(--gold-300); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.5); }
.btn--ghost:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.btn--outline { background: transparent; color: var(--blue-600); border: 1.5px solid var(--blue-600); }
.btn--outline:hover { background: var(--blue-100); text-decoration: none; }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 30px; font-size: 1.05rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Header ----------------------------------------------------- */
.header {
  background: linear-gradient(180deg, var(--blue-800), var(--blue-900));
  color: var(--white);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header__bar { display: flex; align-items: center; gap: 20px; padding-block: 12px; }
.header__logo img { height: 40px; display: block; }
.header__spacer { flex: 1; }
.header__actions { display: flex; align-items: center; gap: 10px; }
.header__lang { color: #9db8d6; font-size: .85rem; border: 1px solid rgba(255,255,255,.18);
  padding: 6px 10px; border-radius: var(--radius-sm); }

/* Ansvarsfullt spelande-block i toppen (separat, alltid synligt) */
.rgbar { background: #07182e; border-bottom: 1px solid rgba(252,209,22,.25); }
.rgbar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding-block: 7px; font-size: .82rem; color: #cfe0f2; }
.rgbar__age { background: var(--warn); color: #fff; font-weight: 700; font-size: .8rem;
  padding: 2px 8px; border-radius: 4px; letter-spacing: .02em; }
.rgbar__geo { color: var(--gold-300); font-weight: 600; }
.rgbar__text { color: #aebfd2; }
.rgbar__text a { color: var(--gold-400); font-weight: 600; }
.rgbar__links { display: flex; gap: 6px; margin-left: auto; }
.rgbar__links a { color: #07182e; background: var(--gold-400); font-weight: 600;
  padding: 3px 10px; border-radius: 999px; font-size: .78rem; }
.rgbar__links a:hover { background: var(--gold-300); text-decoration: none; }
.rgbar__lic { color: #7e93aa; font-size: .76rem; }
@media (max-width: 760px) {
  .rgbar__links { margin-left: 0; }
  .rgbar__lic { width: 100%; }
}

/* ---------- Spelmeny ---------------------------------------------------- */
.gamenav { background: var(--blue-700); }
.gamenav__list {
  list-style: none; margin-block: 0; margin-inline: auto; padding: 0; display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: thin;
  justify-content: safe center;
}
.gamenav__item a {
  display: flex; align-items: center; gap: 8px; color: #dce8f5;
  padding: 12px 16px; font-size: .9rem; font-weight: 500; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.gamenav__item a:hover { color: var(--white); text-decoration: none; background: rgba(255,255,255,.06); }
.gamenav__item--active a { color: var(--gold-400); border-bottom-color: var(--gold-400); }

/* ---------- Nav-dropdown (huvudmeny) ----------------------------------- */
.nav { position: relative; }
.nav__toggle { display: none; }
.nav__list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav__list a { color: #dce8f5; padding: 8px 12px; border-radius: var(--radius-sm); font-size: .9rem; }
.nav__list a:hover { background: rgba(255,255,255,.1); text-decoration: none; }

/* ---------- Hjälte/banner ---------------------------------------------- */
.hero {
  background:
    linear-gradient(90deg, rgba(10,34,64,.94) 0%, rgba(10,34,64,.80) 42%, rgba(10,34,64,.55) 100%),
    url('/assets/img/banners/hero.png') center / cover no-repeat,
    var(--blue-900);
  color: var(--white); position: relative; overflow: hidden;
}
/* mjuk guldglöd bakom rubriken för djup */
.hero::after {
  content: ""; position: absolute; right: 28%; top: 0; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(252,209,22,.12), transparent 70%);
  pointer-events: none;
}
.hero__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
  padding-block: 56px; position: relative; z-index: 1; }
.hero__emblem { width: 60px; height: 60px; display: block; margin-bottom: 18px; }
.hero__eyebrow { color: var(--gold-400); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; font-size: .8rem; margin-bottom: 10px; }
.hero h1 { color: var(--white); margin-bottom: 16px; }
.hero__lead { color: #cfe0f2; font-size: 1.1rem; max-width: 48ch; margin-bottom: 24px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__note { margin-top: 18px; color: #9db8d6; font-size: .85rem; }
.hero__card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 24px; backdrop-filter: blur(2px);
}
.hero__card h3 { color: var(--gold-300); }
.hero__list { list-style: none; margin: 0; padding: 0; }
.hero__list li { padding: 8px 0 8px 28px; position: relative; color: #e7eef6; border-bottom: 1px solid rgba(255,255,255,.08); }
.hero__list li:last-child { border-bottom: 0; }
.hero__list li::before { content: ""; position: absolute; left: 0; top: 12px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--gold-400);
  box-shadow: inset 0 0 0 2px var(--blue-900); }

/* ---------- Sektioner -------------------------------------------------- */
.section { padding-block: 48px; }
.section--paper { background: var(--white); }
.section__head { text-align: center; max-width: 60ch; margin: 0 auto 32px; }
.section__head p { color: var(--ink-500); }

/* ---------- Spelkategorier (kort) -------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-100); color: var(--blue-600); margin-bottom: 14px; }
.card__icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.card p { color: var(--ink-500); font-size: .92rem; margin: 0; }

/* kort med bild överst */
.card--media { padding: 0; overflow: hidden; }
.card__media { width: 100%; height: 150px; object-fit: cover; display: block;
  border-bottom: 2px solid var(--gold-400); }
.card--media .card__body { padding: 16px 18px 20px; }

/* ---------- Info-rutor / regulatoriskt --------------------------------- */
.notice {
  border-left: 4px solid var(--blue-600); background: var(--blue-100);
  padding: 16px 18px; border-radius: var(--radius-sm); margin: 18px 0;
}
.notice--warn { border-left-color: var(--warn); background: #fdecec; }
.notice--gold { border-left-color: var(--gold-600); background: #fff8e1; }
.notice p:last-child { margin-bottom: 0; }

.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 22px; }
.feature { text-align: center; padding: 10px; }
.feature__ico { width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center;
  background: var(--blue-100); border-radius: 50%; color: var(--blue-600); }
.feature__ico svg { width: 30px; height: 30px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--ink-500); font-size: .92rem; }

/* ---------- Innehållssidor (legal) ------------------------------------- */
.page { background: var(--white); }
.page__hero { background: linear-gradient(180deg, var(--blue-800), var(--blue-700)); color: var(--white);
  padding-block: 40px; }
.page__hero h1 { color: var(--white); margin: 0; }
.page__hero p { color: #cfe0f2; margin: 8px 0 0; }
.prose { max-width: 820px; margin: 0 auto; padding-block: 40px; }
.prose h2 { margin-top: 1.6em; padding-top: .4em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--blue-100); }
.prose__updated { color: var(--ink-500); font-size: .85rem; }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 28px; }
.toc ul { margin: .4em 0 0; }

/* ---------- Formulär / register ---------------------------------------- */
.form { max-width: 560px; margin: 0 auto; }
.field { margin-bottom: 18px; }
.field__label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink-700); font-size: .95rem; }
.field__hint { color: var(--ink-500); font-size: .82rem; margin-top: 4px; }
.field__error { color: var(--warn); font-size: .82rem; margin-top: 4px; display: none; }
.field.is-invalid .field__error { display: block; }
.field.is-invalid .input { border-color: var(--warn); }
.input, select.input, textarea.input {
  width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white); color: var(--ink-900);
}
.input:focus { outline: 0; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(31,111,176,.15); }
textarea.input { min-height: 120px; resize: vertical; }
.checkrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checkrow input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.checkrow label { font-size: .92rem; color: var(--ink-700); }

/* Stegindikator */
.steps { display: flex; gap: 0; margin-bottom: 28px; counter-reset: step; list-style: none; padding: 0; }
.steps__item { flex: 1; text-align: center; position: relative; font-size: .8rem; color: var(--ink-500); }
.steps__item::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--line); color: var(--white); margin: 0 auto 6px; font-weight: 700;
}
.steps__item::after { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: -1; }
.steps__item:first-child::after { display: none; }
.steps__item.is-active::before { background: var(--blue-600); }
.steps__item.is-done::before { background: var(--ok); content: "✓"; }

.regstep { display: none; }
.regstep.is-active { display: block; }
.reg-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* statusmeddelande (spelpaus etc.) */
.statusbox { padding: 16px; border-radius: var(--radius-sm); margin: 16px 0; font-size: .95rem; }
.statusbox--ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.statusbox--paused { background: #fdecec; border: 1px solid #ef9a9a; color: #8e1c1c; }

/* ---------- Footer ----------------------------------------------------- */
.footer { background: var(--blue-900); color: #b9c8da; margin-top: 56px; }
.footer__top { padding-block: 40px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.footer h4 { color: var(--white); font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 8px; }
.footer__links a { color: #b9c8da; font-size: .92rem; }
.footer__links a:hover { color: var(--white); }
.footer__logos { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding-block: 22px; }
.footer__logos img { height: 38px; opacity: .95; }
.footer__pay { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.footer__pay img { height: 26px; filter: brightness(0) invert(1); opacity: .8; }
.footer__pay img.no-filter { filter: none; opacity: 1; background: #fff; padding: 3px 6px; border-radius: 4px; }
.footer__legal { padding-block: 24px; font-size: .8rem; color: #8ea3ba; line-height: 1.7; }
.footer__legal strong { color: #cdd9e6; }
.footer__badges { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.footer__badges img { height: 44px; }

/* ---------- Åldersgrind ------------------------------------------------ */
.agegate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(7,16,28,.92); backdrop-filter: blur(4px); padding: 20px; }
.agegate[hidden] { display: none; }
.agegate__box { background: linear-gradient(180deg, var(--blue-800), var(--blue-900));
  border: 1px solid rgba(252,209,22,.3); border-radius: var(--radius); padding: 36px 30px;
  max-width: 460px; text-align: center; color: var(--white); box-shadow: var(--shadow-lg); }
.agegate__logo { height: 38px; margin-bottom: 18px; }
.agegate__box h2 { color: var(--white); margin-bottom: 10px; }
.agegate__lead { color: #cfe0f2; }
.agegate__actions { display: flex; gap: 12px; justify-content: center; margin: 22px 0 16px; }
.agegate__under { color: #ffb4b4; font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.agegate__lic { color: #7e93aa; font-size: .76rem; margin: 0; }

/* ---------- Cookiebanner ----------------------------------------------- */
.cookie {
  position: fixed; inset: auto 16px 16px; z-index: 80; max-width: 560px; margin-inline: auto;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px; display: none;
}
.cookie.is-visible { display: block; }
.cookie p { font-size: .9rem; }
.cookie__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Hjälpklasser ----------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.lead { font-size: 1.12rem; color: var(--ink-700); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tag { display: inline-block; background: var(--blue-100); color: var(--blue-700);
  font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }

/* ---------- Responsivt ------------------------------------------------- */
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav__list { display: none; }
}
@media (max-width: 560px) {
  .header__lang { display: none; }
  .steps__item { font-size: 0; }
  .steps__item::before { margin-bottom: 0; }
}

/* ---------- Logotypvägg (footer) -------------------------------------- */
.logowall { padding-top: 6px; }
.logowall__label { text-align: center; color: #7e93aa; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 2px; }
.logowall__row { display: flex; flex-wrap: wrap; gap: 16px 26px; align-items: center;
  justify-content: center; padding-block: 12px; }
.logowall__row + .logowall__label { border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; }
.logowall__row img { height: 24px; max-width: 110px; width: auto; object-fit: contain;
  filter: brightness(0) invert(1); opacity: .7; transition: opacity .15s; }
.logowall__row a:hover img, .logowall__row > img:hover { opacity: 1; }
.logowall__row--providers img { height: 22px; }
.logowall__row--seals img { height: 38px; max-width: 150px; }
.logowall__chip { background: #fff; border-radius: 6px; padding: 4px 8px;
  display: inline-flex; align-items: center; }
.logowall__chip img { filter: none; opacity: 1; height: 30px; }
