/* TreasurySnap — app.css */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --accent: #1d4ed8;
  --success: #059669;
  --success-bg: #d1fae5;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --warning: #d97706;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --radius: 12px;
}

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

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

#app { min-height: 100vh; }

/* ── Screens ─────────────────────────────────────── */

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

.screen-inner {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

/* Hero */
#screen-hero {
  display: flex;
  background: linear-gradient(160deg, #1e3a5f 0%, #1d4ed8 60%);
  color: white;
  align-items: center;
}
#screen-hero.active { display: flex; }
.hero-inner { padding: 48px 32px; flex: 1; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.9);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
#screen-hero h1 {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}
#screen-hero h1 .accent { color: #93c5fd; }
.hero-sub { color: rgba(255,255,255,.75); font-size: 16px; line-height: 1.6; margin-bottom: 32px; }
.hero-note { color: rgba(255,255,255,.5); font-size: 12px; margin-top: 16px; }
.hero-pricing-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.5);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.hero-pricing-link:hover { color: rgba(255,255,255,.85); }

.hero-visual {
  display: none;
  position: relative;
  padding: 40px 32px 40px 0;
  align-items: center;
}
@media (min-width: 700px) {
  .hero-visual { display: flex; }
  #screen-hero { flex-direction: row; }
}

.check-card {
  background: white;
  border-radius: 8px;
  padding: 24px;
  width: 260px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  color: #1a1a1a;
}
.check-mock-logo { font-weight: 700; font-size: 11px; color: #1d4ed8; margin-bottom: 4px; }
.check-mock-date { font-size: 11px; color: #64748b; text-align: right; }
.check-mock-pay { font-size: 11px; color: #94a3b8; margin: 16px 0 4px; }
.check-mock-amount { font-size: 22px; font-weight: 700; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 8px; }
.check-mock-line { font-size: 11px; color: #64748b; margin-bottom: 4px; }
.check-mock-route { font-size: 10px; color: #94a3b8; }

.check-scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: rgba(96,165,250,.5);
  box-shadow: 0 0 20px 4px rgba(96,165,250,.3);
  animation: scan 2.5s ease-in-out infinite;
}
@keyframes scan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Step label */
.step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 10px;
}

.screen-inner h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.screen-sub { color: var(--text-2); font-size: 15px; line-height: 1.5; margin-bottom: 28px; }
.screen-note { color: var(--text-2); font-size: 12px; margin-top: 16px; text-align: center; }

/* ── Forms ─────────────────────────────────────── */

form { display: flex; flex-direction: column; gap: 12px; }

input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
  -webkit-appearance: none;
}
input:focus { outline: none; border-color: var(--primary); }
input::placeholder { color: #94a3b8; }
input[type="number"] { font-size: 20px; font-weight: 700; letter-spacing: .02em; }

.form-row { display: flex; gap: 10px; }
.form-row input { flex: 1; }

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
}
.detail-row label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.detail-row input { padding: 0; border: none; background: transparent; font-size: 18px; font-weight: 600; }
.detail-row input:focus { outline: none; }
.detail-amount input { font-size: 28px; color: var(--success); }

.check-images-preview {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.img-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
}
.img-check { font-size: 14px; }

/* ── Buttons ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
  gap: 8px;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary { background: var(--surface); color: var(--primary); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: #f1f5f9; }

.btn-lg { padding: 18px 40px; font-size: 18px; border-radius: 14px; }
.btn-full { width: 100%; }

/* ── Capture ─────────────────────────────────────── */

.capture-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }

.capture-slot {
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px dashed var(--border);
  transition: border-color .2s;
}
.capture-slot.has-image { border-style: solid; border-color: var(--success); }

.capture-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.capture-placeholder:hover { background: #f8fafc; color: var(--primary); }
.capture-placeholder svg { opacity: .5; }

.capture-slot img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 180px;
}

.capture-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 20px;
}
.capture-hint svg { flex-shrink: 0; color: #0284c7; }

/* ── Loading overlay ─────────────────────────────── */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.loading-box {
  background: white;
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: var(--shadow);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-text { font-size: 16px; font-weight: 600; color: var(--text); }

/* ── Result screens ─────────────────────────────── */

.screen-result {
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.result-inner { text-align: center; max-width: 400px; }
.result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.result-icon--success { background: var(--success-bg); color: var(--success); }
.result-icon--error { background: var(--error-bg); color: var(--error); }
.result-title { font-size: 28px; font-weight: 800; margin-bottom: 16px; }
.result-amount { font-size: 48px; font-weight: 800; color: var(--success); margin-bottom: 12px; }
.result-sub { color: var(--text-2); font-size: 15px; line-height: 1.6; margin-bottom: 8px; }
.result-ref { font-size: 12px; color: var(--text-2); font-family: monospace; margin-top: 4px; }

/* ── Progress bar ────────────────────────────────── */

.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #e2e8f0;
  z-index: 100;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width .4s ease;
}

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  margin-bottom: 8px;
}
.back-btn:hover { color: var(--text); }