/* Köpsidan (index.html), 2026-10-30: samma utseende som farstatk.sportsstream.se – grågrön bakgrund,
   mörkt kort med rundade hörn, limegröna rundade knappar. Mobil: varje steg ryms på en skärm. */
:root {
  --bg: #4c6663;
  --panel: #172723;   /* grönt kort som på sportsstream.se */
  --chip: #1d322d;
  --line: #2f4c45;
  --text: #ffffff;
  --muted: #c4ccc8;
  --ball: #c8e239;
  --ink: #141a14;
  --warn: #f0b35a;
  --gap: clamp(8px, 1.6dvh, 22px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--ball); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app {
  min-height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px 0;
}

/* loggan direkt på bakgrunden som på farstatk.sportsstream.se */
header { display: flex; align-items: center; justify-content: space-between; padding-block: 12px; }
header .logo { display: inline-flex; }
header .logo img { height: 30px; width: auto; display: block; }
header .home { color: var(--text); text-decoration: none; font-size: 14px; opacity: .85; }
header .home:hover { opacity: 1; }

.steps {
  list-style: none; margin: 0 0 var(--gap); padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .75);
}
.steps li { display: flex; flex-direction: column; gap: 5px; }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .28); }
.steps li.done::before, .steps li.now::before { background: var(--ball); }
.steps li.now { color: var(--text); font-weight: 700; }

