/* Loan Monitor — Stylesheet */
/* Design system: bitcoinpensioen.eu */

:root {
  --bg: #FAFAF7;
  --bg-warm: #F5F3EE;
  --card: #FFFFFF;
  --text: #1C1917;
  --text-secondary: #57534E;
  --muted: #A8A29E;
  --accent: #E8740C;
  --accent-hover: #D16A0B;
  --accent-soft: rgba(232, 116, 12, 0.08);
  --accent-softer: rgba(232, 116, 12, 0.04);
  --green: #15803D;
  --green-soft: rgba(21, 128, 61, 0.08);
  --green-text: #166534;
  --red: #B91C1C;
  --red-soft: rgba(185, 28, 28, 0.06);
  --amber: #B45309;
  --amber-soft: rgba(180, 83, 9, 0.08);
  --amber-border: #FDE68A;
  --border: #E7E5E4;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === NAV === */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: rgba(250, 250, 247, 0.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark {
  width: 32px; height: 32px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 16px;
}
.logo-text { font-family: 'Source Serif 4', Georgia, serif; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.nav-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.nav-pill {
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-secondary);
  background: var(--bg-warm); padding: 5px 12px; border-radius: 100px; border: 1px solid var(--border);
}
.signal-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}
.live-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* === LAYOUT === */
.page { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* === HERO === */
.hero { text-align: center; padding: 44px 0 28px; }
.hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 8px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 15px; color: var(--text-secondary); max-width: 480px; margin: 0 auto; }
.disclaimer {
  display: inline-block; font-size: 11px; color: var(--muted);
  background: var(--bg-warm); border: 1px solid var(--border);
  padding: 3px 12px; border-radius: 100px; margin-top: 12px;
}
.hero-compact { padding: 24px 0 14px; }
.hero-compact h1 { font-size: 28px; margin-bottom: 0; }
.hero-compact .disclaimer { margin-top: 6px; }

/* === LOAN TYPE TOGGLE === */
.loan-toggle {
  display: flex; gap: 0; margin-bottom: 20px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg-warm);
}
.loan-toggle button {
  flex: 1; padding: 10px 16px; font-size: 14px; font-weight: 600;
  border: none; background: transparent; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.loan-toggle button.active {
  background: var(--text); color: var(--card);
}

/* === INPUT BAR === */
.input-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-md); margin-bottom: 20px;
}
.input-group { flex: 1; min-width: 120px; }
.input-group label {
  display: block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px;
}
.input-group input, .input-group select {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 500;
  color: var(--text); background: var(--bg); outline: none; transition: border-color 0.15s;
}
.input-group input:focus, .input-group select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 116, 12, 0.08);
}
.input-prefix {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  overflow: hidden; transition: border-color 0.15s;
}
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 116, 12, 0.08); }
.input-prefix span {
  padding: 7px 0 7px 10px; font-family: 'JetBrains Mono', monospace;
  font-size: 14px; color: var(--muted); user-select: none;
}
.input-prefix input {
  border: none; background: transparent; padding-left: 4px; flex: 1; min-width: 0;
}
.input-prefix input:focus { border-color: transparent; box-shadow: none; }

.inputs-hidden { display: none !important; }

/* === TRIPTYCH (three answer cards) === */
.triptych {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.tri-card {
  background: var(--card); border: 2px solid var(--border); border-radius: 14px;
  padding: 20px; text-align: center; transition: border-color 0.3s, background 0.3s;
}
.tri-question {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px;
}
.tri-icon { font-size: 20px; margin-bottom: 4px; line-height: 1; }
.tri-verdict {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px;
}
.tri-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 6px;
}
.tri-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* Triptych color states */
.tri-card.tri-green  { background: var(--green-soft); border-color: rgba(21, 128, 61, 0.25); }
.tri-card.tri-amber  { background: var(--amber-soft); border-color: rgba(180, 83, 9, 0.25); }
.tri-card.tri-orange { background: var(--accent-soft); border-color: rgba(232, 116, 12, 0.25); }
.tri-card.tri-red    { background: var(--red-soft);   border-color: rgba(185, 28, 28, 0.25); }

.tri-card.tri-green .tri-verdict,
.tri-card.tri-green .tri-number  { color: var(--green); }
.tri-card.tri-amber .tri-verdict,
.tri-card.tri-amber .tri-number  { color: var(--amber); }
.tri-card.tri-orange .tri-verdict,
.tri-card.tri-orange .tri-number { color: var(--accent); }
.tri-card.tri-red .tri-verdict,
.tri-card.tri-red .tri-number    { color: var(--red); }

