/*!
 * Bootstrap 3 visual compatibility for Bootstrap 5
 * Match original CWA eBox formfill look (BS 3.4.1 + theme)
 */

/* ---------- Base typography (BS3) ---------- */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.42857143;
  color: #333;
  background-color: #fff;
}
a {
  color: #337ab7;
  text-decoration: none;
}
a:hover,
a:focus {
  color: #23527c;
  text-decoration: underline;
}
p {
  margin: 0 0 10px;
}
h3,
.h3 {
  font-size: 24px;
}
.text-primary { color: #337ab7 !important; }
.text-success { color: #3c763d !important; }
.text-danger { color: #a94442 !important; }
.text-info { color: #31708f !important; }
.text-warning { color: #8a6d3b !important; }
.text-muted { color: #777 !important; }

/* ---------- Modal used as page container ---------- */
body > .modal-dialog {
  margin: 30px auto;
  pointer-events: auto;
}
body > .modal-dialog.modal-lg,
.modal-dialog.modal-lg {
  max-width: 900px;
  width: 900px;
}
@media (max-width: 991.98px) {
  body > .modal-dialog.modal-lg,
  .modal-dialog.modal-lg {
    width: auto;
    max-width: calc(100% - 20px);
    margin: 10px auto;
  }
}
.modal-content {
  position: relative;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  background-clip: padding-box;
  outline: 0;
}
.modal-body {
  position: relative;
  padding: 15px;
}

/* ---------- Panel (BS3) ---------- */
.panel {
  margin-bottom: 20px;
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.panel-body {
  padding: 15px;
}
.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}
.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: inherit;
  font-weight: 500;
  line-height: 1.1;
}
.panel-footer {
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
}
.panel-default { border-color: #ddd; }
.panel-default > .panel-heading {
  color: #333;
  background-color: #f5f5f5;
  border-color: #ddd;
  background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);
  background-repeat: repeat-x;
}
.panel-success { border-color: #d6e9c6; }
.panel-success > .panel-heading {
  color: #3c763d;
  background-color: #dff0d8;
  border-color: #d6e9c6;
  background-image: linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);
  background-repeat: repeat-x;
}
.panel-danger { border-color: #ebccd1; }
.panel-danger > .panel-heading {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
  background-image: linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);
  background-repeat: repeat-x;
}
.panel-info { border-color: #bce8f1; }
.panel-info > .panel-heading {
  color: #31708f;
  background-color: #d9edf7;
  border-color: #bce8f1;
  background-image: linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);
  background-repeat: repeat-x;
}
.panel-warning { border-color: #faebcc; }
.panel-warning > .panel-heading {
  color: #8a6d3b;
  background-color: #fcf8e3;
  border-color: #faebcc;
  background-image: linear-gradient(to bottom, #fcf8e3 0, #faf2cc 100%);
  background-repeat: repeat-x;
}
.panel-primary { border-color: #337ab7; }
.panel-primary > .panel-heading {
  color: #fff;
  background-color: #337ab7;
  border-color: #337ab7;
  background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
  background-repeat: repeat-x;
}

/* ---------- Well (BS3 + theme) ---------- */
.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  background-image: linear-gradient(to bottom, #e8e8e8 0, #f5f5f5 100%);
  background-repeat: repeat-x;
  border-color: #dcdcdc;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ---------- Form horizontal + grid (BS3 float) ---------- */
.form-horizontal .form-group {
  display: block;
  margin-right: -15px;
  margin-left: -15px;
  margin-bottom: 15px;
}
.form-horizontal .form-group::before,
.form-horizontal .form-group::after {
  content: " ";
  display: table;
}
.form-horizontal .form-group::after {
  clear: both;
}
.form-horizontal .control-label {
  padding-top: 7px;
  margin-bottom: 0;
  text-align: right;
  font-weight: 700;
}
.form-horizontal [class*="col-sm-"],
.form-horizontal [class*="col-xs-"] {
  float: left;
  position: relative;
  min-height: 1px;
  padding-right: 15px;
  padding-left: 15px;
  flex: none !important;
  max-width: none !important;
  width: auto;
}
@media (min-width: 768px) {
  .form-horizontal .col-sm-2 { width: 16.66666667%; }
  .form-horizontal .col-sm-8 { width: 66.66666667%; }
  .form-horizontal .col-sm-10 { width: 83.33333333%; }
  .form-horizontal .control-label {
    text-align: right;
  }
}
@media (max-width: 767.98px) {
  .form-horizontal .control-label {
    text-align: left;
  }
  .form-horizontal [class*="col-sm-"] {
    float: none;
    width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* ---------- Form controls (BS3) ---------- */
.form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  background-image: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.form-control:focus {
  border-color: #66afe9;
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control::placeholder {
  color: #999;
  opacity: 1;
}
textarea.form-control {
  height: auto;
}
input[type="file"].form-control {
  height: auto;
  padding: 6px 12px;
}

/* ---------- Buttons (BS3 + theme) ---------- */
.btn {
  display: inline-block;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  border-radius: 4px;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
}
.btn:hover,
.btn:focus {
  text-decoration: none;
  color: #fff;
}
.btn-xs {
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}
.btn-primary {
  color: #fff;
  background-color: #337ab7;
  border-color: #2e6da4;
  background-image: linear-gradient(to bottom, #337ab7 0, #265a88 100%);
  background-repeat: repeat-x;
  border-color: #245580;
}
.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background-color: #265a88;
  border-color: #245580;
  background-position: 0 -15px;
}
.btn-success {
  color: #fff;
  background-color: #5cb85c;
  border-color: #4cae4c;
  background-image: linear-gradient(to bottom, #5cb85c 0, #419641 100%);
  background-repeat: repeat-x;
  border-color: #3e8f3e;
}
.btn-success:hover,
.btn-success:focus {
  color: #fff;
  background-color: #419641;
  border-color: #3e8f3e;
  background-position: 0 -15px;
}
.btn-danger {
  color: #fff;
  background-color: #d9534f;
  border-color: #d43f3a;
  background-image: linear-gradient(to bottom, #d9534f 0, #c12e2a 100%);
  background-repeat: repeat-x;
  border-color: #b92c28;
}
.btn-info {
  color: #fff;
  background-color: #5bc0de;
  border-color: #46b8da;
  background-image: linear-gradient(to bottom, #5bc0de 0, #2aabd2 100%);
  background-repeat: repeat-x;
  border-color: #28a4c9;
}
.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
  background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%);
  background-repeat: repeat-x;
  text-shadow: 0 1px 0 #fff;
  border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
  color: #333;
  background-color: #e0e0e0;
  border-color: #adadad;
}

/* ---------- Radio inline ---------- */
.radio-inline {
  position: relative;
  display: inline-block;
  padding-left: 20px;
  margin-bottom: 0;
  margin-top: 0;
  margin-right: 10px;
  font-weight: 400;
  vertical-align: middle;
  cursor: pointer;
}
.radio-inline + .radio-inline {
  margin-top: 0;
  margin-left: 0;
}
.radio-inline input[type="radio"] {
  position: absolute;
  margin-top: 4px;
  margin-left: -20px;
}

/* ---------- col-xs (BS3) ---------- */
.col-xs-1 { float: left; width: 8.33333333%; padding-left: 15px; padding-right: 15px; }
.col-xs-2 { float: left; width: 16.66666667%; padding-left: 15px; padding-right: 15px; }
.col-xs-3 { float: left; width: 25%; padding-left: 15px; padding-right: 15px; }
.col-xs-4 { float: left; width: 33.33333333%; padding-left: 15px; padding-right: 15px; }
.col-xs-5 { float: left; width: 41.66666667%; padding-left: 15px; padding-right: 15px; }
.col-xs-6 { float: left; width: 50%; padding-left: 15px; padding-right: 15px; }
.col-xs-7 { float: left; width: 58.33333333%; padding-left: 15px; padding-right: 15px; }
.col-xs-8 { float: left; width: 66.66666667%; padding-left: 15px; padding-right: 15px; }
.col-xs-9 { float: left; width: 75%; padding-left: 15px; padding-right: 15px; }
.col-xs-10 { float: left; width: 83.33333333%; padding-left: 15px; padding-right: 15px; }
.col-xs-11 { float: left; width: 91.66666667%; padding-left: 15px; padding-right: 15px; }
.col-xs-12 { float: left; width: 100%; padding-left: 15px; padding-right: 15px; }

/* ---------- Table bg colors closer to BS3 ---------- */
.table > :not(caption) > * > .bg-info,
.table .bg-info,
tr.bg-info > * {
  --bs-table-bg-type: #d9edf7;
  background-color: #d9edf7 !important;
  color: #31708f;
}
.table > :not(caption) > * > .bg-warning,
.table .bg-warning,
tr.bg-warning > * {
  --bs-table-bg-type: #fcf8e3;
  background-color: #fcf8e3 !important;
  color: #8a6d3b;
}
.table > :not(caption) > * > .bg-danger,
.table .bg-danger,
tr.bg-danger > *,
thead.bg-danger {
  --bs-table-bg-type: #f2dede;
  background-color: #f2dede !important;
  color: #a94442;
}
.bg-info:not(tr) {
  background-color: #d9edf7 !important;
}
.bg-warning:not(tr) {
  background-color: #fcf8e3 !important;
}
.bg-danger:not(tr) {
  background-color: #f2dede !important;
}
.bg-default {
  background-color: #fff !important;
}

/* ---------- Table (BS3-ish) ---------- */
.table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  font-size: 14px;
}
.table > :not(caption) > * > * {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: top;
  border-top: 1px solid #ddd;
}
