/* Public forms (Careers, Alumni, Admission …) – built with forms_builder */
.msb-form-section {
  padding: 70px 15px 90px;
}

.msb-form-card {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  padding: 44px 48px 40px;
  font-family: Montserrat, Poppins, sans-serif;
}

/* Intro text is written in the admin editor; keep it in the site's fonts and colours */
.msb-form-intro {
  text-align: center;
  margin-bottom: 30px;
  color: #555;
  line-height: 1.7;
}
.msb-form-intro *,
.msb-form-intro font {
  font-family: inherit !important;
  color: inherit !important;
}
.msb-form-intro b,
.msb-form-intro strong,
.msb-form-intro h1,
.msb-form-intro h2,
.msb-form-intro h3 {
  color: #222 !important;
}
.msb-form-intro span[style*="font-size: 24px"],
.msb-form-intro span[style*="font-size:24px"] {
  font-family: Poppins, sans-serif !important;
  font-size: 22px !important;
  letter-spacing: 0.5px;
}
.msb-form-intro p:empty,
.msb-form-intro p > br:only-child {
  display: none;
}

.msb-form-alert {
  background: #fdecec;
  border: 1px solid #f5c2c4;
  color: #b4121a;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
}
.msb-form-alert ul { margin: 0; padding-left: 18px; }

.msb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}

.msb-field {
  grid-column: span 2;
  margin-bottom: 18px;
  min-width: 0;
}

/* Short single-line fields sit two per row on wider screens */
.msb-field-text,
.msb-field-email,
.msb-field-number,
.msb-field-tel,
.msb-field-url,
.msb-field-date,
.msb-field-datetime,
.msb-field-datetime-local {
  grid-column: span 1;
}

.msb-form-grid > .msb-field.msb-full {
  grid-column: span 2;
}

.msb-field > label {
  display: block;
  font-family: Poppins, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 7px;
  letter-spacing: 0.2px;
}
.msb-req { color: #ec1d25; }

.msb-field input[type=text],
.msb-field input[type=email],
.msb-field input[type=number],
.msb-field input[type=tel],
.msb-field input[type=url],
.msb-field input[type=date],
.msb-field input[type=datetime],
.msb-field input[type=datetime-local],
.msb-field input.flatpickr-input,
.msb-field select,
.msb-field textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-family: Montserrat, sans-serif;
  font-size: 14px;
  color: #222;
  background: #fff;
  /* The theme forces "border: none !important" on inputs, so the outline is an inset shadow */
  border: 0;
  box-shadow: inset 0 0 0 1px #cfd3da;
  border-radius: 8px;
  transition: box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.msb-field textarea {
  min-height: 120px;
  resize: vertical;
}
.msb-field select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.msb-field select[multiple] {
  padding: 6px;
  min-height: 150px;
}
.msb-field select[multiple] option {
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 2px;
}
.msb-field select[multiple] option:checked {
  background: #ec1d25 linear-gradient(#ec1d25, #ec1d25);
  color: #fff;
}

.msb-field input:focus,
.msb-field select:focus,
.msb-field textarea:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #ec1d25, 0 0 0 3px rgba(236, 29, 37, 0.12);
}

.msb-field ::placeholder { color: #aaa; }

/* File upload */
.msb-field input[type=file] {
  display: block;
  width: 100%;
  padding: 10px;
  font-family: Montserrat, sans-serif;
  font-size: 13px;
  color: #666;
  background: #fafafa;
  outline: 1.5px dashed #c3c8d0;
  outline-offset: -1.5px;
  border-radius: 8px;
  cursor: pointer;
  transition: outline-color 0.2s, background 0.2s;
}
.msb-field input[type=file]:hover,
.msb-field input[type=file]:focus {
  outline: 1.5px dashed #ec1d25;
  background: #fff;
  box-shadow: none;
}
.msb-field input[type=file]::file-selector-button {
  margin-right: 14px;
  padding: 9px 18px;
  font-family: Poppins, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: #222;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.msb-field input[type=file]:hover::file-selector-button { background: #ec1d25; }

/* Checkbox / radio lists (Django renders each option in its own <div>) */
.msb-field-checkbox > div,
.msb-field-radio > div,
.msb-field ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.msb-field-checkbox > div label,
.msb-field-radio > div label,
.msb-field ul label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Montserrat, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  cursor: pointer;
}
.msb-field input[type=checkbox],
.msb-field input[type=radio] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #ec1d25;
  flex-shrink: 0;
}

/* A single tick box (e.g. "I agree"): box first, label beside it */
.msb-field-checkbox:has(> input[type=checkbox]) {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.msb-field-checkbox:has(> input[type=checkbox]) > label {
  margin: 0;
  font-weight: 500;
}

.msb-help-text {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #888;
}

/* Errors */
.msb-field.has-error input:not([type=checkbox]):not([type=radio]):not([type=file]),
.msb-field.has-error select,
.msb-field.has-error textarea {
  box-shadow: inset 0 0 0 1.5px #ec1d25;
  background: #fff7f7;
}
.msb-field.has-error input[type=file] {
  outline-color: #ec1d25;
}
.msb-field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #d0111a;
}
.msb-field-error ul { display: block; }

.msb-form-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.msb-form-actions .btn3,
.msb-form-home {
  min-width: 200px;
  height: 48px;
  padding: 0 30px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

/* Thank-you page */
.msb-form-sent { padding-top: 50px; padding-bottom: 50px; }
.msb-form-sent-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #ec1d25;
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.msb-form-home { display: inline-flex; width: auto; }

/* Date picker (flatpickr) in the site colours */
.flatpickr-calendar { font-family: Montserrat, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #ec1d25;
  border-color: #ec1d25;
}
.flatpickr-day.today { border-color: #ec1d25; }
.flatpickr-day.today:hover { background: #ec1d25; border-color: #ec1d25; color: #fff; }
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; }
.msb-field input.flatpickr-input[readonly] {
  cursor: pointer;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.msb-field .flatpickr-wrapper { display: block; }

@media (max-width: 767px) {
  .msb-form-section { padding: 40px 12px 60px; }
  .msb-form-card { padding: 28px 18px; border-radius: 10px; }
  .msb-form-grid { grid-template-columns: 1fr; }
  .msb-form-grid > .msb-field.msb-full { grid-column: span 1; }
  .msb-field,
  .msb-field-text,
  .msb-field-email,
  .msb-field-number,
  .msb-field-tel,
  .msb-field-url,
  .msb-field-date,
  .msb-field-datetime,
  .msb-field-datetime-local { grid-column: span 1; }
  .msb-form-actions .btn3 { width: 100%; }
}
