@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================
   MoneySweep Design System — LIGHT MODE
   Source: BRAND.md v1.0
   ============================================ */

:root {
  /* Brand Primary */
  --navy: #1B2A4A;
  --trust-blue: #2563EB;
  --action-green: #16A34A;

  /* Brand Support */
  --gold: #D2A94E;
  --alert-red: #DC2626;
  --slate-700: #334155;
  --slate-400: #94A3B8;

  /* Backgrounds — Light Mode (default) */
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-surface: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Text */
  --text-primary: #1B2A4A;
  --text-secondary: #334155;
  --text-muted: #94A3B8;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* Dark Mode variant (for future A/B test — apply class "dark-mode" to <html>) */
.dark-mode {
  --bg-page: #0F172A;
  --bg-card: #1E293B;
  --bg-surface: #334155;
  --border: #475569;
  --border-strong: #64748B;
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
}

/* ============================================
   RESET & BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, .h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--navy);
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--navy);
}

h3, .h3 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h4, .h4 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  h1, .h1 { font-size: 40px; }
  h2, .h2 { font-size: 32px; }
  h3, .h3 { font-size: 22px; }
  h4, .h4 { font-size: 18px; }
}

.font-display { font-family: var(--font-display) !important; }
.font-mono, .money-value { font-family: var(--font-mono) !important; font-weight: 500; }

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-static {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.938rem;
  letter-spacing: 0.025em;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  min-height: 48px;
  font-family: var(--font-body);
}

.btn-primary {
  background: var(--action-green);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}

.btn-primary:hover {
  background: #15803d;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-accent {
  background: var(--action-green);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}

.btn-accent:hover {
  background: #15803d;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--trust-blue);
  border: 1px solid var(--trust-blue);
}

.btn-outline:hover {
  background: rgba(37, 99, 235, 0.05);
}

.btn-gold {
  background: var(--gold);
  color: #FFFFFF;
  font-weight: 700;
}

.btn-gold:hover {
  background: #c49b3f;
  box-shadow: 0 4px 12px rgba(210, 169, 78, 0.35);
}

.btn-block { width: 100%; }

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-accent {
  background: rgba(22, 163, 74, 0.1);
  color: #16A34A;
}

.badge-warning {
  background: rgba(210, 169, 78, 0.12);
  color: #a08628;
}

.badge-primary {
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
}

.badge-danger {
  background: rgba(220, 38, 38, 0.1);
  color: #DC2626;
}

.badge-gold {
  background: rgba(210, 169, 78, 0.12);
  color: #a08628;
  border: 1px solid rgba(210, 169, 78, 0.3);
}

/* ============================================
   PROGRESS RING
   ============================================ */

.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring .track {
  stroke: var(--border);
  fill: none;
}

.progress-ring .fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

/* ============================================
   LOCKED OVERLAY
   ============================================ */

.locked {
  position: relative;
  opacity: 0.5;
  pointer-events: none;
}

.locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.5);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(2px);
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Social Proof Ticker (kept for compatibility — removed from dashboard) */
.ticker-container { overflow: hidden; position: relative; }
.ticker-item { animation: tickerSlide 8s ease-in-out; }

@keyframes tickerSlide {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ============================================
   LAYOUT
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container { padding: 0 1.5rem; }
}

/* ============================================
   BOTTOM NAV (Mobile)
   ============================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.04);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--slate-400);
  text-decoration: none;
  font-size: 0.688rem;
  font-weight: 500;
  padding: 0.375rem 0.5rem;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  transition: color 0.2s;
}

.bottom-nav a.active {
  color: var(--trust-blue);
}

.bottom-nav a i {
  font-size: 1.25rem;
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

/* ============================================
   SIDEBAR (Desktop)
   ============================================ */

.sidebar { display: none; }

