/* ==========================================================
   SunaFex – Dashboard Theme (Bootstrap 5.3)
   ========================================================== */
:root {
  --mb-primary: #0d6efd;
  --mb-navy: #0a2a6b;
  --mb-navy-2: #0d47a1;
  --mb-sky: #4fc3f7;
  --mb-gold: #ffc107;
  --mb-bg: #eef3fb;
  --mb-card: #ffffff;
  --mb-text: #1c2b4a;
  --mb-muted: #6b7a99;
  --mb-border: #e3e9f5;
  --mb-radius: 14px;
  --mb-shadow: 0 6px 20px rgba(13, 71, 161, 0.08);
  --sidebar-w: 240px;
  --topbar-h: 72px;
}

body {
  font-family:
    "Poppins",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--mb-bg);
  color: var(--mb-text);
  font-size: 0.925rem;
}

a {
  text-decoration: none;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--mb-border);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--mb-navy);
}
.brand img {
  width: 48px;
  height: auto;
}
.brand-name {
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.3px;
}
.brand-name .blue {
  color: var(--mb-navy-2);
}
.brand-name .sky {
  color: #1e88e5;
}
.brand-tag {
  font-size: 0.68rem;
  font-style: italic;
  font-weight: 600;
  color: var(--mb-navy);
}
.tagline {
  font-style: italic;
  font-weight: 700;
  color: var(--mb-navy);
  font-size: 1.05rem;
  position: relative;
}
.tagline::after {
  content: "";
  display: block;
  height: 3px;
  width: 70%;
  margin: 2px auto 0;
  background: linear-gradient(90deg, transparent, var(--mb-gold), transparent);
  border-radius: 3px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--mb-border);
  background: #fff;
  color: var(--mb-navy);
  position: relative;
}
.icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.62rem;
}
.lang-btn {
  border: 1px solid var(--mb-border);
  border-radius: 30px;
  padding: 0.4rem 0.9rem;
  background: #fff;
  color: var(--mb-text);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--mb-text);
}
.user-chip img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--mb-border);
}
.user-chip .name {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.1;
}
.user-chip .uid {
  font-size: 0.72rem;
  color: var(--mb-muted);
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--mb-navy) 0%, var(--mb-navy-2) 100%);
  color: #cfe0ff;
}
@media (min-width: 992px) {
  .sidebar {
    width: var(--sidebar-w);
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    overflow-y: auto;
  }
  .main {
    margin-left: var(--sidebar-w);
  }
}
.sidebar .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.side-nav {
  list-style: none;
  padding: 0.75rem 0.6rem;
  margin: 0;
}
.side-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #dbe7ff;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  transition:
    background 0.2s,
    color 0.2s;
}
.side-nav .nav-link i {
  font-size: 1rem;
  width: 22px;
  text-align: center;
}
.side-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.side-nav .nav-link.active {
  background: linear-gradient(90deg, #1e88e5, #42a5f5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.side-nav .divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0.6rem 0.4rem;
}
.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
}
.btn-logout:hover {
  background: #fff;
  color: var(--mb-navy);
}

