/* =====================================================================
   TEJUS HOLDINGS - Brand Theme (Teal & Gold Fintech)
   Depth, hierarchy, motion — desktop + mobile
   ===================================================================== */

:root {
  --bg: #02161a;
  --bg-elevated: #062a30;
  --card: #0A2C31;
  --card-top: #124048;
  --dark-teal: #00464D;
  --primary: #027B84;
  --primary-bright: #2ec4ce;
  --gold: #F9A101;
  --gold-soft: #ffc44d;
  --white: #FFFFFF;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(46, 196, 206, .28);
  --muted: rgba(255, 255, 255, .58);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .38);
  --shadow-lift: 0 20px 48px rgba(0, 0, 0, .45);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .08);
  --font-primary: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-secondary: 'Sora', system-ui, sans-serif;
  --font-numbers: 'Space Grotesk', monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--white);
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(249, 161, 1, .35);
  color: #fff;
}

/* ---------- Layered atmosphere ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(2, 123, 132, .42), transparent 58%),
    radial-gradient(780px 480px at 96% 4%, rgba(249, 161, 1, .16), transparent 52%),
    radial-gradient(700px 600px at 70% 100%, rgba(0, 90, 98, .55), transparent 55%),
    radial-gradient(500px 400px at 20% 80%, rgba(2, 123, 132, .18), transparent 60%),
    linear-gradient(165deg, #031c21 0%, #02161a 45%, #041f24 100%);
}
.bg-fx::before,
.bg-fx::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: orbDrift 22s var(--ease) infinite alternate;
}
.bg-fx::before {
  width: 420px; height: 420px;
  left: -80px; top: 18%;
  background: rgba(2, 123, 132, .35);
}
.bg-fx::after {
  width: 360px; height: 360px;
  right: -60px; bottom: 12%;
  background: rgba(249, 161, 1, .14);
  animation-delay: -8s;
  animation-duration: 28s;
}
@keyframes orbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.12); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%);
  opacity: .55;
  animation: gridPulse 12s ease-in-out infinite alternate;
}
@keyframes gridPulse {
  0%   { opacity: .35; }
  100% { opacity: .6; }
}

.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-particles span {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 0 10px rgba(249, 161, 1, .55), 0 0 22px rgba(2, 123, 132, .35);
  opacity: .75;
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  12%  { opacity: .85; }
  50%  { transform: translateY(-55vh) translateX(22px) scale(1.15); opacity: .7; }
  100% { transform: translateY(-115vh) translateX(-16px) scale(.9); opacity: 0; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, .heading {
  font-family: var(--font-secondary);
  font-weight: 700;
  letter-spacing: -.02em;
}
.num { font-family: var(--font-numbers); letter-spacing: .4px; font-variant-numeric: tabular-nums; }
a { color: var(--gold); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-soft); text-decoration: none; }
.text-muted-2 { color: var(--muted) !important; }
.text-gold { color: var(--gold) !important; }

/* ---------- Reveal motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal-d1 { transition-delay: .06s; }
.reveal-d2 { transition-delay: .12s; }
.reveal-d3 { transition-delay: .18s; }
.reveal-d4 { transition-delay: .24s; }

/* ---------- Cards ---------- */
.tj-card {
  position: relative;
  background:
    linear-gradient(155deg, rgba(18, 64, 72, .88) 0%, rgba(8, 40, 46, .92) 48%, rgba(4, 32, 38, .95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--inset);
  backdrop-filter: blur(14px);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s ease;
  overflow: hidden;
}
.tj-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  pointer-events: none;
}
.tj-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 180px at 100% 0%, rgba(249,161,1,.07), transparent 55%);
  pointer-events: none;
}
.tj-card > * { position: relative; z-index: 1; }
.tj-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift), var(--inset);
  border-color: var(--border-strong);
}
.tj-card.active-card {
  border-color: rgba(249, 161, 1, .55);
  box-shadow: var(--shadow), 0 0 0 1px rgba(249,161,1,.15);
}

