:root {
  --sf-card: #071c36;
  --sf-ink: #e8eff7;
  --sf-primary: #28a9e1;
  --sf-panel: #ffffff;
  --sf-panel-ink: #0f223e;
  --sf-input-border: #b6c0cc;
  --sf-input-text: #334b67;
  --sf-input-placeholder: #8592a2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 !important;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(46, 112, 193, 0.28), rgba(6, 18, 36, 0) 36%),
    linear-gradient(180deg, #051022 0%, #071327 100%);
  color: var(--sf-ink);
}

html,
body {
  overflow-x: hidden;
}

body.html2pdf-mode {
  background: #ffffff;
}

.nav-bar {
  height: 80px;
}

.img-logo {
  max-height: 100px;
}

.medi-logo {
  position: absolute;
  top: 0;
  right: 0;
  height: 80px;
  padding: 20px;
}

@media (max-width: 720px) {
  .nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .medi-logo {
    padding: 24px;
    position: relative;
  }
}


.spinner-wrapper {
  background-color: rgba(6, 15, 33, 0.8);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.spinner {
  width: 10rem;
  height: 10rem;
}

.display-line-breaks {
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sf-page {
  width: 100%;
  padding: 0;
}

.sf-shell {
  width: 100%;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--sf-card);
  box-shadow: none;
}

.sf-topbar {
  min-height: 74px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0b1b33;
}

.sf-logo {
  display: block;
  width: auto;
  height: auto;
}

.sf-logo-surecount {
  width: 170px;
  height: 38px;
  object-fit: contain;
}

.sf-powered-by {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sf-powered-by span {
  font-size: 13px;
  letter-spacing: 0.09em;
  color: #c4cfdb;
  text-transform: uppercase;
}

.sf-logo-mediprocity {
  width: 75px;
  height: 24px;
  object-fit: contain;
}

.sf-main {
  display: grid;
  grid-template-columns: minmax(0, 0.43fr) minmax(0, 0.57fr);
  min-height: calc(100vh - 74px);
  min-width: 0;
}

.sf-overview {
  padding: 56px 48px 40px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, #0b1b33 0%, #122a4c 56%, #173357 100%);
}

.sf-overview h1 {
  margin: 30px 0 20px;
  font-size: clamp(42px, 3.2vw, 60px);
  line-height: 0.96;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-family: 'Poppins', sans-serif;
  color: #ffffff;
}

.sf-overview h1 span {
  color: var(--sf-primary);
}

.sf-lead {
  max-width: 410px;
  margin: 0;
  color: #c4cfdb;
  font-size: 14px;
  line-height: 1.5;
}

.sf-feature-list {
  margin-top: 48px;
}

.sf-feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.sf-feature-item + .sf-feature-item {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(145, 170, 204, 0.2);
}

.sf-feature-icon-wrap {
  width: 46px;
  min-width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(23, 90, 150, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sf-feature-icon {
  width: 22px;
  height: 22px;
}

.sf-feature-item h2 {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

.sf-feature-item p {
  margin: 4px 0 0;
  color: #c4cfdb;
  font-size: 14px;
  line-height: 1.35;
}

.sf-bottom-copy {
  margin: auto 0 0;
  padding-top: 24px;
  border-top: 1px solid rgba(145, 170, 204, 0.2);
  color: #c4cfdb;
  font-size: 14px;
  line-height: 1.45;
}

.sf-form-card {
  background: var(--sf-panel);
  color: var(--sf-panel-ink);
  padding: 48px 64px 36px;
  min-width: 0;
}

.sf-form-header {
  margin-bottom: 22px;
}

.sf-form-accent {
  display: block;
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: #3ca2df;
}

.sf-form-header h2 {
  margin: 16px 0 8px;
  color: #0f2340;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

.sf-form-header p {
  margin: 0;
  color: #657486;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 400;
}

.sf-form-section {
  margin-top: 22px;
}

.sf-form-section + .sf-form-section {
  border-top: 1px solid #c8ced7;
  padding-top: 20px;
}

.sf-section-title {
  margin: 0 0 12px;
  color: #1e3049;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
}

.sf-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  min-width: 0;
}

.sf-form-section > .sf-grid:first-child {
  margin-top: 0;
}

.sf-grid-1 {
  grid-template-columns: 1fr;
}

.sf-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sf-field label {
  display: block;
  margin: 0 0 6px;
  color: #2a4362;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.sf-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sf-field > label:not(.error) {
  order: 1;
}

.sf-field > input,
.sf-field > select,
.sf-field > textarea {
  order: 2;
}

.sf-field > .select2 {
  order: 3;
}

/* In html2pdf mode values are appended after controls as text nodes; keep label above value. */
body.html2pdf-mode .sf-field > p,
body.html2pdf-mode .sf-field > span {
  order: 2;
  margin: 0;
}

.form-control,
.select2-container--default .select2-selection--single {
  width: 100%;
  height: 54px !important;
  border: 1px solid var(--sf-input-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--sf-input-text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.form-control,
select.form-control {
  padding: 0 14px;
}

.form-control::placeholder {
  color: var(--sf-input-placeholder);
  font-weight: 400;
}

.form-control:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #62b9ea;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(73, 164, 222, 0.2);
  outline: 0;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  padding-right: 14px;
}

.select2-container {
  width: 100% !important;
  max-width: 100% !important;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  padding-left: 14px;
  padding-right: 14px;
  line-height: 52px;
  color: var(--sf-input-text);
  font-size: 14px;
  font-weight: 500;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--sf-input-placeholder);
  font-weight: 400;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  display: none;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  display: none;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  display: none;
}

.select2-dropdown {
  border: 1px solid var(--sf-input-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(19, 43, 71, 0.16);
}

.select2-search--dropdown {
  padding: 8px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  height: 40px;
  border: 1px solid #c4cbd4;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #2a4362;
  background: #ffffff;
}

.select2-results__option {
  font-size: 14px;
  padding: 10px 12px;
  color: #2a4362;
  background: #f7f9fb;
  white-space: normal;
}

.select2-results,
.select2-results__options {
  overflow-x: hidden;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  color: #2a4362;
  background: #e8eff6;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: #2d82cb;
  color: #ffffff;
}

.sf-form-card > .btn.btn-primary {
  width: 100%;
  margin-top: 22px;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #2e9fe0 0%, #1e6fc4 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  font-family: Arial, sans-serif;
  box-shadow: 0 10px 24px 0 rgba(0, 142, 200, 0.35);
}

.sf-form-card > .btn.btn-primary:hover,
.sf-form-card > .btn.btn-primary:focus {
  background: linear-gradient(90deg, #36abee 0%, #2678ce 100%);
  box-shadow: 0 10px 24px 0 rgba(0, 142, 200, 0.35);
}

/* Keep error page buttons compact and visually consistent with platform primary buttons. */
#error_page_wrapper .pages-wrapper > .mt-4 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#error_page_wrapper .pages-wrapper > .mt-4 .btn {
  width: 190px;
  min-width: 190px;
}

#error_page_wrapper #back_to_form.btn.btn-success {
  background-color: #007bff;
  border-color: #007bff;
  color: #ffffff;
}

#error_page_wrapper #back_to_form.btn.btn-success:hover,
#error_page_wrapper #back_to_form.btn.btn-success:focus {
  background-color: #0069d9;
  border-color: #0062cc;
  color: #ffffff;
}

/* Keep modal text readable on white modal backgrounds without changing page-level body color. */
.modal-dialog {
  color: #1f2f45;
}

.sf-security {
  margin: 14px 0 0;
  color: #6f7c8b;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.security-icon {
  position: relative;
  top: 2px;
  display: inline-block;
  width: 12px;
  height: 10px;
  margin-right: 8px;
  background: #6f7c8b;
  border-radius: 2px;
}

.security-icon::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 2px;
  width: 8px;
  height: 7px;
  border: 2px solid #6f7c8b;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

label.error {
  display: none;
  order: 4;
  margin-top: 6px;
  color: #cc4a42;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}

.form-control.error,
select.error + .select2 .select2-selection--single {
  border-color: #cc4a42;
}

select.form-control.error + .select2 .select2-selection--single,
select.form-control.error ~ .select2 .select2-selection--single,
.states-initializer.error + .select2 .select2-selection--single,
.states-initializer.error ~ .select2 .select2-selection--single {
  border-color: #cc4a42 !important;
}

body.html2pdf-mode .sf-page {
  padding: 0;
}

body.html2pdf-mode .sf-shell {
  width: 100%;
  border-radius: 0;
  box-shadow: none;
}

body.html2pdf-mode .sf-main {
  grid-template-columns: 1fr;
  min-height: auto;
}

body.html2pdf-mode .sf-topbar {
  background: #ffffff;
}

body.html2pdf-mode .sf-powered-by span {
  color: #657486;
}

body.html2pdf-mode .sf-form-card {
  width: 100%;
  background: #ffffff;
  padding: 24px 0 0;
}

@media (max-width: 1023px) {
  .sf-page {
    padding: 0;
  }

  .sf-main {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sf-overview,
  .sf-form-card {
    padding: 30px 24px;
  }

  .sf-overview {
    padding-bottom: 26px;
  }

  .sf-feature-list {
    margin-top: 28px;
  }

  .sf-bottom-copy {
    margin-top: 26px;
  }
}

@media (max-width: 767px) {
  .sf-topbar {
    min-height: 68px;
    padding: 0 22px;
  }

  .sf-logo-surecount {
    max-width: 106px;
    max-height: 26px;
  }

  .sf-logo-mediprocity {
    max-width: 70px;
    max-height: 18px;
  }

  .sf-powered-by {
    gap: 8px;
  }

  .sf-overview,
  .sf-form-card {
    padding: 24px 20px;
  }

  .sf-chip {
    font-size: 11px;
    padding: 7px 12px;
  }

  .sf-overview h1 {
    margin-top: 18px;
    font-size: clamp(44px, 11.6vw, 60px);
  }

  .sf-lead {
    margin-top: 14px;
    max-width: none;
  }

  .sf-feature-list {
    margin-top: 26px;
  }

  .sf-feature-item + .sf-feature-item {
    margin-top: 14px;
    padding-top: 14px;
  }

  .sf-feature-icon-wrap {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .sf-feature-icon {
    width: 18px;
    height: 18px;
  }

  .sf-bottom-copy {
    margin-top: 22px;
    padding-top: 20px;
  }

  .sf-grid-2 {
    grid-template-columns: 1fr;
  }

  .sf-form-header h2 {
    margin-top: 12px;
    font-size: 28px;
  }

  .sf-form-header p,
  .sf-lead,
  .sf-feature-item p,
  .sf-bottom-copy {
    font-size: 15px;
  }

  .sf-feature-item h2 {
    font-size: 16px;
  }

  .sf-field label {
    font-size: 14px;
  }

  .sf-section-title {
    font-size: 12px;
  }

  .form-control,
  .select2-container--default .select2-selection--single {
    height: 46px !important;
    font-size: 14px;
  }

  .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    font-size: 14px;
  }

  .sf-form-card > .btn.btn-primary {
    min-height: 50px;
    font-size: 16px;
  }

  .sf-security {
    font-size: 13px;
  }
}
