/* Exnaton Bill Explainer — brand palette, Figtree only */
:root {
  --blue:       #172A3A;
  --teal:       #2BB3A0;
  --teal-dark:  #0D9E8A;
  --pink:       #EC5BC4;
  --orange:     #FFA800;
  --white:      #FFFFFF;
  --bg:         #FFFFFF;
  --bg-subtle:  #F0F5F4;
  --bg-card:    #F8FDFC;
  --light-gray: #F5F5F5;
  --border:     #E5E7EB;
  --mid-gray:   #9E9E9E;
  --text-muted: #6B7280;
  --loader-bg:  #E6F5F2;
}

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

body {
  font-family: 'Figtree', sans-serif;
  font-weight: 400;
  color: var(--blue);
  background: var(--bg);
  line-height: 1.5;
}

h1, h2, h3, .btn-primary, .label { font-weight: 600; }

/* ─── Topbar / Nav ───────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.brand-logo {
  display: flex; align-items: center; flex-shrink: 0; text-decoration: none;
}
.brand-logo:hover { opacity: 0.85; }

.topbar-nav {
  display: flex; gap: 28px; align-items: center;
}
.topbar-nav a {
  font-size: 0.9rem; font-weight: 400; color: var(--blue);
  text-decoration: none; opacity: 0.75; transition: opacity 0.15s;
  white-space: nowrap;
}
.topbar-nav a:hover { opacity: 1; }

.btn-contact {
  font-family: 'Figtree', sans-serif;
  font-size: 0.88rem; font-weight: 600;
  background: var(--blue); color: var(--white);
  border: none; border-radius: 6px;
  padding: 9px 20px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.btn-contact:hover { opacity: 0.88; }

@media (max-width: 720px) {
  .topbar-nav { display: none; }
}

/* ─── Buttons ────────────────────────────────────────── */
.btn-primary {
  font-family: 'Figtree', sans-serif;
  font-weight: 600;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 12px 28px;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: default; }

.btn-ghost {
  font-family: 'Figtree', sans-serif;
  font-weight: 600;
  background: none;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  border-radius: 6px;
  padding: 10px 24px;
  margin-top: 32px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(23,42,58,0.06); }

.btn-send {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--blue); color: var(--white);
  border: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-send:hover { opacity: 0.88; }

/* ─── Decorative bg circles ──────────────────────────── */
#upload-view { position: relative; overflow: hidden; }

.bg-circle {
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110,203,190,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.bg-circle-left  { left: -180px; top: 60px; }
.bg-circle-right { right: -180px; bottom: 60px; }

/* ─── Hero heading (centered, above the two columns) ──── */
.hero-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 52px 24px 40px;
  position: relative;
}
.hero-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--blue);
  margin-bottom: 14px;
}
.hero-heading .subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Upload hero (two columns: bill | upload) ───────── */
.upload-hero {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  position: relative;
}
@media (max-width: 820px) {
  .upload-hero { grid-template-columns: 1fr; gap: 40px; padding: 0 20px 60px; }
}

/* ─── Bill preview wrap ──────────────────────────────── */
.preview-col { display: flex; justify-content: center; }

.bill-preview-wrap {
  position: relative;
  width: 300px;
  height: 400px;
  flex-shrink: 0;
}

/* ─── Realistic sample bill ──────────────────────────── */
.bill-sample {
  position: absolute;
  inset: 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 3.9px 1px rgba(0,0,0,0.05), 0 4px 14.7px 4.9px rgba(0,0,0,0.10);
  overflow: hidden;
  font-size: 8px;
}