/* === DEEP DIVE SEPARATOR === */
.deep-dive-separator {
  text-align: center; padding: 24px 0; position: relative;
}
.deep-dive-separator span {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  background: var(--bg); padding: 0 16px; position: relative; z-index: 1;
}
.deep-dive-separator::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}

/* === SIGNAL BAR === */
.signal-bar {
  border-radius: 12px; padding: 16px 20px; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  border: 2px solid transparent; transition: all 0.3s;
}
.signal-bar .signal-icon { font-size: 24px; flex-shrink: 0; line-height: 1; }
.signal-bar .signal-content { flex: 1; }
.signal-bar .signal-level {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 2px;
}
.signal-bar .signal-message { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.signal-bar.signal-hold { background: var(--green-soft); border-color: rgba(21, 128, 61, 0.2); }
.signal-bar.signal-hold .signal-level { color: var(--green); }
.signal-bar.signal-watch { background: var(--amber-soft); border-color: rgba(180, 83, 9, 0.2); }
.signal-bar.signal-watch .signal-level { color: var(--amber); }
.signal-bar.signal-exit { background: var(--accent-soft); border-color: rgba(232, 116, 12, 0.2); }
.signal-bar.signal-exit .signal-level { color: var(--accent); }
.signal-bar.signal-close { background: var(--red-soft); border-color: rgba(185, 28, 28, 0.2); }
.signal-bar.signal-close .signal-level { color: var(--red); }
.signal-bar.signal-caution { background: var(--amber-soft); border-color: rgba(180, 83, 9, 0.2); }
.signal-bar.signal-caution .signal-level { color: var(--amber); }

/* === BIG NUMBER === */
.big-number-card {
  border-radius: 14px; padding: 28px 32px; margin-bottom: 20px;
  text-align: center; border: 2px solid transparent; transition: all 0.3s;
}
.big-number-card.ahead { background: var(--green-soft); border-color: rgba(21, 128, 61, 0.2); }
.big-number-card.behind { background: var(--red-soft); border-color: rgba(185, 28, 28, 0.2); }
.big-number-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.big-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1;
}
.big-number-secondary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 600; margin-top: 6px; opacity: 0.8;
}
.big-number-explain { font-size: 13px; color: var(--text-secondary); margin-top: 12px; line-height: 1.5; }
.big-number-card.ahead .big-number,
.big-number-card.ahead .big-number-secondary { color: var(--green); }
.big-number-card.behind .big-number,
.big-number-card.behind .big-number-secondary { color: var(--red); }

/* === METRICS GRID === */
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.metric-card {
  background: var(--card); border-radius: 12px; border: 1px solid var(--border);
  padding: 14px 16px; text-align: center;
}
.metric-label {
  font-size: 9px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px; font-weight: 700;
}
.metric-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* === TIME COST === */
.time-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--text-secondary); text-align: center;
  padding: 12px 0; margin-bottom: 20px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}

/* === RESULT CARDS (shared) === */
.result-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 28px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.card-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.card-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

/* === MONITOR TABLE === */
.monitor-table { width: 100%; border-collapse: collapse; }
.monitor-table th {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 0; border-bottom: 1px solid var(--border); text-align: left;
}
.monitor-table th:last-child,
.monitor-table td:last-child { text-align: right; }
.monitor-table td {
  font-size: 13px; padding: 10px 0;
  border-bottom: 1px solid var(--bg-warm);
}
.monitor-table tr:last-child td { border-bottom: none; }
.monitor-table td.mono {
  font-family: 'JetBrains Mono', monospace; font-weight: 500;
}
.row-highlight {
  background: var(--accent-softer);
}
.row-highlight td { padding: 10px 8px; }
.row-highlight td:first-child { border-radius: 6px 0 0 6px; }
.row-highlight td:last-child { border-radius: 0 6px 6px 0; }

/* === TRIGGER ITEMS === */
.trigger-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--bg-warm);
}
.trigger-item:last-child { border-bottom: none; }
.trigger-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.trigger-content { flex: 1; }
.trigger-title { font-size: 14px; font-weight: 600; }
.trigger-detail { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.trigger-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}

/* === WINDOW STATUS (B2X) === */
.window-card {
  border-radius: 14px; padding: 20px 24px; margin-bottom: 20px;
  border: 1px solid var(--border); background: var(--card);
  transition: all 0.3s;
}
.window-card.open {
  background: linear-gradient(135deg, rgba(232, 116, 12, 0.06), rgba(232, 116, 12, 0.02));
  border-color: rgba(232, 116, 12, 0.3);
}
.window-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.window-icon { font-size: 22px; }
.window-title { font-size: 16px; font-weight: 700; }
.window-subtitle { font-size: 13px; color: var(--text-secondary); }

