/*!
 * ERA funnel pages — eraapp's runtime styles (ERA-2491, phase 3).
 *
 * Linked at a page's [_PAGE_CSS_], before its #custom_style. What the runtime
 * draws INSIDE a form carries eraapp's own classes, which the Default design's
 * stylesheet (era.css) styles; a layout page links no era.css, so the rules
 * keyed on body[data-template] below draw the same messages there. Dialogs and
 * the phone list live in the runtime's own layer (#funnel-rt-layer) and look
 * the same on every design.
 */

/* The widgets' sample drawings (a sample month, a sample time) never show: the
   runtime draws the live widget and marks it ready. */
[data-widget="booking_calendar"]:not([data-funnel-ready]),
[data-widget="goal_questions"]:not([data-funnel-ready]) {
  visibility: hidden;
}

/* Book a Call's calendar with no open time anywhere in its window: the times
   pane holds the notice and its Continue. Beside the month on a wide screen; on
   a phone, where the pane falls below the month, it comes first, to be read
   before the greyed days. */
@media (max-width: 767.98px) {
  [data-widget="booking_calendar"] .funnel-rt-no-times-pane {
    order: -1;
    border-top-width: 0;
    border-bottom: 1px solid #e2e8f0;
  }
}

/* The Thank You page after a call request, on a page whose booked sentence was
   edited away: the one paragraph the runtime adds at its first section's start. */
.funnel-rt-requested-note {
  box-sizing: border-box;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 16px 24px;
  color: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

/* ---------------------------------------------------------------------------
 * In a form
 * ------------------------------------------------------------------------- */

.funnel-rt-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.funnel-rt-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body[data-template] .funnel-rt-field-error {
  display: block;
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: #dc2626;
  text-align: left;
}

body[data-template] .funnel-rt-form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

body[data-template] [data-form-kind] input[aria-invalid="true"]:not([data-phone-number]),
body[data-template] [data-form-kind] select[aria-invalid="true"],
body[data-template] [data-form-kind] [data-phone-field]:has([aria-invalid="true"]) {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18) !important;
}

body[data-template] .funnel-rt-status {
  gap: 10px;
  min-height: 260px;
  padding: 32px 16px;
}

body[data-template] .funnel-rt-status h2,
body[data-template] .funnel-rt-status h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

body[data-template] .funnel-rt-status p {
  max-width: 38ch;
  margin: 0;
  opacity: 0.8;
}

body[data-template] .funnel-rt-status-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 1.6rem;
  font-weight: 800;
}

body[data-template] .funnel-rt-status-mark svg {
  width: 32px;
  height: 32px;
}

/* ---------------------------------------------------------------------------
 * The runtime's layer: dialogs and the phone list, on every design
 * ------------------------------------------------------------------------- */

#funnel-rt-layer {
  position: relative;
  z-index: 2147483000;
}

#funnel-rt-layer,
#funnel-rt-layer * {
  box-sizing: border-box;
}

#funnel-rt-layer .funnel-rt-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#funnel-rt-layer .funnel-rt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

#funnel-rt-layer .funnel-rt-backdrop-dark {
  background: rgba(0, 0, 0, 0.7);
}

#funnel-rt-layer .funnel-rt-dialog {
  position: relative;
  width: 100%;
  max-width: 384px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#funnel-rt-layer .funnel-rt-dialog-dark {
  border-color: #262626;
  background: #0a0a0a;
  color: #fff;
}

#funnel-rt-layer .funnel-rt-title {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
}

#funnel-rt-layer .funnel-rt-text {
  margin: 8px 0 0;
  color: #475569;
  font-size: 14px;
}

#funnel-rt-layer .funnel-rt-dialog-dark .funnel-rt-text {
  color: #a3a3a3;
}

#funnel-rt-layer .funnel-rt-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  margin-top: 24px;
}

@media (min-width: 640px) {
  #funnel-rt-layer .funnel-rt-actions {
    flex-direction: row;
  }
}

#funnel-rt-layer .funnel-rt-btn {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#funnel-rt-layer .funnel-rt-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

#funnel-rt-layer .funnel-rt-btn-primary {
  background: #2563eb;
  color: #fff;
}

#funnel-rt-layer .funnel-rt-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

#funnel-rt-layer .funnel-rt-btn-secondary {
  border-color: #cbd5e1;
  background: transparent;
  color: inherit;
}

#funnel-rt-layer .funnel-rt-dialog-dark .funnel-rt-btn-secondary {
  border-color: #404040;
  color: #e5e5e5;
}

#funnel-rt-layer .funnel-rt-btn-block {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-size: 16px;
}

/* The Challenge's card */

#funnel-rt-layer .funnel-rt-pay {
  max-width: 440px;
  text-align: left;
}

#funnel-rt-layer .funnel-rt-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#funnel-rt-layer .funnel-rt-eyebrow {
  margin: 0;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#funnel-rt-layer .funnel-rt-pay .funnel-rt-title {
  margin-top: 6px;
  font-size: 22px;
}

#funnel-rt-layer .funnel-rt-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
}

#funnel-rt-layer .funnel-rt-summary strong {
  color: #0f172a;
  font-size: 18px;
}

#funnel-rt-layer .funnel-rt-pay-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

#funnel-rt-layer .funnel-rt-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

#funnel-rt-layer .funnel-rt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#funnel-rt-layer input.funnel-rt-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  background: #fff;
  box-shadow: none;
  color: #0f172a;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

#funnel-rt-layer input.funnel-rt-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

#funnel-rt-layer input.funnel-rt-input[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

#funnel-rt-layer .funnel-rt-card-error {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
}

#funnel-rt-layer .funnel-rt-alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 14px;
}

#funnel-rt-layer .funnel-rt-note {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

/* The phone country list (eraapp's Radix Select) */

#funnel-rt-layer .funnel-rt-listbox {
  position: fixed;
  z-index: 2147483001;
  width: 280px;
  max-width: calc(100vw - 16px);
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  background: #fff;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  color: #0f172a;
  font-family: inherit;
}

#funnel-rt-layer .funnel-rt-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
}

#funnel-rt-layer .funnel-rt-option img {
  flex: none;
  width: 20px;
  height: 15px;
  object-fit: contain;
}

#funnel-rt-layer .funnel-rt-option span:first-of-type {
  flex: 1;
}

#funnel-rt-layer .funnel-rt-option.funnel-rt-active {
  background: #dbeafe;
}

#funnel-rt-layer .funnel-rt-tick {
  color: #2563eb;
}
