/**
 * Booking modal — used across the entire v11 site.
 * Triggered by elements with [data-booking-trigger].
 *
 * Brand tokens are inherited from kurs.css / index.html (cream + ink + signal honey).
 */

/* Inline dates panel (sits on detail pages above the booking CTA) */
.dates-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: var(--s-6);
}
.dates-panel-head {
  display: grid; grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule);
}
.dates-panel-head h3 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: var(--t-4);
  letter-spacing: -0.022em;
  margin: 0;
  line-height: 1.2;
}
.dates-panel-head .count {
  font-family: 'Inter', sans-serif;
  font-size: var(--t-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
}
.dates-list {
  display: grid; grid-template-columns: 1fr; gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.date-item {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .25s, background .25s;
}
.date-item:hover { border-color: var(--ink); background: var(--paper); }
.date-item .when {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: var(--t-2);
  letter-spacing: -0.012em;
}
.date-item .seats {
  font-size: var(--t-1);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.date-item .seats strong { color: var(--ink); font-weight: 600; }
.date-item .pick {
  font-size: var(--t-0);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  background: var(--signal);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background .25s;
}
.date-item:hover .pick { background: #ffc324; }

.dates-panel.free p {
  margin: 0 0 var(--s-5);
  color: var(--ink-soft);
  font-size: var(--t-2);
  line-height: 1.55;
}

.dates-panel-foot {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* ───────────────────────────────────────── Modal ───────────────────────────────────────── */

.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--easing-out);
}
.booking-modal[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.booking-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  backdrop-filter: blur(6px);
}

.booking-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 18px;
  padding: var(--s-7) var(--s-7) var(--s-6);
  box-shadow: 0 60px 120px -30px rgba(0,0,0,.35);
  transform: translateY(20px) scale(.98);
  transition: transform .45s var(--easing-out);
}
.booking-modal[data-open="true"] .booking-dialog { transform: translateY(0) scale(1); }

@media (max-width: 600px) {
  .booking-dialog { padding: var(--s-7) var(--s-5) var(--s-5); border-radius: 14px; }
}

.booking-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-family: 'Inter', sans-serif;
  line-height: 1;
  transition: background .25s, transform .25s var(--easing-out);
}
.booking-close:hover { background: var(--ink); color: var(--paper); transform: rotate(90deg); }

.booking-title {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -0.025em;
  text-align: center;
  margin: 0 0 var(--s-3);
  text-transform: uppercase;
}

.booking-tag-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-6);
}
.booking-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--signal);
  color: var(--ink);
  border-radius: 999px;
  font-size: var(--t-0);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

/* Two-column layout on desktop: dates left, contact right */
.booking-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 720px) {
  .booking-form-grid {
    grid-template-columns: 1fr 1.15fr;
    gap: var(--s-6);
    align-items: start;
  }
}
.booking-form-grid .form-fields-right {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field[hidden] { display: none; }
.form-field label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--t-2);
  color: var(--ink);
}
.form-field label .req { color: #d33; margin-left: 2px; }
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: var(--t-2);
  padding: 14px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
  font-variant-numeric: tabular-nums;
}
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--ink-mute);
  font-weight: 400;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 35%, transparent);
}
.form-field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; gap: var(--s-4); } }

/* Native disclosure for "Legg til melding" */
.form-toggle {
  margin-top: var(--s-1);
}
.form-toggle > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--t-1);
  color: var(--ink-soft);
  user-select: none;
  padding: 4px 0;
  transition: color .2s;
}
.form-toggle > summary::-webkit-details-marker { display: none; }
.form-toggle > summary:hover { color: var(--ink); }
.form-toggle > summary .icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  transition: background .2s, transform .25s var(--easing-out);
}
.form-toggle[open] > summary .icon { transform: rotate(45deg); background: var(--signal); border-color: var(--signal); }
.form-toggle .form-field { margin-top: var(--s-3); }

/* Date selector (radio cards) inside modal */
.form-field-dates {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.date-radio {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.date-radio:hover { border-color: var(--ink-soft); }
.date-radio input { position: absolute; opacity: 0; pointer-events: none; }
.date-radio .ring {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--ink-mute);
  display: grid; place-items: center;
  transition: border-color .2s;
}
.date-radio .ring::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s, transform .2s var(--easing-out);
}
.date-radio:has(input:checked) {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--signal) 12%, var(--paper));
}
.date-radio:has(input:checked) .ring { border-color: var(--ink); }
.date-radio:has(input:checked) .ring::after { opacity: 1; transform: scale(1); }
.date-radio .label {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: var(--t-2);
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.date-radio .seats {
  font-size: var(--t-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Consent checkbox above submit button */
.form-consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--s-3);
  align-items: start;
  font-size: var(--t-1);
  color: var(--ink-soft);
  line-height: 1.5;
  cursor: pointer;
  padding: 4px 0;
}
.form-consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.form-consent a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
}
.form-consent a:hover { text-decoration-thickness: 3px; }

