/* Overrides theme .modal-dialog { max-width: 100% } and transparent .modal-content */
.program-brochure-modal.modal {
  z-index: 1055;
}

.program-brochure-modal .modal-dialog {
  max-width: min(480px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  margin: 0.75rem auto;
  display: flex;
  align-items: center;
}

.program-brochure-modal .modal-content {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  width: 100%;
  max-height: calc(100vh - 1.5rem);
  display: flex;
  flex-direction: column;
}

.program-brochure-modal .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.program-brochure-modal .modal-header,
.program-brochure-modal .modal-footer {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.program-brochure-modal .modal-body {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.65rem 1rem 0.5rem;
}

.program-brochure-modal .modal-header {
  padding: 0.65rem 1rem;
  align-items: center;
}

.program-brochure-modal .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
  padding-right: 0.5rem;
}

.program-brochure-modal__close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--theme-color, #1e73ea);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  padding: 0;
}

.program-brochure-modal__close:hover {
  opacity: 0.9;
}

.program-brochure-modal__intro {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

.program-brochure-modal__field {
  margin-bottom: 0.65rem;
}

.program-brochure-modal__field:last-child {
  margin-bottom: 0;
}

.program-brochure-modal__field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  color: #334155;
}

.program-brochure-modal .form-control {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  background-color: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.program-brochure-modal .modal-footer {
  padding: 0.5rem 1rem 0.75rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.program-brochure-modal .modal-footer .btn,
.program-brochure-modal .modal-footer .th-btn {
  margin: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  line-height: 1.3;
}

.program-brochure-modal .modal-footer .th-btn {
  min-height: 36px;
}

body.modal-open .modal-backdrop.show {
  z-index: 1050;
  opacity: 0.55;
}

.program-brochure-modal .program-brochure-country-select {
  position: relative;
}

.program-brochure-modal .admission-country-dropdown {
  position: absolute;
  z-index: 1065;
  left: 0;
  right: 0;
  max-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  margin-top: 2px;
}

.program-brochure-modal .admission-country-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.program-brochure-modal .admission-country-option:hover,
.program-brochure-modal .admission-country-option:focus {
  background: #f1f5f9;
}

.program-brochure-modal #programBrochureFormAlert {
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

.program-brochure-modal__phone-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.program-brochure-modal__phone-code {
  flex: 0 0 96px;
  min-width: 0;
}

.program-brochure-modal__phone-number {
  flex: 1 1 auto;
  min-width: 0;
}

.program-brochure-modal .admission-phone-code-select {
  position: relative;
}

.program-brochure-modal .admission-phone-code-trigger {
  cursor: pointer;
  background-color: #fff;
  padding-right: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.program-brochure-modal .admission-phone-code-trigger::after {
  content: "";
  position: absolute;
  right: 0.65rem;
  top: 50%;
  margin-top: -3px;
  border: 4px solid transparent;
  border-top-color: #66708f;
  pointer-events: none;
}

.program-brochure-modal .program-brochure-phone-code-select .admission-country-dropdown {
  min-width: 220px;
}

.program-brochure-modal__consent {
  margin-top: 0.85rem;
  margin-bottom: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.program-brochure-modal__consent .form-check-input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.program-brochure-modal__consent .form-check-label {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #475569;
}
