/* Interactive Investor Portal — main stylesheet */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --primary:       #1A1464;
  --primary-hover: #130F4F;
  --accent:        #FF6200;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --bg:            #f8fafc;
  --bg-card:       #ffffff;
  --text:          #111827;
  --text-muted:    #6b7280;
  --border:        #e2e8f0;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 24px rgba(26,20,100,.18);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px}
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:var(--bg);color:var(--text);min-height:100vh;line-height:1.5}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer}
input,select,textarea{font-family:inherit}
img{max-width:100%;display:block}

/* ── Gate / Login card ───────────────────────────────────────────────────── */
.gate-body {
  min-height: 100vh;
  background: #f4f3f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gate-card {
  background: #fff;
  border-radius: 4px;
  border-top: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 12px 40px rgba(0,0,0,.08);
  width: 100%;
  max-width: 420px;
  padding: 3rem 2.75rem 2.5rem;
}

.gate-logo {
  display: block;
  max-height: 44px;
  width: auto;
  margin: 0 auto 1.75rem;
}

.gate-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: .4rem;
  letter-spacing: -.15px;
}

.gate-sub {
  font-size: .8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.gate-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

/* field */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: .4rem;
}
.field input[type="date"],
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  -webkit-appearance: none;
}
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,20,100,.1);
}
.field input::placeholder { color: #c4c9d4; }

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 2.75rem; }
.pwd-toggle {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #9ca3af; display: flex; align-items: center;
  padding: .2rem; transition: color .2s;
}
.pwd-toggle:hover { color: var(--primary); }

/* alert */
.alert-error {
  background: #fff5f5;
  border-left: 3px solid #ef4444;
  color: #dc2626;
  padding: .7rem 1rem;
  font-size: .875rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}
.alert-success-inline {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  color: #15803d;
  padding: .7rem 1rem;
  font-size: .875rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

/* button */
.btn-gate {
  width: 100%;
  padding: .875rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .625rem;
  margin-top: 1.5rem;
  transition: background .18s, box-shadow .18s;
}
.btn-gate:hover { background: var(--primary-hover); box-shadow: 0 4px 16px rgba(26,20,100,.28); }
.btn-gate:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.secure-badge {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin-top: 1.75rem;
  font-size: .78rem; color: #9ca3af;
}
.secure-badge svg { width: 13px; height: 13px; color: var(--primary); }

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.forgot-link a { color: var(--primary); font-weight: 500; }
.forgot-link a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .gate-card { padding: 2rem 1.5rem; }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 2rem;
}

.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.site-logo img { height: 36px; width: auto; }

.main-nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}

.nav-link {
  padding: .5rem .875rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--primary); background: rgba(26,20,100,.06); }
.nav-link.active { color: #fff; font-weight: 600; background: var(--primary); border-radius: 6px; }

/* user menu */
.user-menu-wrap { position: relative; margin-left: 1rem; flex-shrink: 0; }

.user-menu-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .875rem .375rem .375rem;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  background: #fff;
  font-size: .9375rem; font-weight: 500; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.user-menu-btn:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

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

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .5rem); right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
}

.dropdown-item { display: block; padding: .75rem 1rem; font-size: .9375rem; color: var(--text); transition: background .15s; }
.dropdown-item:hover { background: var(--bg); }
.dropdown-divider { height: 1px; background: var(--border); }

/* ── Page layout ─────────────────────────────────────────────────────────── */
.page-container { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }

.welcome-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.welcome-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.welcome-sub { font-size: .875rem; color: var(--text-muted); margin-top: .25rem; }