.bs-header-bar {
  background: var(--blue);
  padding: 10px 14px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.bs-brand {
  display: flex; align-items: center; gap: 4px;
}
.bs-company-name {
  font-size: 10px; font-weight: 600; color: var(--white); letter-spacing: -0.3px;
}
.bs-company-sub {
  font-size: 7px; font-weight: 400; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.7px; margin-left: 16px;
}

.bs-addr-bar {
  background: var(--teal);
  padding: 4px 14px;
  font-size: 7px; font-weight: 500; color: var(--white);
  letter-spacing: 0.1px;
}

.bs-body {
  padding: 12px 14px 10px;
}

.bs-two-col {
  display: flex; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.bs-col { display: flex; flex-direction: column; gap: 2px; }
.bs-col-right { align-items: flex-end; }

.bs-label {
  font-size: 6px; font-weight: 500; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.bs-value {
  font-size: 8px; font-weight: 600; color: var(--blue);
}
.bs-small {
  font-size: 7px; color: #4A5568;
}

.bs-divider { height: 1px; background: var(--border); margin: 7px 0; }

.bs-items { display: flex; flex-direction: column; gap: 5px; }
.bs-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.bs-item-name { font-size: 7px; color: var(--blue); }
.bs-item-amt  { font-size: 7px; font-weight: 600; color: var(--blue); white-space: nowrap; }

.bs-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 2px;
}
.bs-total-label {
  font-size: 8px; font-weight: 600; color: var(--blue);
}
.bs-total-val {
  font-size: 10px; font-weight: 600; color: var(--blue);
}

/* Actual upload preview (replaces sample) */
.upload-preview {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 3.9px 1px rgba(0,0,0,0.05), 0 4px 14.7px 4.9px rgba(0,0,0,0.10);
  background: var(--white);
}
.upload-preview canvas {
  width: 100% !important;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── Feature bubbles ────────────────────────────────── */
.preview-bubble {
  position: absolute;
  background: rgba(240,240,240,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 9px 14px 9px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(23,42,58,0.10);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  cursor: default;
  color: var(--blue);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
  animation: bubbleFloat 3.5s ease-in-out infinite;
  will-change: transform;
}
.preview-bubble:hover {
  transform: scale(1.08) translateY(-4px) !important;
  box-shadow: 0 10px 28px rgba(23,42,58,0.15);
  animation-play-state: paused;
}
.preview-bubble svg { flex-shrink: 0; }

.b1 { top: -14px; right: -18px; animation-delay: 0s; }
.b2 { top: 42%; right: -26px; animation-delay: 0.9s; }
.b3 { bottom: 14%; left: -22px; animation-delay: 1.7s; }

@keyframes bubbleFloat {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-7px); }
}

/* ─── Gradient text (used in hero heading) ───────────── */
.gradient-text {
  background-image:
    linear-gradient(12.0565deg, rgba(167, 24, 115, 0.68) 8.737%, rgba(10, 197, 179, 0.4) 48.396%, rgb(23, 42, 58) 81.222%),
    linear-gradient(90deg, rgb(23, 42, 58) 0%, rgb(23, 42, 58) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ─── Upload column (right side of hero) ─────────────── */
.upload-col {
  padding-top: 8px;
}

.dropzone {
  background: var(--white);
  border: 2px dashed var(--teal);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.dragover { background: var(--bg-subtle); border-color: var(--blue); }
.dz-icon { width: 36px; height: 36px; color: var(--teal); margin-bottom: 12px; }
.dz-text { margin-bottom: 14px; font-size: 0.92rem; color: var(--text-muted); }
.dz-hint { margin-top: 10px; font-size: 0.78rem; color: var(--mid-gray); }

.privacy-note { margin-top: 14px; font-size: 0.8rem; color: var(--mid-gray); max-width: 420px; }

.error-banner {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-top: 16px; font-size: 0.9rem;
}

/* ─── Wattson thinking indicator (inside chat log) ───── */
.chat-thinking-msg .thinking-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

#monster-svg {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: block;
}

.thinking-text {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Result layout ──────────────────────────────────── */
.result-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .result-layout { grid-template-columns: 1fr; }
}

.result-main {}

/* Bill link bar */
.bill-link-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border-radius: 10px; border: 1px solid var(--border);
  padding: 10px 16px; font-size: 0.85rem; margin-bottom: 16px;
}
.bill-link-bar a {
  color: var(--teal); text-decoration: none; font-weight: 600; word-break: break-all;
}
.bill-link-bar a:hover { text-decoration: underline; }

/* Bill page preview */
.bill-page-preview {
  margin-bottom: 20px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(23,42,58,0.10);
  max-height: 520px;
}
.bill-page-preview canvas,
.bill-page-preview img { width: 100%; display: block; }
.bill-page-preview img { max-height: 520px; object-fit: contain; }

/* Masking note */
.masking-note {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px; font-size: 0.85rem; margin-bottom: 16px;
}

/* ─── Verdict card ───────────────────────────────────── */
.verdict-card {
  background: var(--white); border-radius: 16px; padding: 28px; margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(23,42,58,0.08); border: 1px solid var(--border);
}
.verdict-card p { font-size: 1.15rem; font-weight: 600; margin: 10px 0 16px; }

.ai-tag {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--mid-gray); border: 1px solid var(--mid-gray); border-radius: 999px; padding: 2px 10px;
}

.summary-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { background: var(--bg-subtle); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; }
.chip strong { font-weight: 600; }
.chip.amount-credit      { background: var(--teal);   color: var(--white); }
.chip.amount-back_payment { background: var(--orange); color: var(--blue); }

/* ─── Flags ──────────────────────────────────────────── */
.flags { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.flag {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-size: 0.92rem; display: flex; gap: 10px; align-items: flex-start;
}
.flag .flag-icon { color: var(--orange); font-weight: 600; }

/* ─── Analysis grid ──────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.section-title { font-size: 1rem; font-weight: 600; margin: 20px 0 12px; color: var(--blue); }

/* Chart */
.chart-wrap {
  display: flex; align-items: center; gap: 18px;
  background: var(--white); border-radius: 16px; padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--border);
}
.chart-legend { font-size: 0.78rem; display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }

/* Components */
.component-card { background: var(--white); border-radius: 14px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--border); }
.component-head {
  width: 100%; border: none; background: none; font-family: 'Figtree', sans-serif;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; font-size: 0.95rem; color: var(--blue); text-align: left;
}
.component-head .comp-label { font-weight: 600; }
.component-head .comp-amount { white-space: nowrap; }
.component-body { padding: 0 16px 14px; font-size: 0.88rem; display: none; }
.component-card.open .component-body { display: block; }
.share-bar { height: 6px; background: var(--bg-subtle); border-radius: 999px; margin: 0 16px 12px; overflow: hidden; }
.share-bar > span { display: block; height: 100%; border-radius: 999px; }
.influence { font-size: 0.78rem; margin-top: 8px; color: var(--mid-gray); }
.influence.yes { color: var(--teal); }

/* Drivers */
.drivers { list-style: none; }
.drivers li { background: var(--white); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; font-size: 0.9rem; border: 1px solid var(--border); }
.drivers .driver-label { font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.severity-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.severity-dot.major { background: var(--pink); }
.severity-dot.minor { background: var(--mid-gray); }

/* Suggestions */
.suggestion-card {
  background: var(--white); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}
.suggestion-card h3 { font-size: 0.98rem; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.effort-tag { font-size: 0.65rem; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.effort-low    { background: var(--teal);   color: var(--white); }
.effort-medium { background: var(--bg-subtle); color: var(--blue); }
.effort-high   { background: var(--blue);   color: var(--white); }

.disclaimer { color: var(--mid-gray); font-size: 0.8rem; margin: 28px 0; }

/* ─── Chat sidebar (Wattson) ─────────────────────────── */
.chat-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.chat-card {
  background: #F9FAFB;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 400px;
}

/* Wattson header */
.chat-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 4px; flex-shrink: 0;
}
.wattson-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-header-text { display: flex; flex-direction: column; gap: 1px; }
.chat-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue);
  line-height: 1.2;
}
.chat-subtitle {
  font-size: 0.72rem; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.02em;
}
.chat-tagline {
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 14px; flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chat-log {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px; flex: 1; overflow-y: auto;
  max-height: calc(100vh - 300px);
  min-height: 80px;
}
.chat-msg {
  max-width: 92%; padding: 10px 14px; border-radius: 12px;
  font-size: 0.88rem; white-space: pre-wrap; line-height: 1.45;
}
.chat-msg.user     { align-self: flex-end;  background: var(--blue); color: var(--white); border-bottom-right-radius: 4px; }
.chat-msg.assistant{ align-self: flex-start; background: var(--white); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg.assistant .msg-text p { margin: 0 0 6px; }
.chat-msg.assistant .msg-text p:last-child { margin-bottom: 0; }
.chat-msg.assistant .msg-text ul,
.chat-msg.assistant .msg-text ol { padding-left: 18px; margin: 4px 0 6px; }
.chat-msg.assistant .msg-text li { margin-bottom: 2px; }
.chat-msg.assistant .msg-text strong { font-weight: 600; }
.chat-msg.assistant .msg-text a { color: var(--teal); }
.chat-msg.assistant .ai-mini {
  display: block; font-size: 0.6rem; color: var(--mid-gray);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em;
}
.chat-form { display: flex; gap: 8px; flex-shrink: 0; }
.chat-form input {
  flex: 1; font-family: 'Figtree', sans-serif; font-size: 0.88rem;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 14px; color: var(--blue); background: var(--white);
}
.chat-form input:focus { outline: none; border-color: var(--teal); }

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--blue);
  color: rgba(255,255,255,0.75);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 48px 24px 24px;
}

/* Three-column top row: brand-col | spacer | links-area */
.footer-top {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  margin-bottom: 40px;
  align-items: start;
}
@media (max-width: 720px) {
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
}

/* Left brand column */
.footer-brand-col {
  display: flex; flex-direction: column; gap: 16px;
}
.footer-logo { display: block; flex-shrink: 0; }

.footer-tagline {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.55);
  max-width: 280px;
}

