/* FPGTEC App — custom styles atop Bootstrap 5.3 */

:root {
  --fpg-primary: #0f2a4a;
  --fpg-secondary: #0f2a4a;
  --fpg-text: #7a7a7a;
  --fpg-accent: #f5821f;
  --fpg-accent-hover: #786016;
  --fpg-active-nav: #b88900;
  --fpg-section-bg: #ececec;
  --fpg-footer-bg: #f1f1f1;
  --fpg-sidebar-bg: #f5f5f5;
  --fpg-container: 1140px;
  --fpg-radius-btn: 15px;
  --fpg-radius-card: 10px;
  --fpg-success: #28a745;
  --fpg-pending: #f5821f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  color: var(--fpg-text);
  background: #fff;
  margin: 0;
}

body.logged-in {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.logged-in .site-footer {
  margin-top: auto;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  color: var(--fpg-accent);
}

h1,
h2,
h3,
.h1,
.h2,
.h3 {
  font-family: "Roboto", sans-serif;
  font-weight: 600;
  color: var(--fpg-primary);
}

.container-fpg {
  width: 100%;
  max-width: var(--fpg-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* ---------- Buttons ---------- */

.btn-fpg {
  display: inline-block;
  background-color: var(--fpg-accent);
  color: #fff !important;
  fill: #fff;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  padding: 12px 24px;
  border: none;
  border-radius: var(--fpg-radius-btn);
  text-align: center;
  transition: all 0.3s;
  white-space: nowrap;
  cursor: pointer;
}

.btn-fpg:hover,
.btn-fpg:focus {
  background-color: var(--fpg-accent-hover);
  color: #fff !important;
}

.btn-fpg-outline {
  display: inline-block;
  background-color: transparent;
  color: var(--fpg-accent) !important;
  border: 1px solid var(--fpg-accent);
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  padding: 11px 24px;
  border-radius: var(--fpg-radius-btn);
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.btn-fpg-outline:hover {
  background-color: var(--fpg-accent);
  color: #fff !important;
}

/* ---------- Header ---------- */

.site-header {
  background: #fff;
  position: relative;
  z-index: 99;
  border-bottom: 1px solid #e8e8e8;
}

.header-row {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding: 10px 15px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}

.header-col {
  padding: 10px;
  min-width: 0;
}

.header-col-logo {
  width: 25%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.header-col-menu {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-col-actions {
  width: 30%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}

.site-logo {
  display: block;
  width: 210px;
  max-width: 100%;
}

.site-logo img {
  width: 210px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 6px;
}

.member-only {
  display: none !important;
}

body.logged-in .member-only {
  display: inline-block !important;
}

body.logged-in .header-col-actions .header-btn:not(.member-only) {
  display: none !important;
}

.header-btn {
  flex: 0 0 auto;
  min-width: 0;
}

.site-nav-wrap {
  display: flex;
  position: relative;
}

.site-menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-menu a {
  display: flex;
  padding: 15px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 16px;
  color: var(--fpg-text);
}

.site-menu a:hover,
.site-menu a:focus {
  color: var(--fpg-accent);
}

.site-menu .current-menu-item > a {
  color: var(--fpg-active-nav);
}

.site-menu .menu-item-auth {
  display: none;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #494c4f;
  font-size: 22px;
  line-height: 1;
}

.nav-toggle-icon {
  display: inline-block;
  padding: 0.35em;
  line-height: 1;
  text-align: center;
}

.nav-toggle-icon svg {
  width: 25px;
  height: 25px;
  display: block;
  margin-bottom: 1.6px;
  fill: #000;
}

.nav-toggle-icon-close,
.menu-is-active .nav-toggle-icon-open {
  display: none;
}

.menu-is-active .nav-toggle-icon-close {
  display: inline-block;
}

@media (max-width: 1024px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    visibility: hidden;
    opacity: 0;
    height: 0;
    overflow: hidden;
  }

  .site-nav-wrap.menu-is-active .site-nav {
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
  }

  .site-menu {
    flex-direction: column;
    width: 100%;
  }

  .site-menu li {
    width: 100%;
    background-color: #fff;
  }

  .site-menu li:not(:last-child) {
    border-bottom: 1px solid #c4c4c4;
  }

  .site-menu a {
    background-color: #fff;
    font-weight: 500;
  }
}

@media (max-width: 767.98px) {
  .header-row {
    padding: 0 10px;
  }

  .header-col-logo {
    width: 50%;
    margin: 0;
    padding: 0;
  }

  .header-col-menu {
    width: 50%;
  }

  .header-col-actions {
    display: none;
  }

  .site-logo,
  .site-logo img {
    width: 140px;
  }
}

/* ---------- App shell ---------- */

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 8px 15px;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fpg-primary);
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 98;
}

.app-shell.sidebar-is-open .sidebar-backdrop {
  display: block;
}

.app-shell {
  display: flex;
  flex: 1 0 auto;
  min-height: 0;
}

.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--fpg-sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  border-right: 1px solid #e0e0e0;
}

.app-sidebar-brand {
  font-family: "Roboto", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--fpg-primary);
  padding: 0 20px 20px;
  margin: 0;
}

.app-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.app-nav li {
  margin: 0;
}

.app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--fpg-text);
  transition: background 0.2s, color 0.2s;
}