.stat-card {
  padding: 22px 20px;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--gold), var(--primary));
  z-index: 2;
}
.stat-card .label {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  font-weight: 600;
}
.stat-card .value {
  font-family: var(--font-numbers);
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 8px;
  background: linear-gradient(180deg, #fff 30%, rgba(255,255,255,.72));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-card .icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.2rem;
  background: linear-gradient(145deg, rgba(2,123,132,.35), rgba(249,161,1,.12));
  border: 1px solid rgba(255,255,255,.08);
  color: var(--gold);
  box-shadow: var(--inset);
}

/* ---------- Welcome / hero strip ---------- */
.welcome-banner {
  position: relative;
  padding: 22px 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(2,123,132,.35), rgba(10,44,49,.5) 45%, rgba(249,161,1,.12)),
    linear-gradient(160deg, #0c3a42, #06252b);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), var(--inset);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  right: -40px; top: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,161,1,.22), transparent 70%);
  pointer-events: none;
}
.welcome-banner .heading { margin: 0 0 4px; font-size: 1.45rem; }
.welcome-banner .text-muted-2 { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn-gold {
  background: linear-gradient(135deg, #ffbf3f 0%, var(--gold) 45%, #e89200 100%);
  color: #1a1200;
  border: none;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  box-shadow: 0 8px 20px rgba(249, 161, 1, .28), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .22s var(--ease), box-shadow .22s ease, filter .22s ease;
}
.btn-gold:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 28px rgba(249, 161, 1, .38), inset 0 1px 0 rgba(255,255,255,.4);
  color: #1a1200;
}
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled {
  opacity: .45;
  transform: none;
  filter: none;
  box-shadow: none;
}
.btn-teal {
  background: linear-gradient(160deg, rgba(2,123,132,.22), rgba(2,123,132,.08));
  color: var(--white);
  border: 1px solid rgba(46, 196, 206, .45);
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-weight: 600;
  box-shadow: var(--inset);
  transition: all .22s var(--ease);
}
.btn-teal:hover {
  background: rgba(2, 123, 132, .32);
  border-color: var(--primary-bright);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  background: rgba(2, 22, 26, .75);
  border: 1px solid var(--border);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-control:focus, .form-select:focus {
  background: rgba(2, 28, 32, .92);
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 3px rgba(2, 123, 132, .22);
  color: var(--white);
}
.form-control::placeholder { color: rgba(255,255,255,.32); }
.form-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.input-group-text {
  background: rgba(2, 30, 34, .85) !important;
  border-color: var(--border) !important;
  color: var(--gold) !important;
}

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  animation: authIn .6s var(--ease) both;
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; line-height: 0;
}
.brand-mark img { display: block; height: auto; object-fit: contain; }
.brand-mark-logo img { width: 100%; max-width: 180px; max-height: 52px; }
.brand-mark-logo.auth-logo img { max-width: 220px; max-height: 64px; margin: 0 auto; }
.brand-mark-icon img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.tj-sidebar .brand-mark-logo { display: block; padding: 6px 10px 14px; }

/* ---------- Sidebar / layout ---------- */
.tj-shell { display: flex; min-height: 100vh; }
.tj-sidebar {
  width: 264px; flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(12, 50, 56, .98) 0%, rgba(4, 28, 32, .98) 100%);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  box-shadow: 8px 0 32px rgba(0, 0, 0, .25);
}
.tj-sidebar .nav-link {
  color: rgba(255,255,255,.7);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 3px;
  font-size: .92rem;
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent;
  transition: all .2s var(--ease);
  position: relative;
}
.tj-sidebar .nav-link:hover {
  background: rgba(2, 123, 132, .16);
  color: #fff;
  text-decoration: none;
  border-color: rgba(255,255,255,.04);
}
.tj-sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(249,161,1,.16), rgba(2,123,132,.22));
  color: var(--gold-soft);
  border-color: rgba(249, 161, 1, .22);
  box-shadow: var(--inset);
}
.tj-sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.tj-sidebar .nav-section {
  color: rgba(255,255,255,.38);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin: 18px 12px 8px;
}

