/* Select Broker modal — backdrop + polished panel (scoped to .broker-select-modal) */

body:has(.broker-select-modal.show) .modal-backdrop {
  background-color: #0b1220 !important;
  opacity: 0.78 !important;
}

.broker-select-modal__dialog {
  max-width: 420px;
}

.broker-select-modal__content {
  border: none !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

.broker-select-modal__header {
  padding: 1.35rem 1.35rem 0.75rem !important;
  background: transparent !important;
}

.broker-select-modal__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.broker-select-modal__title-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
  color: #e2e8f0;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.35);
}

.broker-select-modal__title-text {
  flex: 1;
  min-width: 0;
}

.broker-select-modal__title-text .modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a !important;
  margin: 0 !important;
  line-height: 1.25;
}

.broker-select-modal__subtitle {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b !important;
  margin-top: 0.25rem;
}

.broker-select-modal__body {
  padding: 0.25rem 1.35rem 1.5rem !important;
}

.broker-select-modal__lead {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569 !important;
  margin-bottom: 1.1rem !important;
  padding: 0.65rem 0.85rem;
  background: rgba(241, 245, 249, 0.9);
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.broker-select-modal__options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.broker-select-modal__option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1rem !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #0f172a !important;
  font-size: 0.9375rem;
  font-weight: 600;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.broker-select-modal__option:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.18);
  border-color: #cbd5e1 !important;
  background: #fff !important;
}

.broker-select-modal__option:active {
  transform: translateY(0);
}

.broker-select-modal__option-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.broker-select-modal__option--zerodha .broker-select-modal__option-badge {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0369a1;
}

.broker-select-modal__option--angel .broker-select-modal__option-badge {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  color: #c2410c;
}

.broker-select-modal__option-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.broker-select-modal__option-label strong {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.broker-select-modal__option-label small {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b !important;
}

.broker-select-modal__option-arrow {
  color: #94a3b8;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.broker-select-modal__option:hover .broker-select-modal__option-arrow {
  color: #475569;
  transform: translateX(3px);
}

.broker-select-modal .btn-close {
  opacity: 0.55;
  padding: 0.65rem;
  margin: -0.35rem -0.35rem -0.35rem auto;
}

.broker-select-modal .btn-close:hover {
  opacity: 1;
}

@media (max-width: 575.98px) {
  .broker-select-modal__dialog {
    margin: 0.75rem;
  }

  .broker-select-modal__content {
    border-radius: 14px !important;
  }

  .broker-select-modal__option {
    padding: 0.85rem 0.9rem !important;
  }
}

/* Fallback when :has() is unsupported: slightly stronger default backdrop if class added via JS */
body.broker-select-modal-open .modal-backdrop {
  background-color: #0b1220 !important;
  opacity: 0.78 !important;
}
