/* ============================================================
   JEEP SAFARI BOOKING POPUP (js/safari-form.js)
   Builds on the .booking-enquiry-* / .bk-* modal styles in
   style.css; only the safari-specific pieces live here.
   ============================================================ */
.sf-overlay { z-index: 3200; }
.sf-modal { max-width: 880px; }
.sf-modal .bk-field { min-width: 0; }
/* Side-by-side fields share one grid (label / input / error rows), so
   wrapped labels and error messages never knock paired inputs out of line. */
.sf-modal .bk-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  row-gap: 0;
  align-items: end;
}
.sf-modal .bk-field-row:has(.sf-age) { grid-template-columns: 96px minmax(0, 1fr); }
.sf-modal .bk-field-row > .bk-field {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  grid-template-columns: minmax(0, 1fr);   /* let long values shrink instead of overflowing */
}
.sf-modal .bk-field-row > .bk-field > label { align-self: end; }
.sf-modal .bk-field-row > .bk-field > .sf-field-error { align-self: start; }

/* Field validation */
.sf-modal .bk-field input.sf-invalid {
  border-color: #c62828;
  background: #fff6f5;
}
.sf-modal .bk-field input.sf-invalid:focus { box-shadow: 0 0 0 3px rgba(198,40,40,0.15); }
.sf-field-error {
  margin: 5px 0 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #b3261e;
}
.sf-field-error[hidden] { display: none; }
.sf-modal .bk-field input,
.sf-modal .bk-field select { min-width: 0; max-width: 100%; }

.sf-modal .bk-enquiry-visual-caption small {
  display: block;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.9;
}