.app-nav a i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.app-nav a:hover {
  color: var(--fpg-primary);
  background: rgba(0, 0, 0, 0.04);
}

.app-nav .current-menu-item > a {
  background: var(--fpg-accent);
  color: #fff !important;
}

.app-nav .current-menu-item > a:hover {
  color: #fff !important;
  background: var(--fpg-accent-hover);
}

.app-sidebar-footer {
  padding: 0;
  border-top: 1px solid #e0e0e0;
  margin-top: auto;
}

.app-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--fpg-accent);
}

/* Spacer matches .app-nav a i width so label aligns with nav items */
.app-sidebar-footer a::before {
  content: "";
  width: 20px;
  flex-shrink: 0;
}

.app-content {
  flex: 1;
  min-width: 0;
  background: var(--fpg-section-bg);
  display: flex;
  flex-direction: column;
}

.welcome-bar {
  background: #fff;
  text-align: center;
  padding: 14px 15px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--fpg-primary);
  border-bottom: 1px solid #e8e8e8;
}

.app-main {
  flex: 1;
  padding: 20px 25px 40px;
}

@media (max-width: 991.98px) {
  .sidebar-toggle {
    display: flex;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
  }

  .app-shell.sidebar-is-open .app-sidebar {
    transform: translateX(0);
  }

  .welcome-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
}

/* ---------- Cards & shared app components ---------- */

.app-card {
  background: #fff;
  border-radius: var(--fpg-radius-card);
  border: 1px solid #e8e8e8;
  padding: 20px;
  margin-bottom: 20px;
}

.app-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--fpg-primary);
  margin: 0 0 16px;
}

.page-heading {
  font-size: 24px;
  font-weight: 600;
  color: var(--fpg-primary);
  margin: 0 0 8px;
}

.page-lead {
  font-size: 15px;
  color: var(--fpg-text);
  margin: 0 0 24px;
}

.breadcrumb-app {
  font-size: 13px;
  color: var(--fpg-text);
  margin-bottom: 20px;
}

.breadcrumb-app a {
  color: var(--fpg-text);
}

.breadcrumb-app a:hover {
  color: var(--fpg-accent);
}

.breadcrumb-app .sep {
  margin: 0 6px;
  color: #bbb;
}

/* ---------- Dashboard ---------- */

.recurring-summary {
  margin-bottom: 24px;
}

.recurring-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}

.recurring-summary dt {
  font-weight: 600;
  color: var(--fpg-primary);
  margin: 0;
}

.recurring-summary dd {
  margin: 0;
  color: var(--fpg-text);
}

.payment-stepper-wrap {
  border: 2px dotted #ccc;
  border-radius: var(--fpg-radius-card);
  padding: 30px 20px;
  margin-bottom: 20px;
}

.payment-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  position: relative;
}

.payment-stepper::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 16.66%;
  right: 16.66%;
  height: 2px;
  border-top: 2px dotted #ccc;
  z-index: 0;
}

.payment-step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--fpg-success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 22px;
}

.step-circle i {
  line-height: 1;
}

.payment-step h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--fpg-primary);
  margin: 0 0 8px;
}

.payment-step p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--fpg-text);
  margin: 0;
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

.dashboard-alert {
  margin-bottom: 24px;
  font-size: 14px;
  border-radius: var(--fpg-radius-card);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.payment-history-table {
  margin: 0;
  font-size: 14px;
}

.payment-history-table thead th {
  font-weight: 600;
  color: var(--fpg-primary);
  border-bottom-width: 1px;
  white-space: nowrap;
}

.payment-history-table tbody td {
  vertical-align: middle;
}

.recipient-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recipient-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fpg-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.success {
  background: rgba(40, 167, 69, 0.15);
  color: var(--fpg-success);
}

.status-badge.pending {
  background: rgba(245, 130, 31, 0.15);
  color: var(--fpg-pending);
}

.status-badge.failed {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

.row-expand-btn {
  background: none;
  border: 0;
  padding: 4px;
  color: var(--fpg-text);
  cursor: pointer;
}

.row-expand-btn:hover {
  color: var(--fpg-primary);
}

.news-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.news-panel .panel-header h3 {
  margin: 0;
  font-size: 18px;
}

.news-badge {
  background: #dc3545;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list li {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.news-list li:last-child {
  border-bottom: 0;
}

.news-list h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--fpg-primary);
  margin: 0 0 4px;
}

.news-list p {
  font-size: 12px;
  color: var(--fpg-text);
  margin: 0;
}

.view-all-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fpg-accent);
}

