/* ============================================================
   Website Shared Styles
   ============================================================ */

/* === Color Variables === */
:root {
  --primary: #0028ba;
  --primary-dark: #001f99;
  --primary-light: rgba(255, 255, 255, 0.9);
  --bg-light: #f8f9fa;
  --text-muted: #666;
  --text-body: #444;
  --text-dark: #333;
  --border: #ced4da;
  --border-light: #eee;
  --error-bg: #f8d7da;
  --error-text: #721c1c;
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* === Hidden Utility === */
.hidden {
  display: none;
}

/* ============================================================
   Applicant Login / Signup
   ============================================================ */

.applicant-form-container {
  margin: 0 auto;
  padding: 20px 0;
}

.applicant-form-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 20px;
}

.applicant-form-card h3 {
  color: var(--primary);
  margin-bottom: 25px;
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

/* Login card (dark blue background) */
#loginCard {
  background: var(--primary);
  color: #ffffff;
}

#loginCard h3,
#loginCard label,
#loginCard .captcha-refresh,
#loginCard .form-switcher a {
  color: #ffffff;
  border-color: #ffffff;
}

#loginCard .fwb-form-control,
#loginCard .applicant-form-control {
  border-color: #ffffff;
  background: var(--primary-light);
  color: var(--text-dark);
}

#loginCard .fwb-form-control:focus,
#loginCard .applicant-form-control:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5);
}

#loginCard .captcha-container {
  border-color: #ffffff;
}

#loginCard .captcha-image {
  border-color: #ffffff;
}

/* ============================================================
   Form Card (shared between applicant & change-password)
   ============================================================ */

.fwb-form-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin: 20px auto;
  max-width: 600px;
}

.fwb-form-card h3 {
  color: var(--primary);
  margin-bottom: 25px;
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

/* ============================================================
   Form Group (shared)
   ============================================================ */

.fwb-form-group {
  margin-bottom: 15px;
}

/* Override theme global label (uppercase + Poppins + letter-spacing)
   to give form labels a clean, readable look */
.fwb-form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-body);
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-size: inherit;
}

.fwb-form-group label .required {
  color: red;
}

/* ============================================================
   Form Control (shared input/select/textarea)
   ============================================================ */

.fwb-form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.fwb-form-control:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 40, 186, 0.25);
}

/* ============================================================
   Form Buttons (shared)
   ============================================================ */

.fwb-btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  padding: 10px 24px;
  font-size: 16px;
  line-height: 1.5;
  border-radius: 4px;
  transition: color 0.15s ease-in-out,
              background-color 0.15s ease-in-out,
              border-color 0.15s ease-in-out,
              box-shadow 0.15s ease-in-out;
  cursor: pointer;
  border: 1px solid transparent;
}

.fwb-btn-primary {
  color: #ffffff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.fwb-btn-primary:hover {
  color: #ffffff;
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.fwb-btn-secondary {
  color: var(--primary);
  background-color: transparent;
  border-color: var(--primary);
}

.fwb-btn-secondary:hover {
  color: #ffffff;
  background-color: var(--primary);
}

#loginCard .fwb-btn-primary {
  color: var(--primary);
  background-color: #ffffff;
  border-color: #ffffff;
}

#loginCard .fwb-btn-primary:hover {
  color: var(--primary);
  background-color: #f0f0f0;
  border-color: #f0f0f0;
}

.fwb-btn-block {
  width: 100%;
}

/* ============================================================
   Form Section Heading (shared)
   ============================================================ */

.fwb-section-heading {
  color: var(--primary);
  margin: 20px 0 15px 0;
  font-size: 16px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

/* ============================================================
   Form Hint (shared)
   ============================================================ */

.fwb-form-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

/* ============================================================
   Error Message (shared)
   ============================================================ */

.fwb-form-error {
  color: var(--error-text);
  margin-bottom: 15px;
  padding: 10px;
  background-color: var(--error-bg);
  border-radius: 4px;
}

#loginCard .fwb-form-error {
  color: var(--error-text);
  background-color: rgba(248, 215, 218, 0.9);
}

/* ============================================================
   Captcha (shared)
   ============================================================ */

.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.captcha-image {
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.captcha-refresh {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
}

.captcha-refresh:hover {
  color: var(--primary-dark);
}

#loginCard .captcha-refresh {
  color: #ffffff;
}

#loginCard .captcha-refresh:hover {
  color: #cccccc;
}

.captcha-input {
  width: 150px;
}

/* ============================================================
   Form Switcher (shared)
   ============================================================ */

.form-switcher {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.form-switcher a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.form-switcher a:hover {
  text-decoration: underline;
}

#loginCard .form-switcher a {
  color: #ffffff;
  text-decoration: underline !important;
}

#loginCard .form-switcher a:hover {
  text-decoration: underline !important;
  color: #f0f0f0;
}

/* ============================================================
   Login / Signup Error IDs
   ============================================================ */

#loginError,
#signupError {
  color: var(--error-text);
  margin-bottom: 15px;
  padding: 10px;
  background-color: var(--error-bg);
  border-radius: 4px;
}


/* ============================================================
   Dashboard
   ============================================================ */

/* Welcome Card */
.dashboard-welcome-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 30px;
}

.dashboard-welcome-card h3 {
  color: #ffffff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 15px;
}