.time-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.time-bar-label {
  width: 90px; font-size: 11px; color: var(--muted); flex-shrink: 0;
}
.time-bar-track {
  flex: 1; background: var(--bg-warm); border-radius: 4px; height: 14px;
  position: relative; overflow: hidden;
}
.time-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.time-bar-current {
  position: absolute; top: 0; left: 0; height: 100%;
  border-radius: 4px; border: 2px solid;
}
.time-bar-pct { width: 36px; font-size: 11px; color: var(--muted); text-align: right; }

/* === SAFETY HORIZON === */
.safety-banner {
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.5;
}
.safety-banner strong { font-weight: 700; }
.safety-safe { background: var(--green-soft); color: var(--green-text); }
.safety-warning { background: var(--amber-soft); color: var(--amber); }
.safety-danger { background: var(--red-soft); color: var(--red); }

/* === NARRATIVE === */
.narrative {
  border-radius: 14px; padding: 20px 24px; margin-bottom: 20px;
  border: 1px solid transparent; transition: all 0.3s;
}
.narrative-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 8px;
}
.narrative p { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.narrative strong { color: var(--text); }

/* Narrative color variants */
.narrative.signal-hold { background: var(--green-soft); border-color: rgba(21, 128, 61, 0.15); }
.narrative.signal-hold .narrative-label { color: var(--green); }
.narrative.signal-watch { background: var(--amber-soft); border-color: rgba(180, 83, 9, 0.15); }
.narrative.signal-watch .narrative-label { color: var(--amber); }
.narrative.signal-exit { background: var(--accent-soft); border-color: rgba(232, 116, 12, 0.15); }
.narrative.signal-exit .narrative-label { color: var(--accent); }
.narrative.signal-close { background: var(--red-soft); border-color: rgba(185, 28, 28, 0.15); }
.narrative.signal-close .narrative-label { color: var(--red); }
.narrative.signal-caution { background: var(--amber-soft); border-color: rgba(180, 83, 9, 0.15); }
.narrative.signal-caution .narrative-label { color: var(--amber); }

/* Contextual callout inside profit targets */
.context-callout {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5; color: var(--text-secondary);
}
.context-callout strong { font-weight: 700; }
.callout-amber { background: var(--amber-soft); }
.callout-amber strong { color: var(--amber); }
.callout-orange { background: var(--accent-soft); }
.callout-orange strong { color: var(--accent); }

/* === CTA === */
.cta-card {
  background: var(--card); border: 2px solid var(--accent); border-radius: var(--radius);
  padding: 32px; text-align: center; margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(232, 116, 12, 0.08);
}
.cta-card h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px;
}
.cta-card p { font-size: 13px; color: var(--text-secondary); max-width: 420px; margin: 0 auto 20px; line-height: 1.55; }
.cta-buttons { display: flex; gap: 10px; justify-content: center; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: var(--accent); color: white; border: none;
  border-radius: 100px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.2s; text-decoration: none;
}
.cta-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(232, 116, 12, 0.25); }
.cta-btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 100px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all 0.2s; text-decoration: none;
}
.cta-btn-secondary:hover { background: var(--accent-softer); }
.cta-details { display: flex; justify-content: center; gap: 24px; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* === FOOTER === */
footer {
  padding: 32px 24px; text-align: center; font-size: 11px;
  color: var(--muted); line-height: 1.8;
  border-top: 1px solid var(--border); margin-top: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  nav { padding: 12px 16px; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .logo { width: 100%; justify-content: center; }
  .nav-right { width: 100%; justify-content: center; flex-wrap: wrap; }
  .page { padding: 0 16px; }
  .input-bar { flex-direction: column; }
  .input-group { min-width: 100%; }
  .hero-compact h1 { font-size: 24px; }
  .triptych { grid-template-columns: 1fr; gap: 10px; }
  .tri-card {
    display: grid; grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    text-align: left; padding: 16px; column-gap: 14px;
  }
  .tri-question { grid-column: 1 / -1; margin-bottom: 4px; }
  .tri-icon { grid-row: 2 / 4; align-self: center; font-size: 28px; }
  .tri-verdict { font-size: 16px; margin-bottom: 2px; }
  .tri-number { font-size: 18px; margin-bottom: 2px; }
  .tri-detail { grid-column: 2; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .big-number { font-size: 32px; }
  .big-number-secondary { font-size: 15px; }
  .monitor-table { font-size: 12px; }
  .cta-buttons { flex-direction: column; align-items: center; }
  .time-bar-label { width: 70px; font-size: 10px; }
}
