:root {
  /* Shared public CTA colors — keep Lead Type badges in sync with branch/vehicle action buttons. */
  --cta-whatsapp: #25d366;
  --cta-whatsapp-hover: #1fb85a;
  --cta-call: #f15a24;
  --cta-call-hover: #dc4f1c;
  --cta-maps: #176873;
  --cta-maps-hover: #145a63;

  /* Shared rental-office logo slot (Vehicle card + Office card). */
  --rental-office-logo-ratio: 1.45 / 1;
  --rental-office-logo-height: 60px;
  --rental-office-logo-radius: 10px;
}

/*
 * Reserved slot only — layout and alignment. Never paint white here.
 * A white tile on a fixed-ratio wrapper is larger than any logo whose
 * intrinsic ratio differs from the slot, which shows as a strip/gap.
 */
.office-card-logo-wrap,
.fleet-card-office-logo-wrap,
.rental-office-logo-slot {
  --rental-office-logo-slot-width: calc(var(--rental-office-logo-height) * 1.45);
  position: relative;
  aspect-ratio: var(--rental-office-logo-ratio);
  height: var(--rental-office-logo-height);
  width: var(--rental-office-logo-slot-width);
  min-height: var(--rental-office-logo-height);
  min-width: var(--rental-office-logo-slot-width);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
  background: transparent;
  background-color: transparent;
}

/*
 * The image box hugs the logo's own aspect ratio, centred in the slot.
 * White is painted on the image: opaque logos cover it, transparent
 * logos sit on white. clip-path rounds the composited image so the
 * white cannot bleed through anti-aliased corner pixels.
 */
.office-card-logo-wrap > img.office-card-logo,
.fleet-card-office-logo-wrap > img.fleet-card-office-logo,
.rental-office-logo-slot > img.rental-office-logo {
  display: block;
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  padding: 0;
  border: none;
  background: #ffffff;
  background-color: #ffffff;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  clip-path: inset(0 round var(--rental-office-logo-radius));
  box-sizing: border-box;
}

/*
 * Standalone office logos (admin / office portal). No reserved slot —
 * the element sizes to the bitmap, capped by the modifier.
 */
img.rental-office-logo {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: #ffffff;
  background-color: #ffffff;
  object-fit: contain;
  object-position: center;
  box-sizing: border-box;
}

img.rental-office-logo--thumb {
  max-width: 70px;
  max-height: 48px;
}

img.rental-office-logo--sm {
  max-width: 120px;
  max-height: 64px;
}

