/* ==========================================================================
   Account 2027 - component.css
   Overrides for JUI Bootstrap 2 and the com_account (com_myservices) views so
   their existing markup (.container/.row/.spanN, .infobox, .table, .tab-head,
   overlays) inherits the nfpt.com look without touching the component.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Bootstrap 2 grid -> fluid inside the content card
   The profile view uses .container.profile > .row > .span6, whose widths are
   fixed pixels tied to the viewport. Inside a card next to a sidebar that
   overflows, so spans become percentage based flex children here.
   -------------------------------------------------------------------------- */
/* Make the content column a container so span widths can respond to its width, not the viewport. */
.acct-content { container-type: inline-size; }

.acct-content .container,
.acct-content .container-fluid {
  box-sizing: border-box;
  margin: 0;
  max-width: 100%;
  padding: 0;
  width: auto;
}

.acct-content .row,
.acct-content .row-fluid {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  margin-left: -20px;
  width: auto;
}

.acct-content .row::before,
.acct-content .row::after { display: none; }

.acct-content .row > [class*="span"],
.acct-content .row-fluid > [class*="span"] {
  box-sizing: border-box;
  float: none;
  margin-left: 20px;
  min-height: 0;
  min-width: 0;
}

/* Twelve column percentages minus the 20px gutter. */
.acct-content .row > .span12, .acct-content .row-fluid > .span12 { width: calc(100% - 20px); }
.acct-content .row > .span11, .acct-content .row-fluid > .span11 { width: calc(91.6667% - 20px); }
.acct-content .row > .span10, .acct-content .row-fluid > .span10 { width: calc(83.3333% - 20px); }
.acct-content .row > .span9,  .acct-content .row-fluid > .span9  { width: calc(75% - 20px); }
.acct-content .row > .span8,  .acct-content .row-fluid > .span8  { width: calc(66.6667% - 20px); }
.acct-content .row > .span7,  .acct-content .row-fluid > .span7  { width: calc(58.3333% - 20px); }
.acct-content .row > .span6,  .acct-content .row-fluid > .span6  { width: calc(50% - 20px); }
.acct-content .row > .span5,  .acct-content .row-fluid > .span5  { width: calc(41.6667% - 20px); }
.acct-content .row > .span4,  .acct-content .row-fluid > .span4  { width: calc(33.3333% - 20px); }
.acct-content .row > .span3,  .acct-content .row-fluid > .span3  { width: calc(25% - 20px); }
.acct-content .row > .span2,  .acct-content .row-fluid > .span2  { width: calc(16.6667% - 20px); }
.acct-content .row > .span1,  .acct-content .row-fluid > .span1  { width: calc(8.3333% - 20px); }

/* --------------------------------------------------------------------------
   2. Bootstrap 2 components
   -------------------------------------------------------------------------- */
.well {
  background: var(--acct-band);
  border: 0;
  border-radius: var(--acct-radius);
  box-shadow: none;
}

.page-header {
  border-bottom: 1px solid var(--acct-line);
  margin: 0 0 20px;
  padding-bottom: 12px;
}

.nav-tabs {
  border-bottom: 1px solid var(--acct-line);
}

.nav-tabs > li > a {
  border: 0;
  border-radius: 8px 8px 0 0;
  color: var(--acct-ink-soft);
}

.nav-tabs > li > a:hover { background: rgba(11, 23, 49, 0.06); border-color: transparent; }

.nav-tabs > .active > a,
.nav-tabs > .active > a:hover {
  border: 0;
  border-bottom: 2px solid var(--acct-orange);
  color: var(--acct-navy);
}

.nav-tabs.nav-stacked > li > a {
  border: 1px solid var(--acct-line);
  border-radius: 0;
}

.nav-tabs.nav-stacked > li:first-child > a { border-radius: var(--acct-radius) var(--acct-radius) 0 0; }
.nav-tabs.nav-stacked > li:last-child > a { border-radius: 0 0 var(--acct-radius) var(--acct-radius); }

.label,
.badge {
  background-color: var(--acct-navy);
  border-radius: var(--acct-radius-pill);
  font-weight: 500;
  text-shadow: none;
}

.label-warning, .badge-warning { background-color: var(--acct-orange); }
.label-success, .badge-success { background-color: var(--acct-success); }
.label-important, .badge-important { background-color: var(--acct-danger); }

