/* TMI look for Community Builder pages: edit profile, login, lost password and the
   other plain CB forms. The registration page (own design) and the profile view
   (styled by plg_cb_tmicompany) are left alone. Everything is scoped to CB's wrapper. */
.cb_template:not(.cbRegistration):not(.cbProfile) {
  --tmi-red: #D92B2B;
  --tmi-red-dark: #B01F1F;
  --tmi-red-light: #F5E5E5;
  --tmi-navy: #0F1628;
  --tmi-gray-50: #F8F8FA;
  --tmi-gray-500: #6B7280;
  --tmi-gray-700: #374151;
  --tmi-border: #E5E7EB;
  font-family: 'Inter', 'Montserrat', system-ui, sans-serif;
  color: var(--tmi-gray-700);
  max-width: 820px;
  margin: 10px auto 40px;
  background: #fff;
  border: 1px solid var(--tmi-border);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  padding: 32px 36px;
}

/* Page title */
.cb_template:not(.cbRegistration):not(.cbProfile) .cb-page-header,
.cb_template:not(.cbRegistration):not(.cbProfile) .page-header {
  border: 0 !important;
  margin-bottom: 22px !important;
  padding-bottom: 0;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .cb-page-header-title,
.cb_template:not(.cbRegistration):not(.cbProfile) .page-header h1,
.cb_template:not(.cbRegistration):not(.cbProfile) .page-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--tmi-navy);
  margin: 0 !important;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .cb-page-header-title::after,
.cb_template:not(.cbRegistration):not(.cbProfile) .page-header h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 10px;
  border-radius: 3px;
  background: var(--tmi-red);
}