@media (max-width: 991.98px) {
  .payment-stepper {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .payment-stepper::before {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .app-main {
    padding: 15px;
  }

  .payment-history-table {
    font-size: 12px;
  }
}

/* ---------- External bank account ---------- */

.bank-account-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.bank-account-info h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.bank-account-info p {
  margin: 0 0 4px;
  font-size: 14px;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(40, 167, 69, 0.15);
  color: var(--fpg-success);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.verify-explainer {
  font-size: 14px;
  line-height: 1.6;
}

.verify-explainer p {
  margin: 0 0 12px;
}

/* ---------- Payment history page ---------- */

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-pill {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--fpg-text);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--fpg-accent);
  border-color: var(--fpg-accent);
  color: #fff;
}

.search-bar-wrap {
  margin-bottom: 20px;
}

.search-bar-wrap .form-control {
  max-width: 360px;
  border-radius: var(--fpg-radius-btn);
}

.pagination-mock {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination-mock .page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--fpg-text);
  cursor: pointer;
}

.pagination-mock .page-btn.active {
  background: var(--fpg-accent);
  border-color: var(--fpg-accent);
  color: #fff;
}

/* ---------- Single payment ---------- */

.payment-form-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.payment-form .form-label {
  font-weight: 600;
  color: var(--fpg-primary);
  font-size: 14px;
}

.payment-form .form-control,
.payment-form .form-select {
  border-radius: 8px;
  border-color: #ddd;
  font-size: 14px;
}

.fee-summary dt {
  font-size: 13px;
  color: var(--fpg-text);
  font-weight: 400;
}

.fee-summary dd {
  font-size: 14px;
  font-weight: 600;
  color: var(--fpg-primary);
}

.fee-summary .total-row {
  border-top: 1px solid #eee;
  padding-top: 12px;
  margin-top: 12px;
}

.fee-summary .total-row dd {
  font-size: 18px;
  color: var(--fpg-accent);
}

@media (max-width: 991.98px) {
  .payment-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Recurring payment ---------- */

.recurring-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.schedule-summary {
  background: var(--fpg-section-bg);
  border-radius: 8px;
  padding: 16px;
}

.schedule-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}

.schedule-summary dt {
  font-weight: 600;
  color: var(--fpg-primary);
}

.schedule-summary dd {
  margin: 0;
}

.action-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 767.98px) {
  .recurring-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Settings ---------- */

.settings-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #eee;
}

.settings-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
  font-size: 16px;
  margin: 0 0 16px;
}

.form-switch .form-check-input:checked {
  background-color: var(--fpg-accent);
  border-color: var(--fpg-accent);
}

.twofa-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.twofa-status p {
  margin: 0;
  font-size: 14px;
}

/* ---------- Footer ---------- */

.site-footer {
  background-color: var(--fpg-footer-bg);
}

.footer-inner {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
}

.footer-main {
  padding-top: 50px;
  padding-bottom: 30px;
}

.footer-main .footer-inner {
  display: flex;
  flex-wrap: wrap;
}

.footer-col {
  width: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

@media (min-width: 768px) {
  .footer-col {
    width: 20%;
  }

  .footer-col-brand {
    width: 40%;
  }
}

.footer-logo img {
  width: 220px;
  height: auto;
  display: block;
  margin-bottom: 6px;
}

.footer-blurb {
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fpg-text);
  margin: 0 0 0.9rem;
}

.footer-heading {
  font-family: "Roboto", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: var(--fpg-secondary);
  margin: 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  display: flex;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: var(--fpg-text);
  padding-top: 15px;
  padding-bottom: 15px;
}

.footer-links a:hover {
  color: var(--fpg-accent);
}

.lang-switcher {
  margin: 0;
  padding-bottom: 6px;
}

.lang-switcher .dropdown-toggle {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(20, 56, 82, 0.1);
  border-radius: 5px;
  padding: 10px 10px 10px 16px;
  height: 55px;
  transition: background-color 0.2s;
}

.lang-switcher .dropdown-toggle:hover {
  background-color: #f2f2f2;
}

.lang-switcher .dropdown-toggle::after {
  display: none;
}

.lang-switcher .lang-name {
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: #143852;
  margin-left: 8px;
  margin-right: 16px;
}

.lang-switcher .dropdown-toggle .lang-chevron {
  width: 20px;
  height: 20px;
  color: #143852;
  flex-shrink: 0;
}

.lang-switcher .lang-flag {
  width: 18px;
  height: 13.5px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.lang-switcher .dropdown-menu {
  min-width: 100%;
  background: #fff;
  border: 1px solid rgba(20, 56, 82, 0.1);
  border-radius: 5px;
  padding: 0;
}

.lang-switcher .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  color: #143852;
  padding: 7px 16px;
}

.lang-switcher .dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1d2327;
}

.footer-copyright {
  padding-bottom: 10px;
}

.footer-copyright p {
  text-align: center;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fpg-text);
  margin: 0 0 0.9rem;
}

@media (max-width: 767.98px) {
  .footer-main {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .footer-logo img {
    width: 81px;
  }
}