/* Tables (profile "Membership Details", "Your Details", CEC report, receipts) */
.table {
  border-collapse: collapse;
  margin-bottom: 0;
  width: 100%;
}

.table th,
.table td {
  border-top: 1px solid var(--acct-line);
  color: var(--acct-ink);
  line-height: 1.5;
  padding: 14px 8px;
  text-align: left;
  vertical-align: middle;
}

.table thead th,
.table th[scope="row"] {
  color: var(--acct-ink);
  font-weight: 500;
}

.table th[scope="row"] { color: var(--acct-ink-soft); white-space: nowrap; }

.table-striped tbody > tr:nth-child(odd) > td,
.table-striped tbody > tr:nth-child(odd) > th { background-color: rgba(11, 23, 49, 0.02); }

.table-bordered {
  border: 1px solid var(--acct-line);
  border-radius: var(--acct-radius);
}

.table-bordered th,
.table-bordered td { border-left: 1px solid var(--acct-line); }

/* Section headings placed above tables in the subscription profile. */
.tab-head,
p.tab-head {
  color: var(--acct-ink);
  font-family: var(--acct-font-head);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

/* Pagination */
.pagination ul {
  border-radius: var(--acct-radius-pill);
  box-shadow: none;
}

.pagination ul > li > a,
.pagination ul > li > span {
  border-color: var(--acct-line);
  color: var(--acct-ink);
}

.pagination ul > .active > a,
.pagination ul > .active > span {
  background: var(--acct-navy);
  color: #fff;
}

/* --------------------------------------------------------------------------
   3. com_account: legacy ".infobox" panels (non-subscription profile, CEC,
   billing, etc.). Previously navy border + orange ridge; now nfpt.com cards.
   -------------------------------------------------------------------------- */
.infobox {
  background: var(--acct-surface);
  border: 1px solid var(--acct-line);
  border-radius: var(--acct-radius);
  box-shadow: none;
  margin: 0 16px 16px 0;
  padding: 20px 24px;
}

.infobox h3,
.infobox h4 {
  border-bottom: 1px solid var(--acct-line);
  color: var(--acct-ink);
  font-size: 20px;
  margin: 0 0 12px;
  padding-bottom: 10px;
}

.infobox hr {
  border-bottom: 1px solid var(--acct-line) !important;
  color: transparent !important;
}

.infobox b { color: var(--acct-navy); }

/* Row separators inside .nfptInfo tables */
.infobox .info,
.infobox .infoHeader {
  border-bottom: 1px solid var(--acct-line);
  padding: 8px 8px 8px 0;
}

.infobox .infoHeader { width: 150px; }

/* Inline action pills sized to sit beside table values. */
.infobox button,
.smallButton,
.resource button,
.addProductToCart {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  margin-left: 10px;
  padding: 6px 14px;
}

.infobox button.right { margin-left: 0; }

/* --------------------------------------------------------------------------
   4. com_account: subscription (Certify / Succeed) profile
   -------------------------------------------------------------------------- */
.profile .title {
  color: var(--acct-navy);
  font-family: var(--acct-font-head);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.profile .subtitle {
  color: var(--acct-ink-muted);
  font-size: 18px;
}

.profile .text-blue { color: var(--acct-link); }

/* Course / webinar tiles keep their tinted backgrounds but pick up the card radius. */
.profile .rounded-2 { border-radius: var(--acct-radius-lg) !important; }
.profile .border-1 { border-color: rgba(34, 34, 34, 0.06) !important; }

.profile .webinar-bg {
  background-color: var(--acct-surface);
  border: 1px solid var(--acct-line);
}

.profile .convert-time { color: var(--acct-ink-muted); }

/* Trainer Listing photo keeps the card radius. */
.profile .photo img { border-radius: var(--acct-radius); }

/* Trainer Listing labels wrap inside a fixed column so the photo and About text keep the rest of the row. */
.profile .table.trainer-listing th[scope="row"] {
  white-space: normal;
  width: 150px;
}

/* The component forces #164DCC on .blue-btn; only the shape is adjusted here. */
.profile .btn.blue-btn,
.profile .btn.grey-blue-btn {
  border-radius: var(--acct-radius-pill) !important;
  font-weight: 500;
  padding: 11px 24px !important;
}

/* --------------------------------------------------------------------------
   5. com_account: overlays (payment dialogs, add-to-cart confirmation)
   -------------------------------------------------------------------------- */
div.overlayWindow {
  border: 0;
  border-radius: var(--acct-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  height: auto;
  left: 50%;
  max-height: 80vh;
  max-width: 640px;
  padding: 32px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
}

div#overlay { background-color: rgba(11, 23, 49, 0.6); }

div.overlayWindow h3 { margin-top: 0; }

/* Continue Shopping and Checkout sit on one row. */
div.overlayWindow .overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* Dialog actions keep the site pill size. addProductToCart is sized for table rows. */
div.overlayWindow .acct-btn,
div.overlayWindow .addProductToCart {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  padding: 10px 26px;
  width: auto;
}

/* --------------------------------------------------------------------------
   6. com_account: misc utility colours defined by the old brand
   -------------------------------------------------------------------------- */
.nfptOrange { color: var(--acct-orange); }
.nfptBlue { color: var(--acct-navy); }
.error { color: var(--acct-danger) !important; }
.grey { color: var(--acct-ink-muted); }

/* Chapter Show/Hide and Add to Cart controls are taller than the row, so their
   padding crosses the rule. Add to Cart is nested in a link, not a direct child.
   Bootstrap sets li line-height to 20px. 100% is the button's own height.
   Shift the control up until its bottom edge meets that rule. */
ul.courseInfo > li button.smallButton {
  transform: translateY(calc(20px - 100%));
}

/* The template nudges buttons 1px on press. Keep that nudge from the corrected position. */
ul.courseInfo > li button.smallButton:active {
  transform: translateY(calc(21px - 100%));
}

/* Course material rows (prep course, webinar tiles).
   course.css draws a second border on the list itself and adds 3px of margin on hover. */
ul.courseMaterial {
  border-bottom: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Drop the hover border and margin so the row does not grow. */
.acct-content ul.courseMaterial:hover {
  border-bottom: 0;
  margin: 0;
}

ul.courseMaterial li {
  border-bottom: 1px solid var(--acct-line);
  padding: 8px 0;
}

/* Recolor the item rule. #cecece is the grey course.css used on list hover, rgb(206, 206, 206). */
.acct-content ul.courseMaterial:hover > li {
  border-bottom-color: #cecece;
}

/* --------------------------------------------------------------------------
   7. com_account: free CECs (self-tests)
   View Packet and Take Test use .test_button, which paints the legacy orange
   block over the site pill. Restore the site button inside each packet card.
   -------------------------------------------------------------------------- */
/* The packet link wraps the button. Stretch it so the pill fills the card. */
div.self_test > a {
  display: flex;
  text-decoration: none;
}

div.self_test > a:hover,
div.self_test > a:focus {
  text-decoration: none;
}

div.self_test .test_button {
  align-items: center;
  background-color: var(--acct-navy);
  background-image: none;
  border: 1px solid var(--acct-navy);
  border-radius: var(--acct-radius-pill);
  box-shadow: none;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-family: var(--acct-font-body);
  font-size: 15px;
  font-weight: 500;
  justify-content: center;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin: 20px 0 0;
  max-width: 100%;
  padding: 10px 26px;
  text-shadow: none;
  width: 100%;
}

div.self_test .test_button:hover,
div.self_test .test_button:focus {
  background-color: var(--acct-navy-hover);
  border-color: var(--acct-navy-hover);
  color: #fff;
  text-decoration: none;
}

div.self_test .test_button:active {
  transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   8. Responsive
   -------------------------------------------------------------------------- */

/* When the content column itself is narrow (sidebars present, mid-size screens) stack every span. */
@container (max-width: 880px) {
  .acct-content .row > [class*="span"],
  .acct-content .row-fluid > [class*="span"] { width: calc(100% - 20px); }
}

@media (max-width: 767px) {
  /* Every span collapses to a single column on phones. */
  .acct-content .row > [class*="span"],
  .acct-content .row-fluid > [class*="span"] { width: calc(100% - 20px); }

  .infobox {
    float: none;
    margin-right: 0;
    max-width: none;
  }

  .infobox .info,
  .infobox .infoHeader {
    display: block;
    width: auto;
  }

  .infobox .infoHeader { border-bottom: 0; padding-bottom: 0; }

  .table th[scope="row"] { white-space: normal; }
}