/* ---------- Generic cards ---------- */
.main {
  padding: 1.25rem;
}
@media (max-width: 575.98px) {
  .main {
    padding: 0.85rem;
  }
}
.mb-card {
  background: var(--mb-card);
  border: 1px solid var(--mb-border);
  border-radius: var(--mb-radius);
  box-shadow: var(--mb-shadow);
}
.mb-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--mb-border);
}
.mb-card .card-head h6 {
  margin: 0;
  font-weight: 700;
  color: var(--mb-navy);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.mb-card .card-head h6 i {
  color: #1e88e5;
}
.btn-pill-sm {
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  border-radius: 30px;
  border: 1px solid var(--mb-border);
  background: #f3f7ff;
  color: var(--mb-navy-2);
  font-weight: 600;
}
.btn-pill-sm:hover {
  background: var(--mb-navy-2);
  color: #fff;
}
.btn-brand {
  background: linear-gradient(90deg, #1565c0, #1e88e5);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
}
.btn-brand:hover {
  color: #fff;
  filter: brightness(1.08);
}

/* ---------- Hero / welcome ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--mb-radius);
  color: #fff;
  background:
    radial-gradient(
      circle at 70% 40%,
      rgba(79, 195, 247, 0.45),
      transparent 45%
    ),
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1.4px) 0 0 / 10px
      10px,
    linear-gradient(110deg, #061a4a 0%, #0b3a9a 55%, #1565c0 100%);
  padding: 1.5rem;
}
.hero .bird {
  position: absolute;
  right: 30%;
  top: 10%;
  width: 180px;
  opacity: 0.55;
  filter: drop-shadow(0 0 18px #4fc3f7);
}
.hero-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.5);
}
.hero h4 {
  font-weight: 600;
  margin: 0;
}
.hero .hname {
  color: var(--mb-gold);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1.15;
}
.badge-active {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 30px;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
}
.hero-brand {
  font-weight: 800;
  font-style: italic;
  font-size: 1.6rem;
  text-align: right;
}
.hero-brand small {
  display: block;
  font-weight: 500;
  font-style: italic;
  font-size: 0.95rem;
  opacity: 0.9;
}
@media (max-width: 767.98px) {
  .hero .bird {
    right: -20px;
    top: auto;
    bottom: 0;
    width: 140px;
  }
  .hero .hname {
    font-size: 1.5rem;
  }
}

/* ---------- Stat cards ---------- */
.stat-card {
  border-radius: var(--mb-radius);
  color: #fff;
  padding: 1rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: var(--mb-shadow);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.stat-card .s-icon {
  font-size: 1.9rem;
  opacity: 0.95;
}
.stat-card .s-label {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.95;
}
.stat-card .s-value {
  font-size: 1.35rem;
  font-weight: 800;
}
.stat-card .s-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 0.2rem 0.7rem;
}
.stat-card .s-link:hover {
  background: rgba(255, 255, 255, 0.35);
}
.g-blue {
  background: linear-gradient(135deg, #0d47a1, #1e88e5);
}
.g-green {
  background: linear-gradient(135deg, #1b7a2b, #4caf50);
}
.g-purple {
  background: linear-gradient(135deg, #5e1b9a, #9c4dcc);
}
.g-orange {
  background: linear-gradient(135deg, #e65100, #ffa726);
}
.g-teal {
  background: linear-gradient(135deg, #006c7a, #26c6da);
}
.g-red {
  background: linear-gradient(135deg, #b71c1c, #ef5350);
}
.g-navy {
  background: linear-gradient(135deg, #061a4a, #1565c0);
}

/* ---------- Quick action tiles ---------- */
.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--mb-border);
  border-radius: var(--mb-radius);
  padding: 1rem 0.5rem;
  height: 100%;
  color: var(--mb-navy);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: var(--mb-shadow);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.action-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(13, 71, 161, 0.15);
  color: var(--mb-navy);
}
.action-tile .a-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}
.promo {
  border-radius: var(--mb-radius);
  color: #fff;
  padding: 1.2rem 1.4rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 85% 60%,
      rgba(79, 195, 247, 0.6),
      transparent 40%
    ),
    linear-gradient(110deg, #061a4a, #0d47a1);
}
.promo h5 {
  font-weight: 700;
  font-style: italic;
  margin: 0;
}
.promo .big {
  font-size: 1.7rem;
  font-weight: 800;
  font-style: italic;
  color: var(--mb-gold);
  line-height: 1.1;
}
.promo .globe {
  position: absolute;
  right: -30px;
  bottom: -40px;
  font-size: 9rem;
  color: rgba(79, 195, 247, 0.35);
}

/* ---------- Dashboard widgets ---------- */
.mini-stat .num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--mb-navy);
}
.mini-stat small {
  color: var(--mb-muted);
}
.map-box {
  height: 120px;
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 30% 50%,
      rgba(30, 136, 229, 0.35),
      transparent 30%
    ),
    radial-gradient(
      circle at 70% 40%,
      rgba(30, 136, 229, 0.35),
      transparent 30%
    ),
    radial-gradient(#1e88e5 1.2px, transparent 1.6px) 0 0 / 9px 9px,
    #e8f1ff;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: 10px;
}
.bars span {
  flex: 1;
  background: linear-gradient(180deg, #42a5f5, #1565c0);
  border-radius: 4px 4px 0 0;
}
.activity {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--mb-border);
}
.activity:last-child {
  border-bottom: 0;
}
.activity .ic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.activity .t {
  font-weight: 600;
  font-size: 0.82rem;
}
.activity .d {
  font-size: 0.72rem;
  color: var(--mb-muted);
}
.activity .amt {
  margin-left: auto;
  font-weight: 700;
  color: #1b7a2b;
}

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.page-head h3 {
  font-weight: 800;
  color: var(--mb-navy);
  margin: 0;
  font-size: 1.4rem;
}
.page-head .breadcrumb {
  margin: 0;
  font-size: 0.8rem;
}

/* ---------- Tables & forms ---------- */
.table-mb {
  margin: 0;
}
.table-mb thead th {
  background: #f3f7ff;
  color: var(--mb-navy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--mb-border);
  white-space: nowrap;
}
.table-mb td {
  vertical-align: middle;
  font-size: 0.85rem;
  white-space: nowrap;
}
.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--mb-navy);
}
.form-control,
.form-select {
  border-radius: 10px;
  border-color: #d6e0f2;
  padding: 0.6rem 0.85rem;
}
.form-control:focus,
.form-select:focus {
  border-color: #1e88e5;
  box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.15);
}
.method-card {
  cursor: pointer;
  border: 2px solid var(--mb-border);
  border-radius: 12px;
  padding: 0.8rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  background: #fff;
  height: 100%;
}
.method-card i {
  font-size: 1.5rem;
  display: block;
  color: #1e88e5;
}
.btn-check:checked + .method-card {
  border-color: #1e88e5;
  background: #eef6ff;
}

/* ---------- Products ---------- */
.product-card .p-img {
  height: 140px;
  border-radius: 12px 12px 0 0;
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  color: #fff;
}
.product-card .price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--mb-navy-2);
}

