/* custom.css - GIFT360 Styling inspired by gift360.com */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* GIFT360 Brand Colors */
  --gcf-blue: #2563eb;
  --gcf-blue-dark: #1d4ed8;
  --gcf-neon: #79FE0C;
  --gcf-neon-dark: #67e600;

  /* Theme Defaults (Dark by default for sleek fintech look, toggleable to light) */
  --color-bg: #0b0f19;
  --color-bg-subtle: #0f172a;
  --color-card: #131d31;
  --color-card-hover: #192642;
  --color-border: #1e293b;
  --color-border-strong: #334155;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-subtle: #64748b;
  --color-badge-tier1-bg: rgba(37, 99, 235, 0.15);
  --color-badge-tier1-text: #60a5fa;
  --color-badge-tier1-border: rgba(96, 165, 250, 0.3);
  --color-badge-tier2-bg: rgba(148, 163, 184, 0.12);
  --color-badge-tier2-text: #cbd5e1;
  --color-badge-tier2-border: rgba(148, 163, 184, 0.25);
  --color-badge-outbound-bg: rgba(249, 115, 22, 0.15);
  --color-badge-outbound-text: #fb923c;
  --color-badge-outbound-border: rgba(251, 146, 60, 0.3);
  --color-badge-inbound-bg: rgba(16, 185, 129, 0.15);
  --color-badge-inbound-text: #34d399;
  --color-badge-inbound-border: rgba(52, 211, 153, 0.3);
}

