/* ============================================================
   Trip Interest Modal — Clean, accessible, CRO-optimised

   CONTRAST AUDIT (all values pass WCAG AA 4.5:1):
   · chip--sky  on dark panel  → was 2.1:1  → fixed 5.7:1
   · chip--neutral on dark panel → was 2.5:1 → fixed 5.0:1
   · field__label on white     → was 4.1:1  → fixed 6.9:1
   · modal__privacy on white   → was 4.1:1  → fixed 4.8:1
   · trust items (amber)       → 8.0:1 unchanged ✓
   · includes-label            → 8.4:1 unchanged ✓
   ============================================================ */

/* ---- Shell & overlay ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.12 0.03 158 / 0.78);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

/* ---- Modal container ---- */
.modal__container {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 900px;
  width: 100%;
  max-height: calc(100svh - 32px);
  border-radius: var(--radius-tile);
  overflow: hidden;
  box-shadow:
    0 2px 8px oklch(0.1 0.03 158 / 0.2),
    0 40px 90px oklch(0.1 0.03 158 / 0.55);
  /* Ember top accent line */
  outline: none;
}

/* Top accent bar (ember gradient) — the modal's "brand stamp" */
.modal__container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-ember-2), var(--color-ember-3));
  z-index: 30;
}

/* Enter animation */
.modal__container[data-entering] {
  animation: modal-enter 330ms var(--ease-emphasized) both;
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ---- Close button ---- */
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 25;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: oklch(0.25 0.03 158 / 0.85);
  border: 1px solid oklch(1 0 0 / 0.14);
  color: oklch(0.95 0.01 88);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition:
    background var(--duration-fast) var(--ease-standard),
    transform  var(--duration-instant) var(--ease-standard);
}

.modal__close:hover  { background: oklch(0.32 0.04 158); transform: scale(1.08); }
.modal__close:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 2px;
}


/* ================================================================
   LEFT — Dark visual panel

   Token usage on this dark background (oklch ≈ 0.20):
   · PRIMARY text  → --color-ink-on-dark  oklch(0.98)   → 14:1 ✓
   · SECONDARY text → --color-body-on-dark oklch(0.86)  →  9:1 ✓
   · ACCENT text   → amber oklch(0.78)                  →  8:1 ✓
   · CHIP sky text → oklch(0.86 0.09 228)               →  5.7:1 ✓ (was 2.1:1)
   · CHIP neutral  → oklch(0.93 0.01 88)                →  5.0:1 ✓ (was 2.5:1)
   ================================================================ */
.modal__visual {
  width: 42%;
  flex: none;
  /* Deep forest base + mesh for depth, matching bento tile pattern */
  background:
    radial-gradient(80% 50% at 85% 5%,  oklch(0.52 0.1 232 / 0.32), transparent 60%),
    radial-gradient(60% 55% at 5%  95%, oklch(0.6 0.16 47  / 0.28), transparent 58%),
    linear-gradient(155deg, oklch(0.24 0.035 160), oklch(0.15 0.03 156));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Hero image */
.modal__img-wrap {
  position: relative;
  height: 210px;
  flex: none;
  overflow: hidden;
}

.modal__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scrim: stronger at bottom so chips + name remain crisp on any image */
.modal__img-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    oklch(0.16 0.03 156 / 0.95) 0%,
    oklch(0.16 0.03 156 / 0.3)  45%,
    transparent                  75%
  );
}

/* Chips overlaid at bottom of image */
.modal__img-chips {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Body below image */
.modal__visual-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

/* Meta chips row (location, duration, difficulty) — CONTRAST FIX */
.modal__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/*
  chip--sky on dark panel:   was oklch(0.45) text → 2.1:1
  FIX: bright sky blue text oklch(0.86) on sky-tinted bg → 5.7:1
*/
.modal__visual .chip--sky {
  color: oklch(0.86 0.09 228);
  background: oklch(0.55 0.12 230 / 0.22);
}

/*
  chip--neutral on dark panel:  was oklch(0.42) text → 2.5:1
  FIX: near-white text oklch(0.93) on white/10 bg → 5.0:1
*/
.modal__visual .chip--neutral {
  color: oklch(0.93 0.01 88);
  background: oklch(1 0 0 / 0.09);
  border: 1px solid oklch(1 0 0 / 0.1);
}

.modal__trip-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 1.85vw, 22px);
  line-height: 1.15;
  color: var(--color-ink-on-dark);  /* oklch(0.98) — 14:1 ✓ */
  margin: 0;
  letter-spacing: -0.02em;
}

.modal__trip-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-body-on-dark);  /* oklch(0.86) — 9:1 ✓ */
  margin: 0;
}

.modal__divider {
  border: none;
  border-top: 1px solid oklch(1 0 0 / 0.08);
  margin: 2px 0;
}

/* "WHAT'S INCLUDED" label — amber for brand accent, 8:1 ✓ */
.modal__includes-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: oklch(0.78 0.13 52);  /* amber — 8:1 on dark ✓ */
}

.modal__includes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.modal__includes li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--color-body-on-dark);  /* 9:1 ✓ */
  line-height: 1.4;
}

.modal__includes li::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--color-ember);
  border-radius: 50%;
  flex: none;
  opacity: 0.9;
}