.view { flex: 1; display: flex; flex-direction: column; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
/* stegets innehåll i det mörka kortet */
.panel {
  flex: 1; display: flex; flex-direction: column; gap: var(--gap);
  background: var(--panel); border-radius: 22px; padding: 18px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

h1 { margin: 0; font-size: clamp(24px, 3.8dvh, 34px); font-weight: 500; line-height: 1.1; }
.club { display: flex; align-items: center; gap: 14px; min-width: 0; }
.club img { height: clamp(36px, 7.4dvh, 72px); width: auto; max-width: 45%; object-fit: contain; flex: none; }
.lead { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

.lbl {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.lbl .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

.chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: clamp(36px, 5.6dvh, 50px); padding: 3px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--chip); color: var(--text);
  font-weight: 500; font-size: 15px; line-height: 1.15; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip small { font-size: 11px; font-weight: 400; color: var(--muted); }
@media (hover: hover) { .chip:hover { border-color: rgba(255, 255, 255, .45); } }
.chip[aria-pressed="true"] { background: var(--ball); border-color: var(--ball); color: var(--ink); font-weight: 700; }
.chip[aria-pressed="true"] small { color: #2c3a14; }
.chip:focus-visible, .btn:focus-visible, .field:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
/* pågående timme: liten prick */
.chip.live::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-top: 2px; }
.chip.live[aria-pressed="true"]::after { background: var(--ink); }

/* dagar: en rad som sveps i sidled (ingen scrollning av sidan) */
.days {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 5); gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
.days .chip { scroll-snap-align: start; }
.length { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.length .chip { flex-direction: row; justify-content: space-between; padding-inline: 16px; font-size: 16px; }
.length .chip small { font-size: 14px; font-weight: 700; color: var(--text); }
.length .chip[aria-pressed="true"] small { color: var(--ink); }
/* med 2h-valet: mindre text överst så att steget fortfarande ryms */
.has2h .lead { display: none; }
.has2h .club { gap: 10px; }
@media (max-width: 719px) {
  .has2h { --gap: clamp(6px, 1.1dvh, 22px); }
  .has2h #timeHint { display: none; }
  .has2h .club img { height: 30px; }
  .has2h .mail-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.courts { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 8px; }
.times { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.empty { margin: 0; padding: 12px; border-radius: 12px; background: var(--chip); color: var(--muted); font-size: 14px; text-align: center; }

.seg { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 2px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); }
.seg button { border: 0; border-radius: 999px; background: transparent; color: var(--muted); padding: 3px 11px; font-size: 12px; font-weight: 700; cursor: pointer; text-transform: none; letter-spacing: 0; }
.seg button[aria-pressed="true"] { background: var(--ball); color: var(--ink); }

.field {
  width: 100%; height: clamp(44px, 6dvh, 52px); border-radius: 12px; border: 1px solid var(--line);
  background: var(--chip); color: var(--text); font: 16px Roboto, system-ui, sans-serif; padding: 0 14px;
}
.field::placeholder { color: #8f9994; }
.field:focus { border-color: var(--ball); outline: none; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ball); flex: none; }
.error { margin: 0; color: var(--warn); font-size: 14px; }
.note { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* knappraden längst ner i kortet */
.actions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.actions.col { flex-direction: column; align-items: stretch; gap: 8px; border-top: 0; }
.price { display: flex; flex-direction: column; line-height: 1.2; }
.price span { font-size: 12px; color: var(--muted); }
.price b { font-size: 20px; }
/* rundade knappar som "Köp din match" / "Spelschema" */
.btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--ball); color: var(--ink); font-weight: 700; font-size: 17px;
  text-decoration: none; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--text); border: 2px solid rgba(255, 255, 255, .35); min-height: 48px; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn .swish { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px 10px; }
.btn .swish img { height: 18px; width: auto; display: block; }
.textlink { background: none; border: 0; padding: 6px; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; text-align: center; }

.card { border: 1px solid var(--line); border-radius: 16px; background: var(--chip); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card .row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.card .row span:first-child { color: var(--muted); }
.card hr { border: 0; height: 1px; background: var(--line); margin: 2px 0; width: 100%; }
.card .total { align-items: baseline; }
.card .total b:last-child { font-size: 22px; }
.card .small { font-size: 13px; color: var(--muted); margin-top: -6px; }
.pair { display: flex; gap: 8px; }
.pair .watch { flex: 1 1 auto; white-space: nowrap; padding-inline: 16px; }
.pair .copy { flex: 0 0 auto; min-height: 52px; }
.video { display: flex; gap: 12px; align-items: center; }
.video .play { width: 48px; height: 48px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; }
.video b { display: block; font-weight: 700; }
.video span { color: var(--muted); font-size: 14px; }

.center { align-items: center; text-align: center; justify-content: center; }
.badge { width: 72px; height: 72px; border-radius: 50%; background: var(--ball); display: flex; align-items: center; justify-content: center; }
.spinner { width: 72px; height: 72px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--ball); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* låg skärm (t.ex. iPhone SE med Safaris verktygsfält): tätare så att steget ryms utan scrollning */
@media (max-width: 719px) and (max-height: 620px) {
  header { padding-block: 6px; }
  header .logo img { height: 22px; }
  .steps { gap: 6px; font-size: 0; }
  .steps li { gap: 0; }
  .steps li::before { height: 3px; }
  .panel { padding: 12px 14px; border-radius: 18px; }
  h1 { font-size: 22px; }
  .lead { font-size: 13px; margin-top: 2px; }
  .lbl { margin-bottom: 5px; }
  .compact-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .field { height: 42px; }
  .btn { min-height: 46px; }
  .actions { padding-top: 8px; }
  .card { padding: 10px 14px; gap: 7px; }
  .video .play { width: 40px; height: 40px; }
  .badge { width: 48px; height: 48px; }
  .badge svg { width: 26px; height: 26px; }
  .pair .btn { min-height: 44px; }
  .has2h #durationRow .lbl { display: none; }
  .has2h .chip { min-height: 34px; }
}

/* sidfoten bara på dator – i mobil står kontaktuppgifterna i betalsteget */
footer { display: none; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); text-align: center; color: rgba(255, 255, 255, .8); font-size: 12px; }
footer a { color: inherit; }

@media (min-width: 720px) {
  .app { max-width: 760px; padding-top: 20px; }
  header .logo img { height: 44px; }
  .view { flex: 0 0 auto; }
  .panel { padding: 32px; border-radius: 24px; }
  .actions { margin-top: 8px; padding-top: 20px; }
  .actions .btn { flex: 0 0 auto; margin-left: auto; min-width: 260px; }
  .actions.col .btn { margin-left: 0; }
  .days { grid-auto-columns: calc((100% - 56px) / 8); }
  .times { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  footer { display: block; margin-top: 24px; }
}