/* ---------- Rank ladder ---------- */
.rank-card {
  text-align: center;
  padding: 1.1rem;
}
.rank-card .medal {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: #fff;
}
.rank-card.current {
  outline: 3px solid var(--mb-gold);
}

/* ---------- Genealogy tree ---------- */
.tree-wrap {
  overflow-x: auto;
  padding: 1rem 0;
}
.tree,
.tree ul {
  padding-top: 20px;
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0;
  padding-left: 0;
}
.tree {
  min-width: 760px;
}
.tree li {
  list-style: none;
  text-align: center;
  position: relative;
  padding: 20px 6px 0;
  flex: 1;
}
.tree li::before,
.tree li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 20px;
  border-top: 2px solid #9ec3f5;
}
.tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid #9ec3f5;
}
.tree li:only-child::before,
.tree li:only-child::after {
  display: none;
}
.tree li:only-child {
  padding-top: 0;
}
.tree li:first-child::before,
.tree li:last-child::after {
  border: 0 none;
}
.tree li:last-child::before {
  border-right: 2px solid #9ec3f5;
  border-radius: 0 6px 0 0;
}
.tree li:first-child::after {
  border-radius: 6px 0 0 0;
}
.tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid #9ec3f5;
  height: 20px;
}
.tree > li > ul::before,
.tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid #9ec3f5;
  height: 20px;
}
.node {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--mb-border);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  box-shadow: var(--mb-shadow);
  min-width: 110px;
}
.node .n-ic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 0.25rem;
  color: #fff;
  font-size: 1.1rem;
}
.node .n-name {
  font-weight: 700;
  font-size: 0.78rem;
}
.node .n-id {
  font-size: 0.68rem;
  color: var(--mb-muted);
}
.node.empty {
  border-style: dashed;
  color: var(--mb-muted);
  background: #f8fbff;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 1.5rem 0;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(79, 195, 247, 0.35),
      transparent 35%
    ),
    radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.4px) 0 0 / 12px
      12px,
    linear-gradient(120deg, #061a4a, #0d47a1 60%, #1e88e5);
}
.auth-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}
.auth-side {
  color: #fff;
  padding: 2.5rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 80% 70%,
      rgba(79, 195, 247, 0.55),
      transparent 40%
    ),
    linear-gradient(140deg, #061a4a, #0d47a1);
}
.auth-side .bird-lg {
  width: 160px;
  filter: drop-shadow(0 0 20px #4fc3f7);
}
.auth-side h2 {
  font-weight: 800;
  font-style: italic;
}
.auth-side .feat {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.auth-side .feat i {
  color: var(--mb-gold);
}
.auth-form {
  padding: 2.5rem;
}
@media (max-width: 575.98px) {
  .auth-form {
    padding: 1.5rem;
  }
}
.auth-form h3 {
  font-weight: 800;
  color: var(--mb-navy);
}
.input-icon {
  position: relative;
}
.input-icon > i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mb-muted);
}
.input-icon .form-control {
  padding-left: 2.5rem;
}
.input-icon .toggle-pass {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--mb-muted);
}
.btn-signin {
  background: linear-gradient(90deg, #0d47a1, #1e88e5);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.btn-signin:hover {
  color: #fff;
  filter: brightness(1.1);
}

/* ---------- Misc ---------- */
.text-navy {
  color: var(--mb-navy) !important;
}
.copy-box {
  background: #f3f7ff;
  border: 1px dashed #9ec3f5;
  border-radius: 12px;
}
.footer {
  color: var(--mb-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 1.2rem 0 0.3rem;
}
.soft-badge {
  padding: 0.35rem 0.65rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.72rem;
}
.sb-success {
  background: #e6f6ea;
  color: #1b7a2b;
}
.sb-warning {
  background: #fff4e0;
  color: #b26a00;
}
.sb-danger {
  background: #fdeaea;
  color: #b71c1c;
}
.sb-info {
  background: #e6f2ff;
  color: #0d47a1;
}

/* ---------- Responsive refinements ---------- */
.btn-pill-sm {
  white-space: nowrap;
}
.stat-card .s-label {
  line-height: 1.2;
}
@media (max-width: 575.98px) {
  .stat-card {
    padding: 0.85rem;
  }
  .stat-card .s-icon {
    font-size: 1.4rem;
  }
  .stat-card .s-value {
    font-size: 1.15rem;
  }
  .mini-stat .num {
    font-size: 1.2rem;
  }
  .page-head h3 {
    font-size: 1.2rem;
  }
}

/* ==========================================================
   Sign In / Sign Up animations
   ========================================================== */
.auth-wrap {
  position: relative;
  overflow: hidden;
  background-size:
    100% 100%,
    12px 12px,
    200% 200%;
  animation: bgShift 14s ease-in-out infinite alternate;
}
@keyframes bgShift {
  from {
    background-position:
      0 0,
      0 0,
      0% 50%;
  }
  to {
    background-position:
      0 0,
      0 0,
      100% 50%;
  }
}
.auth-wrap > .container {
  position: relative;
  z-index: 1;
}

/* floating bubbles */
.bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bubbles span {
  position: absolute;
  bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.55),
    rgba(79, 195, 247, 0.15)
  );
  animation: rise linear infinite;
}
@keyframes rise {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-115vh) scale(1.1);
    opacity: 0;
  }
}

