/* ==========================================================================
   FASTTRACK Portal - Modern Theme
   Consistent with FAST Testing public website (bte/assets/css/site.css)
   Bootstrap 5.3 overrides + portal-specific styling
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --ft-red:       #C8102E;
  --ft-red-dark:  #A00D24;
  --ft-red-light: #E8344E;
  --ft-charcoal:  #1E1E1E;
  --ft-dark:      #141414;
  --ft-steel:     #3A3F47;
  --ft-steel-mid: #6C757D;
  --ft-steel-lt:  #B0B8C1;
  --ft-yellow:    #F5C518;
  --ft-offwhite:  #F4F5F7;
  --ft-white:     #FFFFFF;
  --ft-blue:      #2C7BE5;
  --ft-green:     #00A854;

  /* Bootstrap primary override */
  --bs-primary:       var(--ft-red);
  --bs-primary-rgb:   200, 16, 46;
  --bs-link-color:    var(--ft-red);
  --bs-link-hover-color: var(--ft-red-dark);
}

/* ---------- Global ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ft-charcoal);
  background: var(--ft-offwhite);
  font-size: .9rem;
}

::selection {
  background: var(--ft-red);
  color: #fff;
}

img { max-width: 100%; height: auto; }

a { color: var(--ft-red); }
a:hover { color: var(--ft-red-dark); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700;
  color: var(--ft-charcoal);
}

.ft-muted { color: var(--ft-steel-mid); }
.ft-accent-text { color: var(--ft-red); }

.ft-section-label {
  text-transform: uppercase;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--ft-red);
  margin-bottom: .35rem;
}

/* ---------- Buttons (Bootstrap override) ---------- */
.btn-primary {
  --bs-btn-bg: var(--ft-red);
  --bs-btn-border-color: var(--ft-red);
  --bs-btn-hover-bg: var(--ft-red-dark);
  --bs-btn-hover-border-color: var(--ft-red-dark);
  --bs-btn-active-bg: #8C0B1E;
  --bs-btn-active-border-color: #8C0B1E;
  --bs-btn-disabled-bg: var(--ft-steel-lt);
  --bs-btn-disabled-border-color: var(--ft-steel-lt);
  font-weight: 600;
}

.btn-outline-primary {
  --bs-btn-color: var(--ft-red);
  --bs-btn-border-color: var(--ft-red);
  --bs-btn-hover-bg: var(--ft-red);
  --bs-btn-hover-border-color: var(--ft-red);
  --bs-btn-active-bg: var(--ft-red-dark);
  --bs-btn-active-border-color: var(--ft-red-dark);
  font-weight: 600;
}

.btn-outline-light { font-weight: 600; }

.btn-lg {
  padding: .65rem 1.5rem;
  font-size: 1rem;
}

/* ---------- Portal Navbar ---------- */
.ft-portal-navbar {
  background: var(--ft-dark);
  padding: .5rem 0;
}

.ft-portal-navbar .navbar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.ft-portal-navbar .navbar-brand:hover { color: #fff; }

.ft-portal-navbar .ft-logo {
  height: 32px;
  width: auto;
}

.ft-portal-navbar .ft-user-info {
  color: rgba(255,255,255,.7);
  font-size: .8rem;
}
.ft-portal-navbar .ft-user-info strong {
  color: #fff;
  font-weight: 600;
}

.ft-portal-navbar .btn-outline-light {
  --bs-btn-color: rgba(255,255,255,.8);
  --bs-btn-border-color: rgba(255,255,255,.25);
  --bs-btn-hover-bg: rgba(255,255,255,.1);
  --bs-btn-hover-border-color: rgba(255,255,255,.4);
  --bs-btn-hover-color: #fff;
  font-size: .8rem;
  padding: .3rem .75rem;
}

/* Red accent line under navbar */
.ft-nav-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--ft-red) 0%, var(--ft-red-dark) 100%);
}

/* ---------- Sub-Navigation ---------- */
.ft-subnav {
  background: var(--ft-white);
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding: .5rem 0;
}

