@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #F5F1EA;
  --surface: #FBF8F3;
  --ink: #1E2A26;
  --ink-2: #4A5652;
  --ink-3: #7A857F;
  --line: #E3DCCF;
  --moss: #4F6B54;
  --moss-2: #6B8770;
  --terra: #B65C3D;
  --sand: #E8DFCE;
  --sage: #CFD8C8;
  --sun: #E9C47A;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: #EBE5D9;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,0.06);
}

@media (min-width: 600px) {
  body {
    padding: 24px 16px;
    align-items: flex-start;
  }
  .app {
    min-height: calc(100vh - 48px);
    border-radius: 28px;
    overflow: hidden;
  }
}

/* ─── Desktop booking layout ─────────────────────────────────
   On wide screens, booking pages adopt the design:
   - Sticky top nav
   - 2-column grid: dark context panel (380px) on the LEFT,
     surface flow card on the RIGHT
   - Horizontal numbered step indicator inside the right card
   On mobile this reduces to display:contents (no-op wrapper). */
.booking-grid { display: contents; }
.booking-aside { display: none; }
.booking-desktop-nav { display: none; }
.booking-steps-d { display: none; }

@media (min-width: 1024px) {
  body {
    padding: 28px;
    background: #DCD5C4;
    align-items: flex-start;
  }
  .app {
    max-width: 1280px;
    min-height: 760px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.08);
    border-radius: 12px;
  }

  /* Sticky top nav */
  .booking-desktop-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 56px;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 241, 234, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .booking-desktop-nav .brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
  .booking-desktop-nav .brand .logo {
    width: 32px; height: 32px; border-radius: 8px; background: var(--ink);
    display: flex; align-items: center; justify-content: center;
    color: #FBF8F3; font-family: 'DM Serif Display', serif; font-size: 18px; font-style: italic;
  }
  .booking-desktop-nav .brand .name {
    font-family: 'DM Serif Display', serif;
    font-size: 17px; line-height: 1; letter-spacing: -0.01em;
  }
  .booking-desktop-nav .brand .sub {
    font-size: 11px; color: var(--ink-3);
    letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2px;
  }
  .booking-desktop-nav .actions { display: flex; align-items: center; gap: 14px; }
  .booking-desktop-nav .actions .lang { font-size: 13px; color: var(--ink-2); }
  .booking-desktop-nav .actions .login {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 16px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line);
    border-radius: 999px; text-decoration: none;
    font-size: 13px; font-weight: 600; font-family: 'DM Sans', sans-serif;
  }

  /* The mobile thin progress bar is hidden — desktop has its own stepper */
  .stepper { display: none; }
  /* The mobile back-button-with-title row is hidden on desktop */
  .booking-mobile-header { display: none !important; }
  /* Mobile-only summary cards (e.g. inline "Din booking" on betaling) */
  .booking-mobile-only { display: none !important; }
  /* Desktop date-picker grid on the landing page */
  .date-grid-d { display: block !important; }
  .day-btn-d:hover:not(:disabled) { border-color: var(--ink) !important; }
  /* The mobile sticky-cta becomes static on desktop */
  .booking-main .sticky-cta {
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 16px 0 0;
  }

  /* 2-column grid layout */
  .booking-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 32px;
    padding: 28px 56px 48px;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    align-items: start;
  }

  /* LEFT — dark context panel */
  .booking-aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #1E2A26;
    color: #FBF8F3;
    border-radius: 24px;
    padding: 28px;
    position: sticky;
    top: 100px;
    align-self: start;
  }
  .booking-aside .ctx-overline {
    font-size: 11px; letter-spacing: 0.14em;
    text-transform: uppercase; opacity: 0.6; font-weight: 500;
  }
  .booking-aside h1.ctx-title {
    font-family: 'DM Serif Display', serif; font-weight: 400;
    font-size: 30px; margin: 8px 0 0; line-height: 1.05; letter-spacing: -0.01em;
  }
  .booking-aside .ctx-meta {
    display: flex; flex-direction: column; gap: 10px;
    font-size: 13px; opacity: 0.85;
  }
  .booking-aside .ctx-meta .row { display: flex; gap: 10px; align-items: center; }
  .booking-aside hr.ctx-rule { border: 0; border-top: 1px solid rgba(251,248,243,0.15); margin: 0; }
  .booking-aside .legend { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
  .booking-aside .legend .row { display: flex; align-items: center; gap: 10px; }
  .booking-aside .legend .swatch { width: 18px; height: 14px; border-radius: 3px; flex-shrink: 0; }
  .booking-aside .legend .price { margin-left: auto; font-weight: 500; opacity: 0.85; }
  .booking-aside .legend .booked-row { padding-top: 8px; margin-top: 4px; border-top: 1px solid rgba(251,248,243,0.15); opacity: 0.7; }
  .booking-aside .ctx-summary-rows { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
  .booking-aside .ctx-summary-rows .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
  .booking-aside .ctx-summary-rows .row .lab { opacity: 0.6; }
  .booking-aside .ctx-summary-rows .row .val { text-align: right; font-weight: 500; }
  .booking-aside .ctx-summary-rows .row .val.muted { opacity: 0.4; font-weight: 400; }
  .booking-aside .ctx-total { display: flex; justify-content: space-between; align-items: flex-end; }
  .booking-aside .ctx-total .amount {
    font-family: 'DM Serif Display', serif;
    font-size: 38px; line-height: 1; margin-top: 6px;
  }
  .booking-aside .ctx-total .meta {
    font-size: 12px; opacity: 0.6; text-align: right;
  }

  /* RIGHT — surface flow card */
  .booking-main {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--line);
    padding: 36px 40px;
    min-height: 580px;
    min-width: 0;
  }
  .booking-main #standmap-host {
    height: 560px; margin: 0 0 16px; border-radius: 18px;
  }

  /* Horizontal numbered step indicator */
  .booking-steps-d {
    display: flex; align-items: center;
    padding: 4px 0 24px;
  }
  .booking-steps-d .step { display: flex; align-items: center; gap: 10px; }
  .booking-steps-d .step .circle {
    width: 28px; height: 28px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--line);
    color: var(--ink-3); font-size: 13px; font-weight: 600;
    transition: all 0.2s;
  }
  .booking-steps-d .step.done .circle { background: var(--moss); border-color: var(--moss); color: #FBF8F3; }
  .booking-steps-d .step.active .circle { background: var(--ink); border-color: var(--ink); color: #FBF8F3; }
  .booking-steps-d .step .lab {
    font-size: 13px; font-weight: 500;
    color: var(--ink-3); letter-spacing: 0.02em;
  }
  .booking-steps-d .step.done .lab { color: var(--ink-2); }
  .booking-steps-d .step.active .lab { color: var(--ink); font-weight: 600; }
  .booking-steps-d .connector { flex: 1; height: 1px; background: var(--line); margin: 0 16px; }
  .booking-steps-d .connector.done { background: var(--moss); }
}

.serif {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.scroll::-webkit-scrollbar { display: none; }

/* ─── buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: #FBF8F3; }
.btn-primary:hover { background: #0F1614; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-block { width: 100%; }

/* ─── chips ───────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.chip-moss { background: var(--sage); color: #2A3A2C; }
.chip-terra { background: #F2D9CE; color: #5A2A18; }
.chip-sand { background: var(--sand); color: #5A4A2A; }
.chip-outline { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }

/* ─── card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--line);
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ─── sticky cta ──────────────────────────────────────────── */
.sticky-cta {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 20px 28px;
  background: linear-gradient(to top, var(--bg) 70%, rgba(245,241,234,0));
}

/* ─── status dot ──────────────────────────────────────────── */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

/* ─── form fields ─────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field input,
.field textarea,
.field select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--moss);
}

/* ─── tap feedback ────────────────────────────────────────── */
.tap {
  cursor: pointer;
  transition: opacity 0.1s;
}
.tap:active { opacity: 0.7; }

/* ─── stepper ─────────────────────────────────────────────── */
.stepper {
  display: flex;
  gap: 4px;
  padding: 12px 20px 10px;
}
.stepper .step {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.2s;
}
.stepper .step.done { background: var(--ink); }

/* ─── animation utilities ─────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(251, 248, 243, 0.4);
  border-top-color: #FBF8F3;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

/* ─── tab bar ─────────────────────────────────────────────── */
.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px);
  background: rgba(251, 248, 243, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: none;
}
.tabbar .tab.active { color: var(--ink); }
.tabbar .tab svg { opacity: 0.75; }
.tabbar .tab.active svg { opacity: 1; }