.dashboard-welcome-card .dashboard-welcome-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  margin-bottom: 0;
}

.dashboard-welcome-card .fwb-btn-primary {
  background-color: #ffffff;
  color: var(--primary);
  border-color: #ffffff;
}

.dashboard-welcome-card .fwb-btn-primary:hover {
  background-color: #f0f0f0;
  color: var(--primary);
  border-color: #f0f0f0;
}

/* Dashboard Info Cards */
.dashboard-info-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 20px;
  text-align: center;
}

.dashboard-card-icon {
  width: 60px;
  height: 60px;
  line-height: 60px;
  margin: 0 auto 15px;
  background: var(--primary);
  border-radius: 50%;
  font-size: 26px;
  color: #ffffff;
}

.dashboard-info-card h4 {
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

/* Profile Summary List */
.dashboard-info-list {
  text-align: left;
}

.dashboard-info-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.dashboard-info-item:last-child {
  border-bottom: none;
}

.dashboard-info-label {
  font-weight: 600;
  color: var(--text-body);
  min-width: 100px;
}

.dashboard-info-value {
  color: var(--text-muted);
  text-align: right;
  word-break: break-all;
}

.dash-action-card {
  background: var(--primary);
  color: #ffffff;
  text-align: center;
}

.dash-action-card a {
  display: block;
  padding: 8px 0;
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
}

.dash-action-card a:hover {
  text-decoration: underline;
}

/* Quick Actions List */
.dashboard-actions-list {
  text-align: left;
}

.dashboard-action-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  margin-bottom: 10px;
  color: var(--text-body);
  background: var(--bg-light);
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
  font-weight: 500;
}

.dashboard-action-link:hover {
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

.dashboard-action-link i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* Support Info */
.dashboard-support-info p {
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.dashboard-support-info p strong {
  color: var(--text-body);
}

.dashboard-support-info a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.dashboard-support-info a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 991.98px) {
  .fwb-form-card,
  .applicant-form-card,
  .dashboard-welcome-card {
    padding: 20px;
  }
  .dashboard-info-card {
    padding: 20px;
  }
}

@media (max-width: 767.98px) {
  .fwb-form-card,
  .applicant-form-card,
  .dashboard-welcome-card {
    padding: 15px;
  }
  .dashboard-info-card {
    padding: 15px;
  }
  .captcha-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .form-switcher {
    padding-top: 15px;
    margin-top: 15px;
  }
}

/* ===== Applicant training progress timeline  ===== */
.msn-tl-outer  { overflow-x: auto; padding: 14px 0 6px 0; }   /* mobile: horizontal scroll */
.msn-timeline  { display: flex; min-width: 620px; position: relative; }
.msn-tl-step   { flex: 1; text-align: center; position: relative; }
/* connector line: each step draws the segment ENTERING it, edge-to-edge
   between the circles (16px = dot radius) - it never overlaps a dot, so a
   line can never show through a circle */
.msn-tl-step::before { content: ""; position: absolute; top: 15px;
  left: calc(-50% + 16px); width: calc(100% - 32px); height: 3px; background: #d7dde3; }
.msn-tl-step:first-child::before { display: none; }
.msn-tl-step.msn-tl-done::before { background: #28a745; }     /* green up to done steps */
.msn-tl-dot  { width: 32px; height: 32px; margin: 0 auto; border-radius: 50%;
  background: #fff; border: 3px solid #c3ccd5; color: #fff; font-weight: 700;
  line-height: 26px; position: relative; z-index: 1; }
.msn-tl-step.msn-tl-done .msn-tl-dot { background: #28a745; border-color: #28a745; }
/* incomplete stage: faded, no date (date span only emitted when done) */
.msn-tl-step.msn-tl-fade { opacity: 0.45; }
.msn-tl-label { margin-top: 8px; font-size: 13px; color: #333; }
.msn-tl-date  { display: block; font-size: 12px; color: #777; margin-top: 2px; }

/* mobile: wrap to 2 steps per line instead of a horizontal scrollbar */
@media (max-width: 620px) {
  .msn-tl-outer   { padding: 8px 0 4px 0; }
  .msn-timeline   { min-width: 0; flex-wrap: wrap; row-gap: 16px; }
  .msn-tl-step    { flex: 1 1 50%; }
  /* steps wrap 2 per line: show the connector only for the 2nd step of each
     line (even children); the 1st step of each line (odd) starts a new line,
     so its incoming segment stays hidden */
  .msn-tl-step::before { display: none; }
  .msn-tl-step:nth-child(even)::before { display: block; }
  /* continuation stubs: the line keeps going to the right edge after the last
     circle of a line that has another line below it (steps 2 and 4) */
  .msn-tl-step:nth-child(2)::after,
  .msn-tl-step:nth-child(4)::after { content: ""; position: absolute; top: 15px;
    left: calc(50% + 16px); width: calc(50% - 16px); height: 3px; background: #d7dde3; }
  /* and it comes back in from the left edge to the first circle of the last
     line (step 5) - green when Cert Issued itself is done */
  .msn-tl-step:nth-child(5)::before { display: block; left: 0;
    width: calc(50% - 16px); background: #d7dde3; }
  .msn-tl-step:nth-child(5).msn-tl-done::before { background: #28a745; }
}