.section-title {
  font-size: .875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  margin-bottom: .75rem; margin-top: 1.75rem;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-bottom: 1.75rem; }

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: .875rem; color: var(--text-muted); margin-bottom: .375rem; }
.stat-value { font-size: 1.625rem; font-weight: 700; color: var(--primary); }
.stat-value.accent { color: var(--accent); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: 1.125rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--primary); }
.card-body { padding: 1.5rem; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
thead { background: #f8fafc; }
th { padding: .75rem 1rem; text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .875rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(26,20,100,.04) !important; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: .2rem .625rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e8e6f8; color: #1A1464; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .625rem 1.25rem; border-radius: var(--radius); font-size: .9375rem; font-weight: 600; border: none; cursor: pointer; transition: all .2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--primary); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm  { padding: .375rem .75rem; font-size: .8125rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: .4rem; font-size: .875rem; font-weight: 600; color: var(--text); }
.form-control { width: 100%; padding: .625rem .875rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .9375rem; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,20,100,.1); }
.form-control::placeholder { color: #9ca3af; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .625rem center; background-size: 16px; padding-right: 2.25rem; }
.settings-section-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .875rem; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: .875rem 1.125rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9375rem; }
.alert-error   { background: #fee2e2; color: #b91c1c; border-left: 4px solid var(--danger); }
.alert-success { background: #dcfce7; color: #15803d; border-left: 4px solid var(--success); }
.alert-info    { background: #e8e6f8; color: var(--primary); border-left: 4px solid var(--primary); }

/* ── Info box (funding page) ─────────────────────────────────────────────── */
.info-box { background: #eef4fb; border: 1px solid #c3d9f0; border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: .625rem 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: .875rem; color: var(--text-muted); }
.info-value { font-size: .9375rem; font-weight: 600; color: var(--primary); font-family: monospace; }

/* ── Profile page ────────────────────────────────────────────────────────── */
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.625rem; font-weight: 700; flex-shrink: 0; }

/* ── Account header (transactions) ──────────────────────────────────────── */
.account-header-panel { background: var(--primary); color: #fff; border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.account-header-name { font-size: 1.125rem; font-weight: 700; margin-bottom: .25rem; }
.account-header-meta { font-size: .8125rem; opacity: .75; font-family: monospace; }
.account-header-stats { display: flex; gap: 2.5rem; text-align: right; flex-shrink: 0; }
.account-header-stats .stat-label { color: rgba(255,255,255,.7); }
.account-header-stats .stat-value { color: #fff; font-size: 1.25rem; }
.account-header-stats .stat-value.accent { color: #FFA07A; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm); }

/* ── Contact notice ──────────────────────────────────────────────────────── */
.contact-notice { display: flex; align-items: flex-start; gap: .875rem; background: #f0f4ff; border: 1px solid #c7d2fe; border-radius: 8px; padding: 1.25rem 1.5rem; margin-top: 1.5rem; }
.contact-notice svg { flex-shrink: 0; color: var(--primary); margin-top: .1rem; }
.contact-notice p { margin: 0; font-size: .9375rem; color: #1e1b6b; line-height: 1.5; }
.contact-notice strong { display: block; margin-bottom: .2rem; }

/* ── Fund page rows ──────────────────────────────────────────────────────── */
.fund-row { display: flex; padding: .9rem 0; border-bottom: 1px solid var(--border); align-items: center; gap: 1rem; }
.fund-row:last-child { border-bottom: none; }
.fund-label { font-size: .8125rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; min-width: 140px; }
.fund-value { font-size: 1rem; font-weight: 600; color: var(--text); font-family: monospace; }
.nom-row { display: flex; flex-direction: column; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.nom-row:last-child { border-bottom: none; }
.nom-label { font-size: .8125rem; font-weight: 500; color: var(--text-muted); margin-bottom: .25rem; }
.nom-value { font-size: 1rem; font-weight: 600; color: #111827; }

/* ── Profile info rows ───────────────────────────────────────────────────── */
.detail-row { display: flex; padding: .75rem 0; border-bottom: 1px solid var(--border); gap: 1rem; }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: .875rem; font-weight: 500; color: var(--text-muted); min-width: 140px; padding-top: .1rem; }
.detail-value { font-size: .9375rem; color: var(--text); }

/* ── pwd wrap (profile) ──────────────────────────────────────────────────── */
.pwd-wrap-inner { position: relative; }
.pwd-wrap-inner input { padding-right: 2.5rem; }
.pwd-toggle-inner { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; padding: .25rem; }
.pwd-toggle-inner:hover { color: var(--primary); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-cols-2,.grid-cols-3 { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: 1fr; }
  .main-nav    { display: none; }
  .header-inner { gap: .75rem; }
  .account-header-panel { flex-direction: column; align-items: flex-start; }
  .account-header-stats { text-align: left; gap: 1.5rem; }
}