/* Newsletter */
.footer-newsletter-label {
  font-size: 0.82rem; font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
}
.footer-newsletter-form {
  display: flex; gap: 0;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  overflow: hidden;
  max-width: 260px;
}
.footer-newsletter-form input {
  flex: 1; min-width: 0;
  background: transparent;
  border: none; outline: none;
  font-family: 'Figtree', sans-serif;
  font-size: 0.82rem; font-weight: 400;
  color: var(--white);
  padding: 9px 12px;
}
.footer-newsletter-form input::placeholder { color: rgba(255,255,255,0.35); }
.footer-newsletter-form button {
  background: var(--teal); border: none; cursor: pointer;
  padding: 0 12px; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s; flex-shrink: 0;
}
.footer-newsletter-form button:hover { opacity: 0.85; }

/* LinkedIn */
.footer-linkedin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.footer-linkedin:hover { color: var(--white); border-color: rgba(255,255,255,0.5); }

/* Right links area: two columns */
.footer-links-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  padding-top: 4px;
}
@media (max-width: 480px) {
  .footer-links-area { grid-template-columns: 1fr; }
}

.footer-link-col {
  display: flex; flex-direction: column; gap: 10px;
}
.footer-link-col a {
  font-size: 0.82rem; font-weight: 400;
  color: rgba(255,255,255,0.65);
  text-decoration: none; transition: color 0.15s;
}
.footer-link-col a:hover { color: var(--white); }

/* Bottom bar */
.footer-divider { height: 1px; background: rgba(255,255,255,0.12); margin-bottom: 16px; }
.footer-bottom {
  display: flex; justify-content: flex-end;
  font-size: 0.78rem; font-weight: 400;
  color: rgba(255,255,255,0.35);
}

/* ─── Progressive reveal ─────────────────────────────── */
.reveal { opacity: 0; transform: translateY(8px); animation: revealAnim 0.45s ease forwards; }
@keyframes revealAnim { to { opacity: 1; transform: none; } }