html.light {
  --color-bg: #f8fafc;
  --color-bg-subtle: #ffffff;
  --color-card: #ffffff;
  --color-card-hover: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-subtle: #64748b;
  --color-badge-tier1-bg: rgba(37, 99, 235, 0.1);
  --color-badge-tier1-text: #1d4ed8;
  --color-badge-tier1-border: rgba(37, 99, 235, 0.25);
  --color-badge-tier2-bg: rgba(100, 116, 139, 0.08);
  --color-badge-tier2-text: #334155;
  --color-badge-tier2-border: rgba(100, 116, 139, 0.2);
  --color-badge-outbound-bg: rgba(249, 115, 22, 0.1);
  --color-badge-outbound-text: #c2410c;
  --color-badge-outbound-border: rgba(249, 115, 22, 0.25);
  --color-badge-inbound-bg: rgba(16, 185, 129, 0.1);
  --color-badge-inbound-text: #047857;
  --color-badge-inbound-border: rgba(16, 185, 129, 0.25);
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* Shine Sweep Animation (GIFT360 brand effect) */
@keyframes shineSweep {
  0% { transform: translateX(-150%) skewX(-20deg); }
  100% { transform: translateX(200%) skewX(-20deg); }
}

.animate-shine {
  animation: shineSweep 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.animate-pulse-glow {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* Glassmorphic card styling */
.glass-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background-color: var(--color-card-hover);
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.3);
}

/* Neon Gradient CTA */
.btn-neon {
  background: linear-gradient(135deg, #67e600 0%, #79FE0C 45%, #9cff4c 65%, #69e900 100%);
  color: #0b0f19;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(121, 254, 12, 0.3);
  transition: all 0.25s ease;
}

.btn-neon:hover {
  box-shadow: 0 0 25px rgba(121, 254, 12, 0.6);
  transform: translateY(-1px) scale(1.02);
}

/* Blue Brand CTA */
.btn-blue {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.25s ease;
}

.btn-blue:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

/* Drop Zone / Image Placeholder Styling */
.chart-placeholder-box {
  border: 2px dashed var(--color-border-strong);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.chart-placeholder-box:hover {
  border-color: var(--gcf-blue);
  background: rgba(37, 99, 235, 0.04);
}

/* Table scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gcf-blue);
}

/* Ticker Marquee */
.ticker-container {
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: tickerScroll 45s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Tab Active styling */
.tab-btn.active {
  background-color: var(--gcf-blue);
  color: #ffffff;
  border-color: var(--gcf-blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Badge styles */
.badge-tier1 {
  background-color: var(--color-badge-tier1-bg);
  color: var(--color-badge-tier1-text);
  border: 1px solid var(--color-badge-tier1-border);
}

.badge-tier2 {
  background-color: var(--color-badge-tier2-bg);
  color: var(--color-badge-tier2-text);
  border: 1px solid var(--color-badge-tier2-border);
}

.badge-outbound {
  background-color: var(--color-badge-outbound-bg);
  color: var(--color-badge-outbound-text);
  border: 1px solid var(--color-badge-outbound-border);
}

.badge-inbound {
  background-color: var(--color-badge-inbound-bg);
  color: var(--color-badge-inbound-text);
  border: 1px solid var(--color-badge-inbound-border);
}

/* ========================================================================= */
/* FOLIO CREATION FLOW (Onboard Investor Wizard)                             */
/* ========================================================================= */

.folio-progress-track {
  display: flex;
  gap: 6px;
  width: 100%;
}

.folio-progress-seg {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background-color: var(--color-border-strong);
  overflow: hidden;
  position: relative;
}

.folio-progress-seg.done,
.folio-progress-seg.active {
  background-color: var(--gcf-blue);
}

.folio-side-panel {
  background: linear-gradient(160deg, #0a1128 0%, #0f1b3d 55%, #142863 100%);
  position: relative;
  overflow: hidden;
  color: #f8fafc;
}

.folio-side-panel .folio-side-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.35), transparent 70%);
  top: -60px;
  right: -80px;
  pointer-events: none;
}

.folio-side-panel.side-warm {
  background: linear-gradient(160deg, #2b1608 0%, #3a1f0d 55%, #52290f 100%);
}

.folio-side-panel.side-purple {
  background: linear-gradient(160deg, #170a33 0%, #241154 55%, #351a7a 100%);
}

.folio-client-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folio-client-row:hover {
  background-color: var(--color-card-hover);
}

.folio-client-row.selected {
  background-color: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
}

.folio-client-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  background-color: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}

.folio-upload-zone {
  border: 1.5px dashed var(--color-border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  color: var(--color-text-subtle);
  background: rgba(255, 255, 255, 0.015);
}

.folio-upload-zone:hover {
  border-color: var(--gcf-blue);
  color: var(--gcf-blue);
}

.folio-upload-zone.filled {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
  color: var(--color-text);
  justify-content: space-between;
}

.folio-fund-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
}

.folio-fund-chip.live {
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

/* Printable Application Form Preview — always paper-white regardless of theme */
.folio-doc {
  background: #ffffff;
  color: #111827;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 10.5px;
  line-height: 1.4;
}

.folio-doc table {
  width: 100%;
  border-collapse: collapse;
}

.folio-doc th, .folio-doc td {
  border: 1px solid #cbd5e1;
  padding: 4px 6px;
  vertical-align: top;
  text-align: left;
}

.folio-doc .doc-section-title {
  background: #eef2ff;
  color: #1e293b;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.03em;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
}

.folio-doc .doc-field-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  display: block;
  margin-bottom: 1px;
}

.folio-doc .doc-boxes {
  display: inline-flex;
  gap: 1.5px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
}

.folio-doc .doc-box {
  border: 1px solid #94a3b8;
  min-width: 12px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #1d4ed8;
  background: #f8fafc;
}

.folio-doc .doc-check {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border: 1px solid #64748b;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  margin-right: 4px;
  vertical-align: middle;
}

.folio-doc .doc-check.checked {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

.folio-doc .doc-sig-box {
  border: 1px dashed #94a3b8;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 9px;
  font-style: italic;
}

/* Larger, print-scale typography used only for the PDF export clones (not
   the in-app preview, which stays compact to fit the modal). The on-screen
   preview's condensed 10.5px type looked fine in a scrollable box, but
   produced pages with a lot of empty space once printed to A4 — real
   application-form pages are set in a much larger, page-filling type. */
.folio-doc.pdf-export-scale {
  font-size: 13px;
  line-height: 1.6;
}

.folio-doc.pdf-export-scale th,
.folio-doc.pdf-export-scale td {
  padding: 7px 9px;
}

.folio-doc.pdf-export-scale .doc-section-title {
  font-size: 12px;
  padding: 7px 10px;
}

.folio-doc.pdf-export-scale .doc-field-label {
  font-size: 10px;
}

.folio-doc.pdf-export-scale .doc-boxes {
  gap: 2px;
}

.folio-doc.pdf-export-scale .doc-box {
  min-width: 16px;
  height: 20px;
  font-size: 11.5px;
}

.folio-doc.pdf-export-scale .doc-check {
  width: 13px;
  height: 13px;
  font-size: 10.5px;
  margin-right: 5px;
}

.folio-doc.pdf-export-scale .doc-sig-box {
  height: 64px;
  font-size: 11px;
}

.folio-doc.pdf-export-scale .doc-title-box {
  padding: 16px 20px;
}

.folio-doc.pdf-export-scale .doc-title-box .doc-title-line {
  font-size: 16px;
}

.folio-doc.pdf-export-scale .doc-title-box .doc-title-scheme {
  font-size: 11.5px;
  margin-top: 6px;
}

.folio-doc.pdf-export-scale .doc-thumb .doc-thumb-preview {
  height: 110px;
}

.folio-doc.pdf-export-scale .doc-thumb .doc-thumb-label {
  font-size: 10.5px;
  padding: 5px 6px;
}

.folio-doc.pdf-export-scale .doc-plain-title {
  font-size: 13px;
}

.folio-doc.pdf-export-scale .doc-brand-mark-top {
  font-size: 13px;
}

.folio-doc.pdf-export-scale .doc-brand-mark-bottom {
  font-size: 12px;
}

/* Each logical page of the generated form (cover, general info, KYC/FATCA,
   bank/nomination, declarations, instructions, uploaded documents). On
   screen these stack with a dashed divider; in the PDF export each one
   becomes its own page, matching the printed form's real pagination. */
.folio-doc .doc-page {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 2px dashed #cbd5e1;
}

.folio-doc .doc-page:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* AMC logo slot on the cover page. Points at a static file path — drop the
   actual logo file at that path on the server and it renders here; if the
   file is missing, onerror hides the <img> so nothing broken shows. */
.folio-doc .doc-amc-logo-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.folio-doc .doc-amc-logo {
  max-height: 42px;
  max-width: 160px;
  object-fit: contain;
}

/* Plain bold section heading (no shaded bar) used only for the checklist
   header on the cover page, matching the real form's styling there. */
.folio-doc .doc-plain-title {
  font-weight: 800;
  font-size: 11px;
  color: #1e293b;
  margin-bottom: 2px;
}

/* Small distributor brand mark, bottom-right of the cover page. */
.folio-doc .doc-brand-mark {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 10px;
}

.folio-doc .doc-brand-mark-top {
  display: block;
  font-weight: 800;
  font-size: 11px;
  color: #0f172a;
  line-height: 1.1;
}

.folio-doc .doc-brand-mark-bottom {
  display: block;
  font-weight: 800;
  font-size: 10px;
  color: #1d4ed8;
  letter-spacing: 0.04em;
  border-top: 2px solid #1d4ed8;
  line-height: 1.2;
}

/* Rounded title block at the top of the generated form, matching the AMC's
   own application-form header style. */
.folio-doc .doc-title-box {
  border: 2px solid #64748b;
  border-radius: 14px;
  padding: 10px 14px;
  text-align: center;
  margin-bottom: 10px;
}

.folio-doc .doc-title-box .doc-title-line {
  font-weight: 800;
  font-size: 12px;
  color: #1e293b;
  line-height: 1.35;
}

.folio-doc .doc-title-box .doc-title-scheme {
  margin-top: 4px;
  font-size: 9px;
  color: #475569;
  font-weight: 600;
}

/* Uploaded-document thumbnails shown at the end of the generated form */
.folio-doc .doc-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.folio-doc .doc-thumb {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  text-align: center;
}

.folio-doc .doc-thumb .doc-thumb-preview {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  overflow: hidden;
}

.folio-doc .doc-thumb .doc-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.folio-doc .doc-thumb .doc-thumb-label {
  font-size: 8.5px;
  font-weight: 700;
  color: #334155;
  padding: 3px 4px;
  border-top: 1px solid #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sign / Sign-via-Mail action buttons on the Review step, replacing the
   generic Continue button once the document is ready. */
.folio-sign-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.folio-sign-btn.primary {
  background: var(--gcf-blue);
  color: #ffffff;
  border: 1px solid var(--gcf-blue);
}

.folio-sign-btn.primary:hover {
  filter: brightness(1.08);
}

.folio-sign-btn.secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.folio-sign-btn.secondary:hover {
  border-color: var(--gcf-blue);
  color: var(--gcf-blue);
}