@media (min-width: 768px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 260px;
    min-height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
  }

  .main-content {
    margin-left: 260px;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* Text gradient utilities (for compatibility — prefer solid colors in light mode) */
.text-gradient-primary {
  background: linear-gradient(135deg, var(--trust-blue), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  color: var(--gold);
  /* Solid color in light mode for legibility */
}

.text-gradient-accent {
  color: var(--action-green);
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   CONTENT ARTICLE — T2 round 2 / Bloco A
   Typography for curated T7 content rendered by js/content-renderer.js
   WCAG AA compliant:
     - 16px base (minimum per BRAND.md)
     - 18px+ headings
     - Slate 600 body (7.29:1 on white)
     - Navy headings and strong (13.05:1 on white)
     - Line-height 1.65 body
     - Max-width 680px (~65-70 chars at 16px Inter)
   ============================================ */

.content-article {
  max-width: 680px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
  word-wrap: break-word;
}

.content-article > :first-child {
  margin-top: 0;
}

.content-article h1 {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.15;
  font-weight: 400;
  color: var(--navy);
  margin: 0 0 1rem 0;
}

.content-article h2 {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 400;
  color: var(--navy);
  margin: 2rem 0 0.75rem 0;
}

.content-article h3 {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--navy);
  margin: 1.5rem 0 0.5rem 0;
}

.content-article h4 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin: 1.25rem 0 0.5rem 0;
}

.content-article p {
  color: var(--slate-700);
  margin: 0 0 1rem 0;
}

.content-article strong {
  color: var(--navy);
  font-weight: 600;
}

.content-article em {
  font-style: italic;
  color: var(--slate-700);
}

.content-article ul,
.content-article ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
  color: var(--slate-700);
}

.content-article li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

.content-article li > p {
  margin-bottom: 0.25rem;
}

.content-article ul ul,
.content-article ol ol,
.content-article ul ol,
.content-article ol ul {
  margin: 0.25rem 0;
}

.content-article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.content-article blockquote {
  border-left: 3px solid var(--trust-blue);
  margin: 1rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  color: var(--slate-700);
  font-style: italic;
}

.content-article code {
  font-family: var(--font-mono);
  font-size: 0.9375em;
  background: var(--bg-surface);
  color: var(--navy);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.content-article pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 0 0 1rem 0;
}

.content-article pre code {
  background: transparent;
  padding: 0;
  font-size: 0.875em;
}

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem 0;
  font-size: 0.9375em;
}

.content-article th,
.content-article td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  color: var(--slate-700);
}

.content-article th {
  background: var(--bg-surface);
  font-weight: 600;
  color: var(--navy);
}

/* Loading/error placeholders used by the renderer */
.content-loading {
  color: var(--slate-400);
  font-size: 0.875rem;
  padding: 2rem;
  text-align: center;
}

.content-error {
  color: var(--alert-red);
  font-size: 0.875rem;
  padding: 1rem;
  background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius);
  text-align: center;
}

/* ============================================
   REGULATORY REVIEW FOOTER — auto-injected per content piece
   Single-line flex, shield icon, Inter regular date (mono exception).
   See memory: feedback_mono_exception_discreet_footer.md
   ============================================ */

.content-review-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 680px;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.content-review-icon {
  color: var(--action-green);
  font-size: 0.9375rem;
  flex-shrink: 0;
  margin-top: 0.1875rem;
}

.content-review-text {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.813rem;       /* 13px */
  line-height: 1.55;
  color: var(--slate-700);   /* Slate 600 — 7.29:1 on white */
  margin: 0;
}

.content-review-text strong {
  font-weight: 600;
  color: var(--navy);
}

.content-review-text time {
  /* Mono exception: inherit Inter regular so the date does not pull
     visual attention in a discreet footer. See memory rule. */
  font-family: inherit;
  font-weight: 400;
  font-style: normal;
  color: var(--slate-700);
}

.content-review-disclaimer {
  font-style: italic;
}

/* Dark variant for navy card contexts (not used by sweep modal, kept for flexibility) */
.content-review-footer.is-dark {
  border-top-color: rgba(203, 213, 225, 0.15);
}

.content-review-footer.is-dark .content-review-text {
  color: #94A3B8;
}

.content-review-footer.is-dark .content-review-text strong {
  color: #F8FAFC;
}

.content-review-footer.is-dark .content-review-text time {
  color: #94A3B8;
}

.content-review-footer.is-dark .content-review-icon {
  color: #60A5FA;
}
