/* ============================================================================
   SES Booking Form  —  v1.0
   Mobile-first. Matches Blocksy palette (orange #f4ab0f, navy #2c3e50).
   Loaded only on pages that contain [ses_booking_form].
   ========================================================================= */

.ses-booking-form {
  --ses-orange: #f4ab0f;
  --ses-orange-dark: #d99500;
  --ses-navy: #2c3e50;
  --ses-navy-dark: #1d2a37;
  --ses-grey: #797470;
  --ses-grey-light: #ecede9;
  --ses-white: #ffffff;
  --ses-off-white: #fbfbfc;
  --ses-red: #d64545;
  --ses-green: #2f9e64;
  --ses-radius: 8px;
  --ses-shadow: 0 4px 16px rgba(34, 56, 101, .07);
  --ses-shadow-hover: 0 6px 24px rgba(34, 56, 101, .12);

  font-family: Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--ses-navy);
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  font-size: 16px;
  line-height: 1.5;
  box-sizing: border-box;
}
.ses-booking-form *,
.ses-booking-form *::before,
.ses-booking-form *::after {
  box-sizing: inherit;
}

/* ---- Steps wrapper ---- */
.ses-bf-step { display: none; }
.ses-bf-step--active { display: block; }

.ses-bf-step h2 {
  font-family: 'Roboto Slab', Roboto, sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--ses-navy);
  margin: 0 0 8px;
  line-height: 1.25;
}
.ses-bf-step p.ses-bf-sub {
  color: var(--ses-grey);
  margin: 0 0 24px;
  font-size: 15px;
}

/* ---- Progress dots ---- */
.ses-bf-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.ses-bf-dot {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--ses-grey-light);
  transition: background .2s;
}
.ses-bf-dot--done   { background: var(--ses-orange); }
.ses-bf-dot--active { background: var(--ses-navy); }

/* ---- Big radio cards (Step 1 — urgency) ---- */
.ses-bf-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
.ses-bf-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--ses-white);
  border: 2px solid var(--ses-grey-light);
  border-radius: var(--ses-radius);
  cursor: pointer;
  transition: all .15s ease;
  min-height: 72px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ses-bf-card:hover {
  border-color: var(--ses-orange);
  box-shadow: var(--ses-shadow-hover);
}
.ses-bf-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ses-bf-card--selected,
.ses-bf-card:has(input:checked) {
  border-color: var(--ses-orange);
  background: rgba(244, 171, 15, 0.06);
  box-shadow: var(--ses-shadow);
}
.ses-bf-card__icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}
.ses-bf-card__body strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--ses-navy);
}
.ses-bf-card__body span {
  display: block;
  color: var(--ses-grey);
  font-size: 14px;
  margin-top: 2px;
}

/* ---- Standard form fields ---- */
.ses-bf-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.ses-bf-row--two-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) {
  .ses-bf-row--two-cols { grid-template-columns: 1fr 1fr; gap: 16px; }
}

.ses-bf-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ses-navy);
  margin-bottom: 6px;
}
.ses-bf-row input[type="text"],
.ses-bf-row input[type="tel"],
.ses-bf-row input[type="email"],
.ses-bf-row input[type="date"],
.ses-bf-row select,
.ses-bf-row textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;        /* prevents iOS zoom */
  font-family: inherit;
  color: var(--ses-navy);
  background: var(--ses-white);
  border: 1.5px solid var(--ses-grey-light);
  border-radius: var(--ses-radius);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.ses-bf-row select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23797470' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.ses-bf-row textarea {
  min-height: 76px;
  resize: vertical;
  font-family: inherit;
}
.ses-bf-row input:focus,
.ses-bf-row select:focus,
.ses-bf-row textarea:focus {
  outline: none;
  border-color: var(--ses-orange);
  box-shadow: 0 0 0 3px rgba(244, 171, 15, 0.2);
}
.ses-bf-row .ses-bf-hint {
  font-size: 13px;
  color: var(--ses-grey);
  margin-top: 4px;
}
.ses-bf-row .ses-bf-error {
  font-size: 13px;
  color: var(--ses-red);
  margin-top: 4px;
  display: none;
}
.ses-bf-row.ses-bf-row--error input,
.ses-bf-row.ses-bf-row--error select,
.ses-bf-row.ses-bf-row--error textarea {
  border-color: var(--ses-red);
}
.ses-bf-row.ses-bf-row--error .ses-bf-error {
  display: block;
}

/* ---- Inline radio chips (property type, contact method, time window) ---- */
.ses-bf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ses-bf-chip {
  position: relative;
  cursor: pointer;
  padding: 10px 16px;
  background: var(--ses-white);
  border: 1.5px solid var(--ses-grey-light);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ses-navy);
  transition: all .15s;
  user-select: none;
}
.ses-bf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ses-bf-chip:has(input:checked) {
  border-color: var(--ses-orange);
  background: var(--ses-orange);
  color: var(--ses-white);
}
.ses-bf-chip:hover { border-color: var(--ses-orange); }