.ft-subnav .nav-link {
  color: var(--ft-steel);
  font-weight: 500;
  font-size: .82rem;
  padding: .35rem .75rem;
  border-radius: .375rem;
  transition: all .15s ease;
}
.ft-subnav .nav-link:hover {
  color: var(--ft-red);
  background: rgba(200,16,46,.06);
}
.ft-subnav .nav-link.active,
.ft-subnav .nav-link:active {
  color: var(--ft-red);
  background: rgba(200,16,46,.1);
  font-weight: 600;
}
.ft-subnav .nav-link i {
  width: 1.2em;
  text-align: center;
}

/* ---------- Page Content Area ---------- */
.ft-content {
  padding: 1.5rem 0 3rem;
}

.ft-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.ft-breadcrumb {
  font-size: .78rem;
}
.ft-breadcrumb a {
  color: var(--ft-steel-mid);
  text-decoration: none;
}
.ft-breadcrumb a:hover {
  color: var(--ft-red);
}

/* ---------- Cards (Portal panels - replaces CF_TABLE) ---------- */
.ft-card {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .75rem;
  background: #fff;
  margin-bottom: 1.25rem;
}

.ft-card-header {
  background: var(--ft-charcoal);
  color: #fff;
  padding: .65rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  border-radius: .75rem .75rem 0 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ft-card-header i {
  color: var(--ft-red-light);
}

.ft-card-body {
  padding: 1rem;
}

.ft-card-accent {
  border-top: 3px solid var(--ft-red);
}

/* Static cards (no hover lift) */
.ft-card-static { transition: none; }

/* Hover-lift cards */
.ft-card-hover {
  transition: transform .2s ease, box-shadow .2s ease;
}
.ft-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

/* ---------- Data Tables ---------- */
.ft-table {
  width: 100%;
  font-size: .82rem;
  border-collapse: collapse;
}

.ft-table thead th {
  background: var(--ft-charcoal);
  color: #fff;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .55rem .6rem;
  white-space: nowrap;
  border: none;
  position: sticky;
  top: 0;
  z-index: 2;
}

.ft-table thead th a {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.ft-table thead th a:hover {
  color: var(--ft-yellow);
}

.ft-table tbody td {
  padding: .5rem .6rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
  vertical-align: middle;
}

.ft-table tbody tr:hover {
  background: rgba(200,16,46,.03);
}

.ft-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,.015);
}
.ft-table tbody tr:nth-child(even):hover {
  background: rgba(200,16,46,.03);
}

/* ---------- Status Badges ---------- */
.ft-badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: .25rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.ft-badge-valid {
  background: rgba(0,168,84,.1);
  color: var(--ft-green);
}
.ft-badge-pending {
  background: rgba(44,123,229,.1);
  color: var(--ft-blue);
}
.ft-badge-expired {
  background: rgba(200,16,46,.1);
  color: var(--ft-red);
}

/* ---------- Dashboard Cards ---------- */
.ft-dash-card {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .75rem;
  background: #fff;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all .2s ease;
  border-left: 4px solid var(--ft-red);
}
.ft-dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  color: inherit;
  text-decoration: none;
}
.ft-dash-card .ft-dash-icon {
  width: 42px;
  height: 42px;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: rgba(200,16,46,.08);
  color: var(--ft-red);
}
.ft-dash-card h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .2rem;
}
.ft-dash-card p {
  font-size: .8rem;
  color: var(--ft-steel-mid);
  margin-bottom: 0;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  font-size: .85rem;
  border-radius: .375rem;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--ft-red);
  box-shadow: 0 0 0 .15rem rgba(200,16,46,.2);
}
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ft-steel);
  margin-bottom: .3rem;
}

textarea.form-control {
  font-family: 'Courier New', monospace;
}

/* Form fields from legacy (formfield1 replacement) */
.ft-form-row {
  display: flex;
  gap: .75rem;
  margin-bottom: .75rem;
  align-items: center;
}
.ft-form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ft-steel);
  min-width: 120px;
  text-align: right;
}

/* ---------- Checkbox styling ---------- */
.form-check-input:checked {
  background-color: var(--ft-red);
  border-color: var(--ft-red);
}
.form-check-input:focus {
  box-shadow: 0 0 0 .15rem rgba(200,16,46,.2);
}

/* ---------- Alerts ---------- */
.alert { font-size: .85rem; border-radius: .5rem; }