/* card entrance / exit / error shake */
.auth-card {
  animation: cardIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.auth-card.leave {
  animation: cardOut 0.45s ease-in forwards;
}
@keyframes cardOut {
  to {
    opacity: 0;
    transform: translateY(-30px) scale(0.97);
  }
}
.auth-card.shake {
  animation: shake 0.5s;
}
@keyframes shake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(4px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-8px);
  }
  40%,
  60% {
    transform: translateX(8px);
  }
}

/* flying bird + side content */
.auth-side .bird-lg {
  animation: fly 4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes fly {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-16px) rotate(3deg);
  }
}
.auth-side > *:not(.bird-lg) {
  animation: fadeUp 0.7s ease both;
}
.auth-side > *:nth-child(2) {
  animation-delay: 0.25s;
}
.auth-side > *:nth-child(3) {
  animation-delay: 0.35s;
}
.auth-side > *:nth-child(4) {
  animation-delay: 0.45s;
}
.auth-side > *:nth-child(5) {
  animation-delay: 0.55s;
}
.auth-side .feat {
  animation: fadeUp 0.6s ease both;
}
.auth-side .feat:nth-child(1) {
  animation-delay: 0.6s;
}
.auth-side .feat:nth-child(2) {
  animation-delay: 0.75s;
}
.auth-side .feat:nth-child(3) {
  animation-delay: 0.9s;
}
.auth-side h2 {
  background: linear-gradient(
    90deg,
    #fff 0%,
    #fff 40%,
    #ffd54f 50%,
    #fff 60%,
    #fff 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    fadeUp 0.7s 0.25s ease both,
    textShine 4s 1s linear infinite;
}
@keyframes textShine {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -150% 0;
  }
}

