/* Booksnap App — Upload & Onboarding Styles */

/* ── Page Shell ───────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 24px 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fg);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
}

/* ── Card Layout ───────────────────────────────────────────────────────────── */
.app-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 600px;
  padding: 48px;
}

.app-card-wide {
  max-width: 900px;
}

.app-card h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}

.app-card p {
  color: var(--fg-muted);
  font-size: 1rem;
  margin-bottom: 32px;
}

.app-eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* ── Upload Form ───────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 24px;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(232, 145, 58, 0.04);
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(232, 145, 58, 0.08);
}

.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.upload-zone-text {
  font-size: 1rem;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 4px;
}

.upload-zone-hint {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.upload-form input[type="file"] {
  display: none;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}

.btn-primary:hover { background: var(--green-light); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s;
}

.btn-secondary:hover { border-color: var(--fg-muted); }

/* ── Bank Badges ───────────────────────────────────────────────────────────── */
.bank-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  justify-content: center;
}

.bank-badge {
  background: var(--bg-alt);
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

/* ── Transaction Review Table ─────────────────────────────────────────────── */
.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tx-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}

.tx-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(28,27,24,0.06);
  vertical-align: middle;
}

.tx-table tr:last-child td { border-bottom: none; }
.tx-amount-debit { color: #c0392b; }
.tx-amount-credit { color: var(--green); }

/* ── Onboarding Progress ───────────────────────────────────────────────────── */
.progress-bar-wrap {
  margin-bottom: 40px;
}

.progress-section-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-label.active {
  color: var(--accent);
  font-weight: 700;
}

.section-label.done {
  color: var(--green);
}

.progress-track {
  height: 4px;
  background: var(--bg-alt);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-align: right;
}

/* ── Interview Question ────────────────────────────────────────────────────── */
.question-section {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 28px;
  line-height: 1.3;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--fg);
  cursor: pointer;
}

.form-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-radio-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.form-radio-item:hover {
  border-color: var(--accent);
  background: rgba(232, 145, 58, 0.04);
}

.form-radio-item input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.form-radio-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
}

/* ── Interview Navigation ───────────────────────────────────────────────────── */
.interview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.question-counter {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ── Chart of Accounts ─────────────────────────────────────────────────────── */
.accounts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.9rem;
}

.account-code {
  font-weight: 700;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.account-name {
  flex: 1;
  color: var(--fg);
  font-weight: 500;
}

.account-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--fg-muted);
}

.account-type-badge.asset { background: #e8f4f0; color: var(--green); }
.account-type-badge.liability { background: #fef3e2; color: #b45309; }
.account-type-badge.equity { background: #ede9fe; color: #6d28d9; }
.account-type-badge.revenue { background: #dbeafe; color: #1d4ed8; }
.account-type-badge.expense { background: #fee2e2; color: #b91c1c; }

.cra-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--green);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Error States ──────────────────────────────────────────────────────────── */
.error-banner {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
  color: #b91c1c;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.success-banner {
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--green);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.info-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 12px 16px;
  color: #92400e;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

/* ── Demo Topbar (slim banner shown in later flow steps) ─────────────────── */
.demo-topbar {
  background: #fef9c3;
  border-bottom: 1px solid #fcd34d;
  padding: 6px 48px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-topbar-link {
  font-size: 0.75rem;
  color: #92400e;
  text-decoration: none;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid #fcd34d;
  border-radius: 5px;
  transition: background 0.2s;
}

.demo-topbar-link:hover { background: #fef3c7; }

@media (max-width: 768px) {
  .demo-topbar { padding: 6px 16px; }
}

/* ── Demo Mode UI ─────────────────────────────────────────────────────────── */
.demo-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 20px;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.demo-divider::before,
.demo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-demo:hover {
  border-color: var(--accent);
  background: rgba(232, 145, 58, 0.04);
}

.btn-demo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.demo-icon {
  font-size: 1.1rem;
}

.demo-banner {
  background: linear-gradient(135deg, #fffbeb, #fef9c3);
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 12px 16px;
  color: #92400e;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-reset-link {
  font-size: 0.82rem;
  color: #92400e;
  text-decoration: none;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  transition: background 0.2s;
}

.demo-reset-link:hover {
  background: #fef3c7;
}

/* ── Celebration Overlay ────────────────────────────────────────────────────── */
.celeb-stat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.4;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.celeb-stat-row:last-child { border-bottom: none; }

.celeb-check {
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Celebration Summary Card (polished overlay) ─────────────────────────── */
.celeb-summary-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  text-align: left;
  margin-bottom: 4px;
}

.celeb-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.celeb-summary-row:last-child { border-bottom: none; }

.celeb-summary-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

/* ── Finish Screen CTA (prominent inline lead capture) ─────────────────── */
.finish-cta-box {
  background: linear-gradient(135deg, #f0faf5 0%, #e8f5ee 100%);
  border: 1.5px solid #b6e2cf;
  border-radius: 18px;
  padding: 28px 32px;
  margin: 36px 0 0;
  text-align: center;
}

.finish-cta-badge {
  display: inline-block;
  background: #0B3D2E;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 14px;
}

.finish-cta-headline {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.2;
}

.finish-cta-body {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-bottom: 22px;
  line-height: 1.5;
}

.finish-cta-row {
  margin-bottom: 14px;
}

.finish-cta-sent {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--green);
  font-weight: 600;
  padding: 12px;
}

.finish-cta-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.finish-cta-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 6px;
}

.finish-trust-dot {
  color: #b6e2cf;
}

@media (max-width: 560px) {
  .finish-cta-box { padding: 24px 20px; }
  .finish-cta-form { flex-direction: column; }
  .finish-cta-form input,
  .finish-cta-form button { width: 100%; }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-header { padding: 16px 24px; }
  .app-main { padding: 32px 16px; }
  .app-card { padding: 32px 24px; }
  .accounts-grid { grid-template-columns: 1fr; }
}