/* Tabs */
.cb_template:not(.cbRegistration):not(.cbProfile) .nav-tabs {
  border-bottom: 1px solid var(--tmi-border);
  gap: 4px;
  margin-bottom: 22px;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .nav-tabs .nav-link {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--tmi-gray-500);
  font-weight: 600;
  padding: 10px 16px;
  background: none;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .nav-tabs .nav-link:hover { color: var(--tmi-navy); }
.cb_template:not(.cbRegistration):not(.cbProfile) .nav-tabs .nav-link.active {
  color: var(--tmi-red);
  border-bottom-color: var(--tmi-red);
  background: none;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .tab-content { border: 0 !important; padding: 0 !important; }

/* Field rows: label above the field, in a clean single column */
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_form_line {
  display: block;
  margin: 0 0 18px !important;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_form_line > .col-form-label,
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_form_line > .cb_field {
  max-width: 100%;
  flex: none;
  width: 100%;
  padding: 0 !important;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_form_line > .col-form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--tmi-navy);
  margin-bottom: 6px;
  padding-top: 0 !important;
}
/* required fields get a small red asterisk instead of the star icon */
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_form_line:has(.fa-star) > .col-form-label::after {
  content: " *";
  color: var(--tmi-red);
}

/* Inputs */
.cb_template:not(.cbRegistration):not(.cbProfile) .form-control,
.cb_template:not(.cbRegistration):not(.cbProfile) select.form-control,
.cb_template:not(.cbRegistration):not(.cbProfile) .form-select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--tmi-border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: .95rem;
  color: var(--tmi-navy);
  background-color: #fff;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .form-control:focus,
.cb_template:not(.cbRegistration):not(.cbProfile) .form-select:focus {
  border-color: var(--tmi-red);
  box-shadow: 0 0 0 3px rgba(217, 43, 43, .12);
  outline: 0;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .input-group { flex-wrap: nowrap; }
.cb_template:not(.cbRegistration):not(.cbProfile) .input-group > .form-control { border-radius: 10px 0 0 10px; }
.cb_template:not(.cbRegistration):not(.cbProfile) .input-group .btn,
.cb_template:not(.cbRegistration):not(.cbProfile) .input-group-text {
  border: 1px solid var(--tmi-border);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--tmi-gray-50);
  color: var(--tmi-gray-700);
  font-size: .85rem;
  font-weight: 600;
}

/* The star / eye icons next to every field: hide the clutter */
.cb_template:not(.cbRegistration):not(.cbProfile) .cbFieldIcons { display: none !important; }

/* Help text and validation */
.cb_template:not(.cbRegistration):not(.cbProfile) .form-text,
.cb_template:not(.cbRegistration):not(.cbProfile) .cbFieldDescription { font-size: .8rem; color: var(--tmi-gray-500); }
.cb_template:not(.cbRegistration):not(.cbProfile) label.error,
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_result_error,
.cb_template:not(.cbRegistration):not(.cbProfile) .invalid-feedback { color: var(--tmi-red); font-size: .8rem; }
.cb_template:not(.cbRegistration):not(.cbProfile) .form-control.error { border-color: var(--tmi-red); }

/* Buttons */
.cb_template:not(.cbRegistration):not(.cbProfile) .btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 10px 24px;
  font-size: .95rem;
  box-shadow: none !important;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .btn-primary {
  background: var(--tmi-red) !important;
  border-color: var(--tmi-red) !important;
  color: #fff !important;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .btn-primary:hover,
.cb_template:not(.cbRegistration):not(.cbProfile) .btn-primary:focus { background: var(--tmi-red-dark) !important; border-color: var(--tmi-red-dark) !important; }
.cb_template:not(.cbRegistration):not(.cbProfile) .btn-secondary,
.cb_template:not(.cbRegistration):not(.cbProfile) .btn-light {
  background: #fff !important;
  border: 1px solid var(--tmi-navy) !important;
  color: var(--tmi-navy) !important;
}
.cb_template:not(.cbRegistration):not(.cbProfile) .btn-secondary:hover,
.cb_template:not(.cbRegistration):not(.cbProfile) .btn-light:hover { background: var(--tmi-gray-50) !important; }
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_form_buttons_line,
.cb_template:not(.cbRegistration):not(.cbProfile) .cbEditProfileButtons,
.cb_template:not(.cbRegistration):not(.cbProfile) .form-group.cb_form_line:last-child .cb_field {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* "Show" button inside the password fields stays a quiet grey tab */
.cb_template:not(.cbRegistration):not(.cbProfile) .input-group .btn,
.cb_template:not(.cbRegistration):not(.cbProfile) .input-group .btn-light {
  background: var(--tmi-gray-50) !important;
  border: 1px solid var(--tmi-border) !important;
  border-left: 0 !important;
  border-radius: 0 10px 10px 0 !important;
  color: var(--tmi-gray-700) !important;
  padding: 9px 16px;
  min-height: 44px;
}
/* Update / Cancel line up with the fields instead of sitting in CB's right column */
.cb_template:not(.cbRegistration):not(.cbProfile) .offset-sm-3,
.cb_template:not(.cbRegistration):not(.cbProfile) [class*="offset-"] { margin-left: 0 !important; }

/* Links */
.cb_template:not(.cbRegistration):not(.cbProfile) a { color: var(--tmi-red); }
.cb_template:not(.cbRegistration):not(.cbProfile) a:hover { color: var(--tmi-red-dark); }

/* 1.0.2 — Lost username / password page */
.cbLostPassForm #lostpassreminder .cb_field { display: flex; flex-wrap: wrap; gap: 10px; }
.cbLostPassForm .form-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 16px 9px 14px;
  border: 1px solid var(--tmi-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cbLostPassForm .form-check-inline .form-check-input {
  float: none;
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--tmi-red);
  cursor: pointer;
}
.cbLostPassForm .form-check-inline .form-check-label { font-weight: 600; color: var(--tmi-navy); cursor: pointer; }
.cbLostPassForm .form-check-inline:hover { border-color: var(--tmi-red); }
.cbLostPassForm .form-check-inline:has(.form-check-input:checked) { border-color: var(--tmi-red); background: var(--tmi-red-light); }
.cbLostPassForm .form-check-input:checked { background-color: var(--tmi-red); border-color: var(--tmi-red); }
.cbLostPassForm .form-check-input:focus { box-shadow: 0 0 0 3px rgba(217, 43, 43, .15); border-color: var(--tmi-red); }
/* the "If you lost your …" help texts */
.cb_template.cbLostPassForm .cb_form_line[id$="desc"] > .cb_field.cb_field {
  background: var(--tmi-gray-50);
  border-left: 3px solid var(--tmi-red);
  border-radius: 8px;
  padding: 12px 16px !important;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--tmi-gray-700);
}
.cbLostPassForm .cb_form_line[id$="desc"] strong { color: var(--tmi-navy); }
.cbLostPassForm .btn-primary:disabled,
.cbLostPassForm .btn-primary.disabled { opacity: .5; cursor: not-allowed; }

/* Button rows: line up with the fields (no column padding) */
.cb_template:not(.cbRegistration):not(.cbProfile) .cb_form_line > [class*="offset-"] {
  width: 100%;
  max-width: 100%;
  flex: none;
  padding: 0 !important;
}

/* Never box in the member profile (styled by plg_cb_tmicompany) */
.cb_template:has(.tmi-cbp) {
  max-width: none;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

/* Phones */
@media (max-width: 600px) {
  .cb_template:not(.cbRegistration):not(.cbProfile) { padding: 22px 18px; border-radius: 12px; margin: 0 0 24px; }
  .cb_template:not(.cbRegistration):not(.cbProfile) .cb-page-header-title { font-size: 1.35rem; }
  .cb_template:not(.cbRegistration):not(.cbProfile) .btn { width: 100%; }
}