/* form fields slide in one after another */
.auth-form h3,
.auth-form > p,
.auth-form form > div {
  animation: fadeUp 0.55s ease both;
}
.auth-form h3 {
  animation-delay: 0.2s;
}
.auth-form > p {
  animation-delay: 0.28s;
}
.auth-form form > div:nth-child(1) {
  animation-delay: 0.36s;
}
.auth-form form > div:nth-child(2) {
  animation-delay: 0.44s;
}
.auth-form form > div:nth-child(3) {
  animation-delay: 0.52s;
}
.auth-form form > div:nth-child(4) {
  animation-delay: 0.6s;
}
.auth-form form > div:nth-child(5) {
  animation-delay: 0.68s;
}
.auth-form form > div:nth-child(6) {
  animation-delay: 0.76s;
}
.auth-form form > div:nth-child(7) {
  animation-delay: 0.84s;
}
.auth-form form > div:nth-child(n + 8) {
  animation-delay: 0.92s;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* input focus glow */
.auth-form .form-control,
.auth-form .form-select {
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    transform 0.25s;
}
.auth-form .form-control:focus,
.auth-form .form-select:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(30, 136, 229, 0.18);
}
.input-icon > i {
  transition:
    color 0.25s,
    transform 0.25s;
}
.input-icon:focus-within > i {
  color: #1e88e5;
  transform: translateY(-50%) scale(1.15);
}

/* Sign In button: shine, loading, success */
.btn-signin {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    background 0.3s;
}
.btn-signin::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-20deg);
  animation: btnShine 3s 1.5s infinite;
}
@keyframes btnShine {
  0% {
    left: -75%;
  }
  40%,
  100% {
    left: 130%;
  }
}
.btn-signin:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(13, 71, 161, 0.35);
}
.btn-signin:active {
  transform: scale(0.98);
}
.btn-signin:disabled {
  opacity: 1;
  color: #fff;
}
.btn-signin.is-loading {
  background: linear-gradient(90deg, #0d47a1, #1e88e5, #0d47a1);
  background-size: 200% 100%;
  animation: loadBar 1s linear infinite;
}
.btn-signin.is-loading::after,
.btn-signin.is-success::after {
  display: none;
}
@keyframes loadBar {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -200% 0;
  }
}
.btn-signin.is-success {
  background: linear-gradient(90deg, #1b7a2b, #43a047);
}
.btn-signin .pop {
  display: inline-block;
  animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes pop {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

/* dashboard fade-in after sign in */
.main {
  animation: fadeUp 0.5s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .auth-wrap,
  .bubbles span,
  .auth-card,
  .auth-side *,
  .auth-form *,
  .btn-signin,
  .btn-signin::after,
  .main {
    animation: none !important;
    transition: none !important;
  }
}
/* keep validation icon from overlapping the show-password button */
.input-icon .form-control {
  background-image: none !important;
  padding-right: 2.5rem;
}

/* ==========================================================
   Dashboard animations
   ========================================================== */
.hero .bird {
  display: none;
}
.sky-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero > .row {
  z-index: 1;
}
/* glide across the banner */
.fly {
  position: absolute;
  left: 0;
  top: 18%;
  animation: glide 14s linear infinite;
}
.fly-2 {
  top: 52%;
  animation-duration: 19s;
  animation-delay: -7s;
  opacity: 0.6;
}
.fly-2 .flap {
  width: 70px;
  animation-duration: 0.5s;
}
@keyframes glide {
  from {
    transform: translateX(-160px);
  }
  to {
    transform: translateX(calc(100vw));
  }
}
/* soft up-and-down wave */
.bob {
  display: block;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-14px) rotate(4deg);
  }
}
/* wing flap */
.flap {
  width: 120px;
  display: block;
  filter: drop-shadow(0 0 14px rgba(79, 195, 247, 0.9));
  animation: flap 0.6s ease-in-out infinite;
  transform-origin: 50% 60%;
}
@keyframes flap {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.55) translateY(4px);
  }
}
@media (max-width: 575.98px) {
  .flap {
    width: 80px;
  }
  .fly-2 {
    display: none;
  }
}
/* login page bird also flaps */
.auth-side .bird-lg {
  animation:
    fly 4s ease-in-out infinite,
    flap 0.7s ease-in-out infinite;
}