img.rental-office-logo--md {
  max-width: 240px;
  max-height: 120px;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.btn.btn-primary.w-100 {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #176873;
  --bs-btn-border-color: #176873;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #145a63;
  --bs-btn-hover-border-color: #145a63;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #145a63;
  --bs-btn-active-border-color: #145a63;
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: #176873;
  --bs-btn-disabled-border-color: #176873;
  color: #ffffff;
  background-color: #176873;
  border-color: #176873;
}

.btn.btn-primary.w-100:hover,
.btn.btn-primary.w-100:focus,
.btn.btn-primary.w-100:active,
.btn.btn-primary.w-100:active:focus {
  color: #ffffff;
  background-color: #145a63;
  border-color: #145a63;
}

.account-brand-logo {
  display: block;
  width: auto;
  height: 48px;
  max-width: min(220px, 70%);
  margin: 0 auto;
  object-fit: contain;
}

@media (max-width: 575.98px) {
  .account-brand-logo {
    height: 40px;
    max-width: min(180px, 72%);
  }
}

.account-forgot-password-link {
  color: #176873;
  text-decoration: underline;
  display: inline-block;
}

.account-forgot-password-link:hover,
.account-forgot-password-link:focus {
  color: #145a63;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Phone numbers / dialing codes must stay LTR inside Arabic RTL pages. */
.phone-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.phone-ltr .phone-country-picker,
.phone-ltr .phone-country-picker-trigger,
.phone-ltr .phone-country-picker-selected,
.phone-ltr .phone-country-picker-menu,
.phone-ltr .phone-country-picker-option,
.phone-ltr .international-phone-row,
.phone-ltr .international-phone-country,
.phone-ltr .international-phone-local,
.phone-ltr input,
.phone-ltr select,
.phone-ltr textarea {
  direction: ltr;
}

.phone-ltr input,
.phone-ltr textarea,
.phone-ltr select {
  text-align: left;
}

/* Shared searchable phone country picker (admin + public). */
.phone-country-picker {
  position: relative;
  flex: 0 0 auto;
  z-index: 20;
}

.phone-country-picker.is-open {
  z-index: 40;
}

.phone-country-picker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 108px;
  height: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #e2e8f0;
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #fff;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.phone-country-picker-trigger:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.phone-country-picker-trigger:focus,
.phone-country-picker.is-open .phone-country-picker-trigger {
  outline: 0;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.phone-country-picker-selected {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.phone-country-picker-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.phone-country-picker-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.phone-country-picker-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.phone-country-picker.is-open .phone-country-picker-chevron {
  transform: rotate(225deg) translateY(1px);
  border-color: #2563eb;
}

.phone-country-picker-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  width: min(420px, calc(100vw - 2rem));
  padding: 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.14),
    0 6px 18px rgba(15, 23, 42, 0.08);
}

.phone-country-picker-search-wrap {
  position: relative;
  margin-bottom: 0.45rem;
}

.phone-country-picker-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 0.95rem;
  height: 0.95rem;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 38%, #64748b 0 38%, transparent 40%),
    linear-gradient(45deg, transparent 44%, #64748b 44%, #64748b 56%, transparent 56%);
}

.phone-country-picker-search {
  min-height: 42px;
  padding-left: 2.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.92rem;
  box-shadow: none;
}

.phone-country-picker-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.phone-country-picker-list {
  list-style: none;
  margin: 0;
  padding: 0.15rem;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.phone-country-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  color: #0f172a;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.phone-country-picker-option-main {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.phone-country-picker-option-flag {
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.phone-country-picker-option-name {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-country-picker-option-code {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.phone-country-picker-option:hover,
.phone-country-picker-option.is-active {
  background: #f1f5f9;
}

.phone-country-picker-option.is-selected {
  background: rgba(37, 99, 235, 0.08);
}

.phone-country-picker-option.is-selected .phone-country-picker-option-code {
  color: #1d4ed8;
}

.phone-country-picker-empty {
  padding: 1rem 0.75rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.branch-completion-compact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.branch-completion-reasons {
  margin: 0;
  padding-left: 1.1rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.35;
}

.branch-completion-reasons a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.branch-completion-reasons a:hover {
  color: #0f766e;
}

.branch-completion-detailed {
  width: 100%;
}

.bm-completion-panel {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid #fed7aa;
  border-radius: 0.75rem;
  background: #fff7ed;
}

.bm-completion-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #9a3412;
}

.bm-completion-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #7c2d12;
  font-size: 0.9rem;
}

.bm-completion-list li + li {
  margin-top: 0.35rem;
}

.bm-completion-fix {
  margin-inline-start: 0.45rem;
  font-weight: 650;
  color: #c2410c;
}

/* Lead Call/WhatsApp phone gate modal — approved design reference */
.lead-phone-gate .modal-dialog.lead-phone-gate-dialog {
  width: min(970px, calc(100vw - 2rem));
  max-width: 970px;
  margin: 1rem auto;
}

.lead-phone-gate .modal-content.lead-phone-gate-modal {
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 2rem;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  min-height: min(700px, calc(100vh - 2rem));
}

.modal-backdrop.lead-phone-gate-backdrop {
  opacity: 0.55;
}

.lead-phone-gate-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: min(52%, 480px);
  height: clamp(150px, 30%, 230px);
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  border-top-left-radius: 2rem;
}

.lead-phone-gate-wave svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lead-phone-gate-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: #176873;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1.95rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 104, 115, 0.28);
}

.lead-phone-gate-close:hover,
.lead-phone-gate-close:focus {
  background: #12545c;
  color: #ffffff;
  outline: 0;
}

.lead-phone-gate-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2.5rem, 5vw, 3.75rem) clamp(1.25rem, 5vw, 4.5rem) clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}

.lead-phone-gate-hero {
  position: relative;
  width: 9.5rem;
  height: 9.5rem;
  margin: 0.35rem 0 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lead-phone-gate-hero-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #d9f1f4;
}

.lead-phone-gate-illustration {
  position: relative;
  z-index: 1;
  width: 4.6rem;
  height: 7.4rem;
}

.lead-phone-gate-phone {
  display: block;
  width: 100%;
  height: 100%;
}

.lead-phone-gate-whatsapp {
  position: absolute;
  right: -0.55rem;
  bottom: 0.35rem;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.35);
  border: 3px solid #ffffff;
}