.tj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tj-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 22, 26, .72);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.tj-content { padding: 24px; }

.avatar-chip {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(2,123,132,.22), rgba(249,161,1,.08));
  border: 1px solid var(--border);
  padding: 6px 12px 6px 6px;
  border-radius: 28px;
  box-shadow: var(--inset);
  transition: border-color .2s ease;
}
.avatar-chip:hover { border-color: var(--border-strong); }
.avatar-chip .initial {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #1a1200; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(249, 161, 1, .35);
}

/* Progress bar */
.tj-progress {
  height: 10px;
  background: rgba(255,255,255,.07);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.tj-progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-bright), var(--gold));
  background-size: 200% 100%;
  animation: barShimmer 2.8s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes barShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Tables */
.tj-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.tj-table th, .tj-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.tj-table th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .7px;
  font-weight: 700;
  background: rgba(0, 0, 0, .18);
}
.tj-table th:first-child { border-radius: 10px 0 0 0; }
.tj-table th:last-child { border-radius: 0 10px 0 0; }
.tj-table tbody tr {
  transition: background .18s ease;
}
.tj-table tbody tr:hover {
  background: rgba(2, 123, 132, .12);
}

/* Badges */
.badge-pill {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .2px;
  border: 1px solid transparent;
}
.badge-active {
  background: rgba(2, 123, 132, .28);
  color: #7eeef4;
  border-color: rgba(46, 196, 206, .25);
}
.badge-pending {
  background: rgba(249, 161, 1, .18);
  color: var(--gold-soft);
  border-color: rgba(249, 161, 1, .28);
}
.badge-rejected {
  background: rgba(255, 80, 80, .16);
  color: #ff9a9a;
  border-color: rgba(255, 80, 80, .25);
}

/* Alerts */
.alert {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.alert-danger {
  background: rgba(120, 30, 30, .45);
  border-color: rgba(255, 100, 100, .3);
  color: #ffc9c9;
}
.alert-success {
  background: rgba(10, 80, 70, .45);
  border-color: rgba(46, 196, 206, .35);
  color: #b8fff4;
}
.alert-warning {
  background: rgba(90, 60, 10, .45);
  border-color: rgba(249, 161, 1, .35);
  color: #ffe0a3;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: linear-gradient(160deg, rgba(2,123,132,.25), rgba(2,123,132,.08));
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color .2s ease;
}
.menu-toggle:hover { border-color: var(--border-strong); }
.sidebar-backdrop { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .tj-sidebar {
    position: fixed; left: 0; top: 0; z-index: 60;
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
    box-shadow: none;
  }
  .tj-shell.nav-open .tj-sidebar {
    transform: translateX(0);
    box-shadow: 16px 0 48px rgba(0, 0, 0, .5);
  }
  .menu-toggle { display: inline-flex; }
  .tj-shell.nav-open .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0, 8, 10, .65);
    backdrop-filter: blur(3px);
  }
}

@media (max-width: 575px) {
  .tj-content { padding: 16px 14px; }
  .stat-card .value { font-size: 1.35rem; }
  .auth-card { padding: 26px 20px; }
  .welcome-banner { padding: 18px; }
  .welcome-banner .heading { font-size: 1.2rem; }
}

/* Referral copy box */
.copy-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(2, 22, 26, .8);
  border: 1px dashed rgba(46, 196, 206, .35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.copy-box input {
  background: transparent; border: none; color: #fff;
  flex: 1; outline: none; font-size: .85rem;
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-fx::before, .bg-fx::after,
  .bg-grid, .bg-particles span,
  .tj-progress > span, .auth-card, .reveal {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