/* stat card icons – a motion that matches each meaning */
.stat-card .s-icon {
  display: inline-block;
  transform-origin: center;
}
.stat-card .bi-wallet2 {
  animation: walletSwing 3s ease-in-out infinite;
  transform-origin: 50% 0;
}
@keyframes walletSwing {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  70% {
    transform: rotate(-14deg);
  }
  80% {
    transform: rotate(10deg);
  }
  90% {
    transform: rotate(-5deg);
  }
}
.stat-card .bi-share-fill {
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}
.stat-card .bi-share-fill::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  animation: ripple 2s ease-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}
@keyframes ripple {
  from {
    transform: scale(0.6);
    opacity: 1;
  }
  to {
    transform: scale(1.6);
    opacity: 0;
  }
}
.stat-card .bi-graph-up-arrow {
  animation: climb 2.4s ease-in-out infinite;
}
@keyframes climb {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(3px, -6px);
  }
}
.stat-card .bi-arrow-repeat,
.stat-card .bi-arrow-clockwise {
  animation: spin 3s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.stat-card .bi-trophy-fill {
  animation: trophy 2.6s ease-in-out infinite;
}
@keyframes trophy {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 215, 64, 0));
  }
  40% {
    transform: translateY(-6px) scale(1.08);
    filter: drop-shadow(0 0 10px rgba(255, 215, 64, 0.95));
  }
  60% {
    transform: translateY(0) scale(1);
  }
}
.stat-card .bi-hourglass-split {
  animation: flipGlass 3s ease-in-out infinite;
}
@keyframes flipGlass {
  0%,
  70% {
    transform: rotate(0);
  }
  85%,
  100% {
    transform: rotate(180deg);
  }
}
.stat-card .bi-people-fill,
.stat-card .bi-gem,
.stat-card .bi-cash-stack,
.stat-card .bi-coin,
.stat-card .bi-lightning-charge-fill {
  animation: pulse 2.4s ease-in-out infinite;
}
.stat-card:hover .s-icon {
  animation-duration: 0.9s;
}
.stat-card .s-link {
  white-space: nowrap;
}

/* quick action tiles: jump + ring on hover */
.action-tile .a-icon {
  position: relative;
  transition: transform 0.3s;
}
.action-tile .a-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid currentColor;
  opacity: 0;
  color: inherit;
}
.action-tile:hover .a-icon {
  animation: jump 0.6s ease;
}
.action-tile:hover .a-icon::after {
  animation: ripple 1s ease-out infinite;
  border-color: rgba(30, 136, 229, 0.6);
}
@keyframes jump {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px) scale(1.08);
  }
  70% {
    transform: translateY(2px) scale(0.97);
  }
}

/* promo globe slowly turns */
.promo .globe {
  animation: spin 40s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .fly,
  .bob,
  .flap,
  .stat-card .s-icon,
  .stat-card .s-icon::after,
  .action-tile .a-icon,
  .action-tile .a-icon::after,
  .promo .globe {
    animation: none !important;
  }
  .fly {
    transform: translateX(55vw);
  }
}
.flap {
  filter: brightness(1.9) saturate(1.2)
    drop-shadow(0 0 12px rgba(129, 212, 250, 0.95));
}
.fly-2 {
  opacity: 0.75;
}
.sky-layer {
  z-index: 0;
}
.hero > .row {
  position: relative;
  z-index: 2;
}

/* Keep field icons centred on the input, even when an error message shows below it */
.input-icon > i,
.input-icon .toggle-pass {
  top: 0;
  transform: none;
  height: calc(1.5rem + 1.2rem + 2px);
  display: flex;
  align-items: center;
}
.input-icon:focus-within > i {
  transform: scale(1.15);
}
/* Optional checkboxes (e.g. Remember me) stay neutral after validation */
.was-validated .form-check-input:not([required]):valid {
  border-color: var(--bs-border-color);
}
.was-validated .form-check-input:not([required]):valid:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.was-validated .form-check-input:not([required]):valid ~ .form-check-label {
  color: inherit;
}

/* PHP version: loading look for normal submit buttons */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

/* Uploaded company logo */
.brand img.site-logo {
  height: 46px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}
.topbar .brand img.site-logo {
  height: 42px;
}
@media (max-width: 575.98px) {
  .brand img.site-logo,
  .topbar .brand img.site-logo,
  .home-nav .brand img.site-logo {
    height: 34px;
    max-width: 150px;
  }
}
.home-footer .brand img.site-logo {
  height: 52px;
}
.nav-logos .logo-on-light {
  display: none;
}
.home-nav.scrolled .nav-logos .logo-on-dark {
  display: none;
}
.home-nav.scrolled .nav-logos .logo-on-light {
  display: inline-flex;
}
.home-nav .brand img.site-logo,
.home-footer .brand img.site-logo {
  width: auto;
}