/* ---- Buttons ---- */
.ses-bf-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.ses-bf-btn {
  flex: 1 1 auto;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--ses-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
  min-height: 52px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.ses-bf-btn--primary {
  background: var(--ses-orange);
  color: var(--ses-white);
  border-color: var(--ses-orange);
}
.ses-bf-btn--primary:hover { background: var(--ses-orange-dark); border-color: var(--ses-orange-dark); }
.ses-bf-btn--primary:disabled,
.ses-bf-btn--primary[disabled] {
  background: var(--ses-grey-light);
  color: var(--ses-grey);
  border-color: var(--ses-grey-light);
  cursor: not-allowed;
}
.ses-bf-btn--secondary {
  background: var(--ses-white);
  color: var(--ses-navy);
  border-color: var(--ses-grey-light);
  flex: 0 0 auto;
}
.ses-bf-btn--secondary:hover { border-color: var(--ses-navy); }

/* ---- Suburb autocomplete ---- */
.ses-bf-autocomplete {
  position: relative;
}
.ses-bf-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ses-white);
  border: 1.5px solid var(--ses-grey-light);
  border-top: none;
  border-radius: 0 0 var(--ses-radius) var(--ses-radius);
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: var(--ses-shadow-hover);
  display: none;
}
.ses-bf-suggestions--visible { display: block; }
.ses-bf-suggestion {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 15px;
  border-bottom: 1px solid var(--ses-grey-light);
}
.ses-bf-suggestion:last-child { border-bottom: none; }
.ses-bf-suggestion:hover,
.ses-bf-suggestion--active { background: rgba(244, 171, 15, 0.1); }

/* ---- Success / Failure states ---- */
.ses-bf-result {
  text-align: center;
  padding: 32px 16px;
  border-radius: var(--ses-radius);
}
.ses-bf-result--success {
  background: rgba(47, 158, 100, 0.08);
  border: 1.5px solid var(--ses-green);
}
.ses-bf-result--failure {
  background: rgba(214, 69, 69, 0.08);
  border: 1.5px solid var(--ses-red);
}
.ses-bf-result__icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.ses-bf-result__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ses-navy);
  margin: 0 0 8px;
}
.ses-bf-result__ref {
  display: inline-block;
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--ses-orange);
  background: var(--ses-white);
  padding: 6px 14px;
  border-radius: var(--ses-radius);
  margin: 8px 0 16px;
  letter-spacing: 0.5px;
}
.ses-bf-result__body {
  color: var(--ses-grey);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.ses-bf-result__phone {
  display: inline-block;
  background: var(--ses-orange);
  color: var(--ses-white);
  padding: 12px 24px;
  border-radius: var(--ses-radius);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  margin-top: 8px;
}
.ses-bf-result__phone:hover { background: var(--ses-orange-dark); color: var(--ses-white); }

/* ---- Loading state ---- */
.ses-bf-loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--ses-white);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  animation: ses-bf-spin 0.7s linear infinite;
}
@keyframes ses-bf-spin {
  to { transform: rotate(360deg); }
}

/* ---- Honeypot (anti-spam) ---- */
.ses-bf-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---- Emergency call-first panel (Step 1) ---- */
.ses-bf-emergency {
  margin-top: 16px;
  padding: 20px;
  border: 2px solid var(--ses-orange);
  border-radius: var(--ses-radius);
  background: rgba(244, 171, 15, 0.07);
  text-align: center;
}
.ses-bf-emergency__body strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--ses-navy);
  margin-bottom: 4px;
}
.ses-bf-emergency__body span {
  display: block;
  color: var(--ses-grey);
  font-size: 14px;
  line-height: 1.5;
}
.ses-bf-emergency__call {
  display: block;
  margin: 16px auto 0;
  background: var(--ses-orange);
  color: var(--ses-white);
  padding: 16px 24px;
  border-radius: var(--ses-radius);
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  box-shadow: var(--ses-shadow);
}
.ses-bf-emergency__call:hover { background: var(--ses-orange-dark); color: var(--ses-white); }
.ses-bf-emergency__continue {
  display: inline-block;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--ses-navy);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.ses-bf-emergency__continue:hover { color: var(--ses-orange-dark); }

/* ---- Reassurance line (Step 3) ---- */
.ses-bf-reassure {
  text-align: center;
  font-size: 13px;
  color: var(--ses-grey);
  margin: 8px 0 0;
}

/* ---- Trust badges below the booking widget ---- */
.ses-booking-trust {
  margin-top: 36px;
}

/* ---- Mobile fine-tuning (375px target) ---- */
@media (max-width: 480px) {
  .ses-bf-step h2 { font-size: 24px; }
  .ses-bf-card { padding: 16px; min-height: 64px; }
  .ses-bf-card__icon { font-size: 26px; width: 36px; }
  .ses-bf-card__body strong { font-size: 16px; }
  .ses-bf-actions {
    flex-direction: column-reverse;
    position: sticky;
    bottom: 0;
    background: var(--ses-white);
    padding: 12px 0 8px;
    box-shadow: 0 -6px 16px rgba(34, 56, 101, 0.06);
    z-index: 10;
  }
  .ses-bf-btn { width: 100%; }
  .ses-bf-emergency__call { font-size: 19px; }
}