/* ---------- Login Page ---------- */
.ft-login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ft-charcoal);
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255,255,255,.015) 10px,
      rgba(255,255,255,.015) 11px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(255,255,255,.015) 10px,
      rgba(255,255,255,.015) 11px
    );
  padding: 2rem 1rem;
}

.ft-login-card {
  background: #fff;
  border-radius: .75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
}

.ft-login-card .ft-login-logo {
  height: 50px;
  margin-bottom: 1rem;
}

.ft-login-card h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.ft-login-divider {
  border-top: 1px solid rgba(0,0,0,.08);
  margin: 1.5rem 0;
}

/* ---------- Portal Footer ---------- */
.ft-portal-footer {
  background: var(--ft-charcoal);
  color: rgba(255,255,255,.45);
  padding: 1rem 0;
  font-size: .75rem;
  margin-top: auto;
}
.ft-portal-footer a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
}
.ft-portal-footer a:hover {
  color: var(--ft-red-light);
}

/* ---------- Cert Basket (Shopping Cart widget) ---------- */
.ft-basket {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: .75rem;
  background: #fff;
}
.ft-basket-header {
  background: var(--ft-blue);
  color: #fff;
  padding: .55rem .75rem;
  font-size: .82rem;
  font-weight: 600;
  border-radius: .75rem .75rem 0 0;
}
.ft-basket-body {
  padding: .75rem;
  font-size: .8rem;
  max-height: 250px;
  overflow-y: auto;
}
.ft-basket-footer {
  padding: .5rem .75rem;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: .78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Legacy class compatibility ---------- */
/* These map old class names to new styles so pages work during transition */
.linkmainbig {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ft-red);
  text-decoration: none;
}
.linkmainbig:hover {
  color: var(--ft-red-dark);
  text-decoration: underline;
}

.linkmainsmall {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ft-red);
  text-decoration: none;
}
.linkmainsmall:hover {
  color: var(--ft-red-dark);
  text-decoration: underline;
}

.linknavtop {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ft-red);
  text-decoration: none;
}
.linknavtop:hover {
  color: var(--ft-red-dark);
  text-decoration: underline;
}

.linkadminaction {
  font-size: .82rem;
  color: var(--ft-red);
  text-decoration: none;
}
.linkadminaction:hover {
  color: var(--ft-red-dark);
  text-decoration: underline;
}

.linkadminheadersort {
  font-size: .78rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}
.linkadminheadersort:hover {
  color: var(--ft-yellow);
}

/* Legacy table classes */
.tableadmin1 {
  width: 100%;
  border-collapse: collapse;
}
.tableadmin1 td {
  padding: .4rem .5rem;
  font-size: .82rem;
  vertical-align: middle;
}

.tableheader1 {
  background: var(--ft-charcoal) !important;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .5rem .6rem;
}

.formfield1 {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ft-steel);
  background: var(--ft-offwhite);
  text-align: right;
  padding: .5rem .75rem;
}

.tdreportcell1 {
  font-size: .82rem;
  padding: .4rem .5rem;
  background: #fff;
}

/* Legacy FONT tag override */
FONT { font-family: inherit; }

/* Legacy BLOCKQUOTE used as page content wrapper */
BLOCKQUOTE {
  margin: 0;
  padding: 0 1rem;
}

/* ---------- Utilities ---------- */
.ft-divider {
  width: 50px;
  height: 3px;
  background: var(--ft-red);
  border-radius: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .ft-portal-navbar .navbar-collapse {
    padding-top: .75rem;
  }
  .ft-subnav .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ft-subnav .nav-link {
    white-space: nowrap;
  }
}

@media (max-width: 575.98px) {
  .ft-login-card {
    padding: 1.75rem 1.25rem;
  }
  .ft-content {
    padding: 1rem 0 2rem;
  }
  .ft-table {
    font-size: .75rem;
  }
  .ft-table thead th,
  .ft-table tbody td {
    padding: .35rem .4rem;
  }
}

/* ---------- Print ---------- */
@media print {
  .ft-portal-navbar,
  .ft-subnav,
  .ft-portal-footer,
  .ft-nav-accent {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .ft-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}