.lead-phone-gate-heading {
  margin: 0 0 0.85rem;
  color: #176873;
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead-phone-gate-main {
  margin: 0 0 0.65rem;
  color: #111827;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.35;
}

.lead-phone-gate-support {
  margin: 0 auto 1.85rem;
  max-width: 42rem;
  color: #1f2937;
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  font-weight: 400;
  line-height: 1.55;
}

.lead-phone-gate-field {
  width: 100%;
  max-width: 44rem;
  text-align: start;
  margin-bottom: 1.75rem;
}

.lead-phone-gate-label {
  display: block;
  margin-bottom: 0.55rem;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 700;
}

.lead-phone-gate-input {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 3.75rem;
  border: 2px solid #176873 !important;
  border-radius: 999px;
  background: #ffffff;
  overflow: visible;
}

.lead-phone-gate-input .phone-country-picker {
  flex: 0 0 auto;
  z-index: 30;
}

.lead-phone-gate-input .phone-country-picker-menu {
  top: auto;
  bottom: calc(100% + 0.45rem);
  left: 0;
  right: auto;
  min-width: 18rem;
  max-height: 16rem;
}

.lead-phone-gate-input .phone-country-picker-trigger {
  min-width: 7.5rem;
  min-height: 3.65rem;
  height: 100%;
  border: 0 !important;
  border-radius: 999px 0 0 999px;
  background: transparent !important;
  box-shadow: none !important;
  padding-inline: 1.15rem 0.75rem;
}

.lead-phone-gate-input .phone-country-picker-trigger:hover,
.lead-phone-gate-input .phone-country-picker-trigger:focus,
.lead-phone-gate-input .phone-country-picker.is-open .phone-country-picker-trigger {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.lead-phone-gate-divider {
  width: 1px;
  align-self: stretch;
  margin: 0.7rem 0;
  background: #cbd5e1;
  flex: 0 0 1px;
}

.lead-phone-gate-number {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.85rem 1.1rem;
  font-size: 1.08rem;
  color: #111827;
  outline: 0;
  box-shadow: none;
}

.lead-phone-gate-number::placeholder {
  color: #94a3b8;
}

.lead-phone-gate-number.is-invalid {
  color: #b91c1c;
}

.lead-phone-gate-error {
  margin-top: 0.55rem;
  color: #b91c1c;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: start;
}

.lead-phone-gate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 44rem;
  margin-top: auto;
}

.lead-phone-gate-cancel,
.lead-phone-gate-continue {
  min-height: 3.65rem;
  border-radius: 1.15rem;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lead-phone-gate-cancel {
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.lead-phone-gate-cancel:hover,
.lead-phone-gate-cancel:focus {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}

.lead-phone-gate-continue {
  border: 0;
  background: #176873;
  color: #ffffff;
}

.lead-phone-gate-continue:hover,
.lead-phone-gate-continue:focus {
  background: #12545c;
  color: #ffffff;
}

.lead-phone-gate-continue:disabled {
  opacity: 0.78;
  cursor: wait;
}

.lead-phone-gate-continue-arrow {
  font-size: 1.25rem;
  line-height: 1;
  transform: translateY(-1px);
}

@media (max-width: 767.98px) {
  .lead-phone-gate .modal-dialog.lead-phone-gate-dialog {
    width: calc(100vw - 1rem);
    margin: 0.5rem auto;
  }

  .lead-phone-gate .modal-content.lead-phone-gate-modal {
    border-radius: 1.5rem;
    min-height: 0;
    max-height: calc(100vh - 1rem);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .lead-phone-gate-wave {
    border-top-left-radius: 1.5rem;
  }

  .lead-phone-gate-input .phone-country-picker-menu {
    min-width: min(18rem, calc(100vw - 3rem));
    max-height: 12rem;
  }

  .lead-phone-gate-body {
    padding: 2rem 1.1rem 1.35rem;
  }

  .lead-phone-gate-hero {
    width: 7.5rem;
    height: 7.5rem;
    margin-bottom: 1rem;
  }

  .lead-phone-gate-illustration {
    width: 3.6rem;
    height: 5.8rem;
  }

  .lead-phone-gate-whatsapp {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 1.1rem;
  }

  .lead-phone-gate-close {
    top: 0.85rem;
    right: 0.85rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.65rem;
  }

  .lead-phone-gate-actions {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .lead-phone-gate-cancel,
  .lead-phone-gate-continue {
    min-height: 3.25rem;
    font-size: 1rem;
  }

  .lead-phone-gate-input {
    border-radius: 999px;
  }
}