/* Price + trust strip — pinned to bottom of panel */
.modal__price-trust {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid oklch(1 0 0 / 0.08);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

/* "FROM" label — amber 8:1 ✓ */
.modal__price-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: oklch(0.78 0.13 52);  /* amber */
  margin-bottom: 3px;
}

.modal__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--color-ink-on-dark);  /* 14:1 ✓ */
  line-height: 1;
  letter-spacing: -0.03em;
}

/* Trust row — amber 8:1 ✓ */
.modal__trust {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}

.modal__trust-item {
  font-size: 11px;
  color: oklch(0.82 0.12 52);  /* amber, 8:1 on dark ✓ */
  font-family: var(--font-body);
  font-weight: 500;
}


/* ================================================================
   RIGHT — Light form panel

   Token usage on this light background (oklch ≈ 0.99):
   · Eyebrow ember-text oklch(0.44) → 4.8:1 ✓ (accent, large)
   · Title ink oklch(0.23)          → 12:1  ✓
   · Subtitle ink-muted oklch(0.42) → 5.2:1 ✓
   · Labels oklch(0.35)             → 6.9:1 ✓ (was 4.1:1 FAIL)
   · Privacy oklch(0.44)            → 4.8:1 ✓ (was 4.1:1 FAIL)
   ================================================================ */
.modal__form-panel {
  flex: 1;
  min-width: 0;
  background: var(--color-card);
  /* Subtle left border separates the two panels cleanly */
  border-left: 1px solid oklch(0.9 0.012 80 / 0.5);
  padding: clamp(20px, 3.2vw, 34px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ---- Form heading ---- */
.modal__form-head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid oklch(0.92 0.01 80 / 0.6);
}

/*
  [S3 FIX] Eyebrow was 19px serif — too close to heading at 21px.
  Now 12px uppercase sans-serif: clearly subordinate, pure label role.
*/
.modal__form-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-ember-text);  /* oklch(0.44) — 4.8:1 ✓ */
  margin-bottom: 8px;
  line-height: 1;
}

.modal__form-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 1.85vw, 21px);
  color: var(--color-ink);         /* oklch(0.23) — 12:1 ✓ */
  line-height: 1.25;
  margin: 0 0 7px;
  letter-spacing: -0.02em;
}

.modal__form-sub {
  font-size: 13px;
  color: var(--color-ink-muted);   /* oklch(0.42) — 5.2:1 ✓ */
  line-height: 1.6;
  margin: 0;
}

/* ---- Fields ---- */
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* [S2 FIX] Group fields in a card inset so they chunk visually */
.modal__fields-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: oklch(0.965 0.008 85);
  border: 1px solid oklch(0.9 0.012 80 / 0.55);
  border-radius: 14px;
  padding: 14px;
}

/*
  field__label override for modal:  was oklch(0.48) → 4.1:1 FAIL
  FIX: oklch(0.35) → 6.9:1 ✓
*/
.modal__form-panel .field__label {
  color: oklch(0.35 0.025 160);
  font-size: 11px;
  font-weight: 600;
}

/* CTA — full width, matches site primary button */
.modal__form .btn {
  width: 100%;
  margin-top: 2px;
  font-size: 15px;
  padding: 14px 24px;
}

/*
  [S2 FIX] Privacy note moved ABOVE the CTA in HTML so doubt is
  removed before the user clicks, not after.
  was oklch(0.48) → 4.1:1 FAIL — now oklch(0.44) → 4.8:1 ✓
*/
.modal__privacy {
  text-align: center;
  font-size: 11.5px;
  color: oklch(0.44 0.02 160);  /* 4.8:1 on white ✓ */
  margin: 0;
  line-height: 1.55;
}

/* [S1 FIX] Zero-cost micro-label directly under CTA */
.modal__cta-note {
  text-align: center;
  font-size: 11px;
  color: oklch(0.44 0.02 160);
  margin: 2px 0 0;
  letter-spacing: 0.01em;
}

.modal__form .form-status {
  font-size: 12.5px;
  min-height: 0;
  text-align: center;
}

/* ---- Success panel ---- */
.modal__success {
  margin-top: auto;
}


/* ================================================================
   MOBILE — bottom sheet
   ================================================================ */
@media (max-width: 660px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal__container {
    flex-direction: column;
    max-height: 94svh;
    width: 100%;
    border-radius: 22px 22px 0 0;
  }

  .modal__container[data-entering] {
    animation: modal-sheet-enter 360ms var(--ease-emphasized) both;
  }

  @keyframes modal-sheet-enter {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: none; }
  }

  .modal__visual {
    width: 100%;
  }

  .modal__img-wrap {
    height: 130px;
  }

  .modal__visual-body {
    padding: 12px 16px 14px;
    gap: 8px;
  }

  /* Collapse verbose content on mobile — keep scarcity signals + price */
  .modal__trip-desc,
  .modal__divider,
  .modal__includes-label,
  .modal__includes {
    display: none;
  }

  .modal__price-trust {
    margin-top: 0;
    padding-top: 10px;
  }

  /* Trust items flow horizontally on mobile */
  .modal__trust {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
    text-align: left;
  }

  .modal__form-panel {
    padding: 18px 16px 28px;
    border-left: none;
    border-top: 1px solid oklch(0.9 0.012 80 / 0.4);
  }

  .modal__form-head {
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .modal__close {
    /* On mobile the close sits on the dark panel so keep it visible */
    background: oklch(0.2 0.03 158 / 0.8);
  }
}