.sf-opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.sf-req { color: #b3261e; }

/* Nepali calendar date picker */
.sf-date-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1.5px solid var(--beige-dark);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--beige);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.sf-date-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-date-btn i { color: var(--green-mid); flex: 0 0 auto; }
.sf-date-btn:focus-visible,
.sf-date-btn[aria-expanded="true"] {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(59,90,16,0.12);
  background: var(--white);
}
.sf-date-placeholder { color: #8a8a8a; }

.sf-cal {
  border: 1.5px solid var(--beige-dark);
  border-radius: 14px;
  background: var(--white);
  padding: 12px 12px 8px;
  margin: -4px 0 16px;
  box-shadow: 0 8px 24px rgba(21,48,16,0.08);
  animation: sfEnter 0.2s ease both;
}
.sf-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sf-cal-title { text-align: center; line-height: 1.25; }
.sf-cal-title strong { display: block; font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--green-dark); }
.sf-cal-title span { font-size: 0.74rem; color: var(--text-muted); }
.sf-cal-nav {
  width: 34px; height: 34px; flex: 0 0 34px;
  border: none; border-radius: 50%;
  background: var(--beige); color: var(--green-dark);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.sf-cal-nav:hover:not(:disabled) { background: var(--beige-dark); }
.sf-cal-nav:disabled { opacity: 0.35; cursor: default; }
.sf-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.sf-cal-wd {
  text-align: center; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted);
  padding: 4px 0;
}
.sf-cal-wd:last-of-type { color: #b3261e; }
.sf-cal-day {
  border: none; border-radius: 9px;
  background: transparent;
  padding: 5px 0 4px;
  min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  transition: background 0.15s ease;
}
.sf-cal-np { font-size: 0.98rem; font-weight: 600; line-height: 1.1; }
.sf-cal-ad { font-size: 0.6rem; color: var(--text-muted); line-height: 1; white-space: nowrap; }
.sf-cal-day:hover:not(:disabled) { background: var(--beige); }
.sf-cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--gold); }
.sf-cal-day.is-selected { background: var(--green-dark); color: #fff; }
.sf-cal-day.is-selected .sf-cal-ad { color: rgba(255,255,255,0.8); }
.sf-cal-day:disabled { opacity: 0.3; cursor: default; }
.sf-cal-note { font-size: 0.7rem; color: var(--text-muted); text-align: center; margin: 8px 0 0; }

/* Traveller blocks */
.sf-travellers { margin-bottom: 6px; }
.sf-traveller {
  border: 1.5px solid var(--beige-dark);
  border-radius: 14px;
  padding: 14px 16px 2px;
  margin: 0 0 14px;
  background: #fffdf9;
}
.sf-traveller legend {
  padding: 2px 10px;
  margin-left: -4px;
  border-radius: 999px;
  background: var(--green-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.sf-traveller legend span { font-weight: 500; opacity: 0.8; text-transform: none; }
.sf-traveller .bk-field { margin-bottom: 12px; }
.sf-traveller .bk-field-row .sf-age { flex: 0 0 96px; }
.sf-enter { animation: sfEnter 0.32s ease both; }
@keyframes sfEnter {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* Contact method: WhatsApp or Email */
.sf-method { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.sf-method legend { padding: 0; }
.sf-method-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sf-method-opt { position: relative; cursor: pointer; display: block; }
.sf-method-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sf-method-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  height: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--beige-dark);
  border-radius: 12px;
  background: var(--beige);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sf-method-card i { grid-row: 1 / span 2; font-size: 1.5rem; color: var(--text-muted); transition: color 0.2s ease; }
.sf-method-card strong { font-size: 0.95rem; color: var(--green-dark); line-height: 1.2; }
.sf-method-card small { font-size: 0.72rem; color: var(--text-muted); line-height: 1.35; }
.sf-method-opt:hover .sf-method-card { border-color: var(--green-light); }
.sf-method-opt input:focus-visible + .sf-method-card { box-shadow: 0 0 0 3px rgba(59,90,16,0.18); }
.sf-method-wa input:checked + .sf-method-card { border-color: #25D366; background: #e9f9ef; box-shadow: 0 0 0 1.5px #25D366; }
.sf-method-wa input:checked + .sf-method-card i { color: #25D366; }
.sf-method-email input:checked + .sf-method-card { border-color: var(--green-mid); background: #eef3e4; box-shadow: 0 0 0 1.5px var(--green-mid); }
.sf-method-email input:checked + .sf-method-card i { color: var(--green-mid); }
/* Tick in the corner of the chosen option */
.sf-method-opt input:checked + .sf-method-card::after {
  content: '\2713';
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  background: var(--green-mid);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.sf-method-wa input:checked + .sf-method-card::after { background: #25D366; }
.sf-confirm-hint .fa-envelope { color: var(--green-mid); margin-right: 4px; }
.sf-method-hint {
  margin: -4px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--beige);
  color: var(--green-dark);
  font-size: 0.86rem;
  text-align: center;
}
.sf-method-hint i { color: var(--gold); margin-right: 6px; }
.sf-nudge { animation: sfNudge 0.45s ease; }
@keyframes sfNudge {
  0%, 100% { transform: none; }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Contact details */
.sf-contact { margin: 4px 0 6px; }
.sf-contact-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 10px;
}
.sf-honey { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.sf-submit { width: 100%; justify-content: center; margin-top: 4px; }
.sf-submit:disabled { opacity: 0.75; cursor: wait; }

.sf-error a { color: inherit; font-weight: 700; text-decoration: underline; }
.sf-error {
  background: #fdecea;
  color: #a12a1a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.84rem;
  margin: 0 0 12px;
}

/* Confirmation */
.sf-confirm { text-align: center; padding: 10px 0 4px; }
.sf-confirm-icon {
  width: 72px; height: 72px;
  margin: 6px auto 16px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px rgba(37,211,102,0.4);
  animation: sfPop 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes sfPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.sf-confirm h3 { font-size: 1.5rem; color: var(--green-dark); margin: 0 0 8px; outline: none; }
.sf-confirm-text { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; margin: 0 0 16px; }
.sf-confirm-list {
  list-style: none;
  margin: 0 0 16px; padding: 0;
  text-align: left;
  border: 1.5px solid var(--beige-dark);
  border-radius: 12px;
  overflow: hidden;
}
.sf-confirm-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--beige-dark);
}
.sf-confirm-list li:last-child { border-bottom: none; }
.sf-confirm-list li:nth-child(odd) { background: var(--beige); }
.sf-confirm-list strong { color: var(--green-dark); overflow-wrap: anywhere; }
.sf-confirm-list span { color: var(--text-muted); white-space: nowrap; }
.sf-confirm-hint {
  background: #e9f9ef;
  color: #145c32;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0 0 12px;
}
.sf-confirm-hint i { color: #25D366; margin-right: 4px; }
.sf-confirm-retry i { color: #25D366; margin-right: 4px; }
.sf-confirm-retry {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--green-mid);
  text-decoration: underline;
  margin-bottom: 16px;
}
.sf-confirm-done { width: 100%; justify-content: center; }

/* Jeep Safari card flash after the popup closes on /jeepsafari */
.sf-highlight { animation: sfHighlight 2.2s ease 0.4s; }
@keyframes sfHighlight {
  0%, 100% { box-shadow: var(--shadow); }
  30%, 60% { box-shadow: 0 0 0 4px var(--gold), 0 12px 40px rgba(21,48,16,0.3); }
}

@media (max-width: 700px) {
  .sf-modal .bk-enquiry-form-wrap { min-height: 0; }
  .sf-modal .bk-enquiry-visual { flex-basis: 130px; }
  .sf-modal .bk-enquiry-visual-caption { right: 64px; }
  .sf-traveller { padding: 12px 12px 0; }
  .sf-traveller .bk-field-row .sf-age { flex-basis: 84px; }
  .sf-modal .bk-field-row:has(.sf-age) { grid-template-columns: 84px minmax(0, 1fr); }
  .sf-method-card { padding: 10px 10px; column-gap: 8px; }
  .sf-method-card i { font-size: 1.3rem; }
  .sf-method-card small { font-size: 0.68rem; }
}
/* Narrow phones: people + date stacked so the full chosen date fits */
@media (max-width: 440px) {
  .sf-modal .bk-field-row.sf-row-when { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sf-enter, .sf-confirm-icon, .sf-highlight, .sf-nudge { animation: none; }
}
