/* SpilMere.dk — Design System
   Palette:
   --green-900: #0f2e1a  (dyb natgrøn, primær baggrund/tekst)
   --green-700: #16532d  (knapper, aktive states)
   --green-500: #22c55e  (accent, success)
   --lime-400:  #a3e635  (highlight accent på mørk baggrund)
   --chalk:     #f7f8f3  (kridthvid baggrund)
   --stone-100: #f1f0eb  (kort baggrund)
   --stone-300: #d4d2c9  (borders)
   --ink:       #1a1a18  (primær tekst)
   --muted:     #6b6b62  (sekundær tekst)

   Typography:
   Display: Syne (700) — headings, holdnavne
   Body: Inter (400/500/600) — alt andet
*/

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --green-900: #0f2e1a;
  --green-700: #16532d;
  --green-600: #15803d;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --lime-400:  #a3e635;
  --chalk:     #f7f8f3;
  --stone-100: #f1f0eb;
  --stone-200: #e8e6de;
  --stone-300: #d4d2c9;
  --ink:       #1a1a18;
  --muted:     #6b6b62;
  --red:       #dc2626;
  --amber:     #f59e0b;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.14);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--chalk);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────── */

h1, h2, h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { color: var(--muted); }
p.lead { color: var(--ink); font-size: 1.1rem; }

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────── */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.container--wide {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Nav ─────────────────────────────────────────── */

.nav {
  background: var(--green-900);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav__logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--lime-400);
  border-radius: 50%;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav__links a {
  color: rgba(255,255,255,.75);
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}

.nav__links a:hover,
.nav__links a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
  text-decoration: none;
}

.nav__cta {
  background: var(--lime-400) !important;
  color: var(--green-900) !important;
  font-weight: 600 !important;
}

.nav__cta:hover {
  background: #bef264 !important;
}

/* ── Buttons ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--green-700);
  color: #fff;
}
.btn--primary:hover {
  background: var(--green-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: #fff;
}

.btn--lime {
  background: var(--lime-400);
  color: var(--green-900);
}
.btn--lime:hover {
  background: #bef264;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--green-900);
}

.btn--ghost {
  background: transparent;
  color: var(--green-700);
  border: 1.5px solid var(--stone-300);
}
.btn--ghost:hover {
  border-color: var(--green-700);
  background: var(--green-100);
  text-decoration: none;
}

.btn--danger {
  background: transparent;
  color: var(--red);
  border: 1.5px solid #fecaca;
}
.btn--danger:hover {
  background: #fef2f2;
  border-color: var(--red);
  text-decoration: none;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn--sm {
  padding: 6px 14px;
  font-size: .8rem;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Forms ───────────────────────────────────────── */

.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

label .hint {
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--stone-300);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(22,83,45,.12);
}

input.error,
select.error,
textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}

.error-msg {
  font-size: .8rem;
  color: var(--red);
  margin-top: 4px;
}

textarea { resize: vertical; min-height: 80px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b62' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Level picker — 5 radio buttons styled as boxes */
.level-picker {
  display: flex;
  gap: 8px;
}

.level-picker input[type="radio"] { display: none; }

.level-picker label {
  flex: 1;
  padding: 10px 4px;
  border: 1.5px solid var(--stone-300);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  margin: 0;
  transition: all .15s;
  color: var(--muted);
}

.level-picker input:checked + label {
  background: var(--green-900);
  color: #fff;
  border-color: var(--green-900);
}

.level-picker label:hover {
  border-color: var(--green-700);
  color: var(--green-700);
}

/* ── Cards ───────────────────────────────────────── */

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stone-200);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* Team card — used on /find */
.team-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stone-200);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Signature element: diagonal level badge */
.team-card__level-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 56px 56px 0;
  border-color: transparent var(--green-900) transparent transparent;
}

.team-card__level-badge span {
  position: absolute;
  top: 8px;
  right: -48px;
  font-family: 'Syne', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  color: var(--lime-400);
  transform: rotate(0);
  white-space: nowrap;
}

.team-card__body { padding: 20px; }

.team-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.team-card__name {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  padding-right: 48px; /* clearance for badge */
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--stone-100);
  color: var(--muted);
}

.tag--green {
  background: var(--green-100);
  color: var(--green-700);
}

.team-card__distance {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.team-card__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.date-chip {
  padding: 4px 10px;
  background: var(--stone-100);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink);
}

.team-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--stone-200);
  background: var(--stone-100);
}

/* Reliability indicator */
.reliability {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--muted);
}

.reliability__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-500);
}

.reliability__dot--amber { background: var(--amber); }
.reliability__dot--red   { background: var(--red); }

/* ── Dashboard grid ──────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.section-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Status badge ────────────────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.status--pending  { background: #fffbeb; color: #92400e; }
.status--accepted { background: var(--green-100); color: var(--green-700); }
.status--declined { background: #fef2f2; color: var(--red); }

/* ── Page header ─────────────────────────────────── */

.page-header {
  background: var(--green-900);
  color: #fff;
  padding: 48px 20px 40px;
}

.page-header h1 { color: #fff; }
.page-header p  { color: rgba(255,255,255,.65); margin-top: 8px; }

/* ── Filter bar (on /find) ───────────────────────── */

.filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--stone-200);
  padding: 16px 20px;
  position: sticky;
  top: 56px;
  z-index: 90;
}

.filter-bar__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 140px;
  font-size: .85rem;
  padding: 8px 32px 8px 12px;
}

/* ── Progress steps (register) ───────────────────── */

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
}

.step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stone-200);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.step.active .step__num {
  background: var(--green-900);
  color: #fff;
}

.step.active { color: var(--ink); }
.step.done .step__num { background: var(--green-500); color: #fff; }

.step__divider {
  flex: 1;
  height: 1px;
  background: var(--stone-300);
  margin: 0 12px;
}

/* ── Toasts ──────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn .2s ease;
  max-width: 320px;
}

.toast--success { background: var(--green-900); color: #fff; }
.toast--error   { background: #7f1d1d; color: #fff; }
.toast--info    { background: var(--ink); color: #fff; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty states ────────────────────────────────── */

.empty {
  text-align: center;
  padding: 48px 24px;
}

.empty__icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.empty h3 { color: var(--ink); margin-bottom: 8px; }

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 640px) {
  .nav__links { display: none; }
  .page-header { padding: 32px 20px 28px; }
  .filter-bar__inner { gap: 8px; }
  .filter-bar select { min-width: 120px; }
  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

/* ── Utility ─────────────────────────────────────── */

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: .875rem; }
.text-muted { color: var(--muted); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* Google Maps autocomplete dropdown fix */
.pac-container {
  z-index: 10000 !important;
}

/* ── Site footer ─────────────────────────────────── */

.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,.45);
  padding: 24px 20px;
  text-align: center;
  font-size: .8rem;
  margin-top: auto;
}

.site-footer a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
}
.site-footer a:hover {
  color: rgba(255,255,255,.8);
  text-decoration: underline;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