.booking-submit {
  margin-top: var(--s-3);
  padding: 18px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: var(--t-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s, transform .25s var(--easing-out);
}
.booking-submit:hover { background: var(--ink-2); transform: translateY(-1px); }
.booking-submit[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.booking-note {
  margin: 0;
  font-size: var(--t-1);
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.5;
}

.booking-error {
  background: color-mix(in srgb, #d33 12%, var(--paper));
  border: 1px solid color-mix(in srgb, #d33 30%, var(--rule));
  color: #8a1a1a;
  padding: var(--s-4);
  border-radius: 10px;
  font-size: var(--t-1);
  line-height: 1.5;
}
.booking-error[hidden] { display: none; }

/* Cloudflare Turnstile container */
.booking-turnstile {
  display: flex;
  justify-content: center;
  margin: 4px 0 4px;
  min-height: 65px;
}
.booking-turnstile:empty { min-height: 0; }

/* Success state */
.booking-success {
  display: none;
  text-align: center;
  padding: var(--s-5) 0 0;
}
.booking-modal[data-state="success"] .booking-form { display: none; }
.booking-modal[data-state="success"] .booking-success { display: block; }

.booking-success .check {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin: 0 auto var(--s-5);
  font-size: 28px;
  font-weight: 700;
  font-family: 'Inter Tight', sans-serif;
}
.booking-success h3 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: var(--t-4);
  letter-spacing: -0.022em;
  margin: 0 0 var(--s-3);
}
.booking-success p {
  margin: 0 0 var(--s-5);
  color: var(--ink-soft);
  font-size: var(--t-2);
  line-height: 1.55;
}
.booking-success .actions {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
}

/* Loading state */
.booking-modal[data-state="sending"] .booking-form { pointer-events: none; opacity: .65; }
.booking-modal[data-state="sending"] .booking-submit::after {
  content: "...";
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots { 0%,20%{content:""} 40%{content:"."} 60%{content:".."} 80%,100%{content:"..."} }

@media (prefers-reduced-motion: reduce) {
  .booking-modal, .booking-dialog, .booking-close, .date-radio .ring::after { transition: none; }
  .booking-submit { transition: background .25s; }
}

/* ─────────────────────────────────────────────────────────────────
   BOOKING MODAL — kompakt, "easy on the eye", alt synlig uten å scrolle
   Psykologi: lavere kognitiv last, mindre kontrast, mer luft per element
   ───────────────────────────────────────────────────────────────── */
.booking-dialog {
  max-width: 920px !important;
  padding: 0 !important;
  background: #232323 !important;
  color: var(--paper);
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
}
.booking-close {
  background: rgba(248,247,236,0.1) !important;
  border-color: rgba(248,247,236,0.18) !important;
  color: var(--paper) !important;
  top: 14px !important;
  right: 14px !important;
  width: 34px !important;
  height: 34px !important;
  font-size: 18px !important;
  z-index: 5;
}
.booking-close:hover {
  background: var(--signal) !important;
  border-color: var(--signal) !important;
  color: var(--ink) !important;
}
.booking-cols {
  display: grid;
  grid-template-columns: 0.75fr 1fr;
  min-height: 0;
}
.booking-photo {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}
.booking-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 25% 28%;
  display: block;
  border-radius: 0;
}
/* Soft fade so image doesn't fight the form for attention */
.booking-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 70%, rgba(35,35,35,0.35) 100%);
  pointer-events: none;
}
.booking-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  gap: 4px;
}
.booking-eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 8px;
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.booking-dialog .booking-title {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px) !important;
  letter-spacing: -0.02em !important;
  text-transform: none !important;
  text-align: left !important;
  margin: 0 0 6px !important;
  color: var(--paper);
  line-height: 1.15;
}
.booking-sub {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: rgba(248,247,236,0.65);
  line-height: 1.45;
}
.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 12px;
}
.booking-grid .form-full { grid-column: 1 / -1; }
.booking-body .form-field { gap: 4px; }
.booking-body .form-field label {
  color: rgba(248,247,236,0.85) !important;
  font-weight: 500;
  font-size: 12.5px;
  margin-bottom: 2px;
  letter-spacing: 0;
}
.booking-body .form-field input,
.booking-body .form-field textarea,
.booking-body .form-field select {
  background: rgba(248,247,236,0.95) !important;
  color: var(--ink) !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
}
.booking-body .form-field textarea {
  min-height: 72px;
  resize: vertical;
}
.booking-body .form-field input::placeholder,
.booking-body .form-field textarea::placeholder {
  color: rgba(31,31,31,0.4);
  font-size: 13.5px;
}
.booking-body .form-field input:focus,
.booking-body .form-field textarea:focus,
.booking-body .form-field select:focus {
  border-color: var(--signal) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--signal) 25%, transparent) !important;
}
.booking-body .form-consent {
  color: rgba(248,247,236,0.6);
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 0;
  gap: 10px;
}
.booking-body .form-consent input { width: 16px; height: 16px; accent-color: var(--signal); }
.booking-body .form-consent a {
  color: rgba(248,247,236,0.85);
  text-decoration-color: var(--signal);
}
.booking-body .booking-submit {
  margin-top: 10px;
  padding: 11px 28px !important;
  background: var(--signal) !important;
  color: var(--ink) !important;
  border: 0 !important;
  border-radius: 100px !important;
  font-family: 'Inter Tight', sans-serif !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  align-self: flex-start;
  width: auto;
  min-width: 150px;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.booking-body .booking-submit:hover:not([disabled]) {
  background: #ffc324 !important;
  transform: translateY(-1px);
}
.booking-body .booking-submit[disabled] {
  background: rgba(248,247,236,0.15) !important;
  color: rgba(248,247,236,0.5) !important;
  cursor: not-allowed;
}
.booking-body .booking-error {
  background: rgba(220,50,50,0.12);
  border-color: rgba(220,50,50,0.3);
  color: #ffb3b3;
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}
.booking-body .booking-turnstile { margin: 6px 0; min-height: 0; }
.booking-body .booking-turnstile:empty { display: none; }

/* Date selector in dark theme */
.booking-body .date-radio {
  background: rgba(248,247,236,0.06);
  border-color: rgba(248,247,236,0.12);
  color: var(--paper);
  padding: 10px 12px;
}
.booking-body .date-radio:has(input:checked) {
  background: rgba(250,183,0,0.12);
  border-color: var(--signal);
}
.booking-body .date-radio .ring { border-color: rgba(248,247,236,0.4); width: 16px; height: 16px; }
.booking-body .date-radio:has(input:checked) .ring { border-color: var(--signal); }
.booking-body .date-radio:has(input:checked) .ring::after { background: var(--signal); }
.booking-body .date-radio .seats { color: rgba(248,247,236,0.55); font-size: 10px; }

/* Mobile: stack image above form, very compact */
@media (max-width: 760px) {
  .booking-cols {
    grid-template-columns: 1fr;
  }
  .booking-photo {
    height: 160px;
  }
  .booking-photo::after { display: none; }
  .booking-grid {
    grid-template-columns: 1fr;
  }
  .booking-body {
    padding: 22px 22px 24px;
  }
}
@media (max-width: 480px) {
  .booking-dialog { border-radius: 14px !important; }
  .booking-photo { height: 130px; }
  .booking-dialog .booking-title { font-size: 22px !important; }
}

/* ─────────────────────────────────────────────────────────────────
   HI-BUBBLE — "Hei, jeg er Sana 👋" med håndtegnet pil mot ansiktet
   ───────────────────────────────────────────────────────────────── */
.hi-bubble {
  position: absolute;
  top: 22px;
  right: 18px;
  z-index: 5;
  pointer-events: none;
  animation: hiFloat 4s ease-in-out infinite;
}
@keyframes hiFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.hi-text {
  background: var(--signal);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 16px;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transform: rotate(-3deg);
  white-space: nowrap;
}
.hi-text strong { font-weight: 800; }
.hi-text .wave {
  display: inline-block;
  font-size: 1.1em;
  margin-left: 2px;
  animation: handWave 2.5s ease-in-out infinite;
  transform-origin: 70% 80%;
}
@keyframes handWave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-18deg); }
  20%, 40% { transform: rotate(14deg); }
}
.hi-arrow {
  position: absolute;
  top: 56px;
  right: 30px;
  z-index: 4;
  color: var(--signal);
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
  pointer-events: none;
  animation: hiFloat 4s ease-in-out infinite;
  animation-delay: 0.1s;
}

/* Mindre på smale mobiler så det ikke dekker viktig form-innhold */
@media (max-width: 760px) {
  .hi-bubble {
    top: 12px;
    right: 12px;
  }
  .hi-text {
    font-size: 12px;
    padding: 8px 12px;
  }
  .hi-arrow {
    width: 110px;
    height: 130px;
    top: 44px;
    right: 22px;
  }
}
@media (max-width: 480px) {
  .hi-arrow { display: none; }
}

/* Success state for dark theme */
.booking-body .booking-success {
  text-align: left;
  padding: 0;
}
.booking-body .booking-success .check {
  width: 48px; height: 48px;
  font-size: 22px;
  margin: 0 0 12px;
}
.booking-body .booking-success h3 {
  color: var(--paper);
  font-size: 20px;
  margin: 0 0 6px;
}
.booking-body .booking-success p {
  color: rgba(248,247,236,0.65);
  font-size: 13.5px;
  margin: 0 0 16px;
}
.booking-body .booking-success .actions { justify-content: flex-start; gap: 8px; }
