/* ============================================================
   Bank Statement Converter — Global Stylesheet
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a202c;
  min-height: 100vh;
}

/* ── Header – Dark (all pages) ───────────────────────────── */
.header-dark {
  background: #1F4E79;
  color: #fff;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-dark h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: .3px; }
.header-dark a { color: #fff; text-decoration: none; }
.header-dark a:hover { opacity: .8; }

/* Logo + title grouped link */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand:hover { opacity: .85; }
.header-dark .header-nav a {
  color: rgba(255,255,255,.85);
  font-size: .88rem; font-weight: 500;
  padding: 6px 12px; border-radius: 6px; transition: background .15s;
  text-decoration: none;
}
.header-dark .header-nav a:hover { background: rgba(255,255,255,.15); color: #fff; opacity: 1; }
.header-dark .nav-user-btn {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
}
.header-dark .nav-user-btn:hover { background: rgba(255,255,255,.28); }
.header-dark .header-nav a.btn-nav {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
}
.header-dark .header-nav a.btn-nav:hover { background: rgba(255,255,255,.28); }

/* Login / Register nav buttons */
.header-dark .header-nav a.nav-btn-login {
  border: 1.5px solid rgba(255,255,255,.4);
}
.header-dark .header-nav a.nav-btn-login:hover { background: rgba(255,255,255,.1); opacity: 1; }
.header-dark .header-nav a.nav-btn-register {
  background: #fff;
  color: #1F4E79;
  font-weight: 700;
}
.header-dark .header-nav a.nav-btn-register:hover { background: rgba(255,255,255,.88); opacity: 1; }

/* ── Header Nav – Shared ──────────────────────────────────── */
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.nav-user-menu { position: relative; }
.nav-user-btn {
  font-size: .88rem; font-weight: 500;
  padding: 6px 14px; border-radius: 6px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: background .12s;
}
.nav-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  min-width: 200px; z-index: 100; overflow: hidden;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-email {
  padding: 12px 16px; font-size: .8rem; color: #6b7280;
  border-bottom: 1px solid #f3f4f6; word-break: break-all;
}
.nav-dropdown a, .nav-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 10px 16px; font-size: .88rem; color: #374151;
  text-decoration: none; background: none; border: none;
  cursor: pointer; transition: background .12s;
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: #f9fafb; }
.nav-dropdown button.signout { color: #ef4444; }

.pages-badge {
  font-size: .8rem; font-weight: 600;
  color: #fff; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  padding: 4px 10px; border-radius: 99px;
  white-space: nowrap;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner-inline {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth Pages (login, register, forgot, reset) ──────────── */
body.auth-page {
  background: #f0f4f8;
  display: flex;
  flex-direction: column;
}
.page-body {
  flex: 1; display: flex;
  align-items: center; justify-content: center;
  padding: 40px 20px;
}
.card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  padding: 40px 36px; width: 100%; max-width: 420px;
}
.card h2 {
  font-size: 1.4rem; font-weight: 700;
  color: #1F4E79; margin-bottom: 28px; text-align: center;
}
.card .subtitle {
  font-size: .9rem; color: #6b7280;
  text-align: center; margin-bottom: 28px; line-height: 1.5;
}
.form-group { margin-bottom: 18px; }
label {
  display: block; font-size: .85rem;
  font-weight: 600; color: #374151; margin-bottom: 6px;
}
.input-wrap { position: relative; }
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #d1d5db; border-radius: 8px;
  font-size: .95rem; color: #111827; background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
input:focus {
  border-color: #1F4E79;
  box-shadow: 0 0 0 3px rgba(31,78,121,.12);
}
input.input-error { border-color: #ef4444; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #6b7280; padding: 2px; display: flex; align-items: center;
}
.pw-toggle:hover { color: #1F4E79; }
.field-hint { font-size: .78rem; color: #ef4444; margin-top: 4px; display: none; }
.field-hint.visible { display: block; }
.forgot-link {
  display: block; text-align: right;
  font-size: .82rem; color: #1F4E79;
  text-decoration: none; margin-top: 6px;
}
.forgot-link:hover { text-decoration: underline; }
.btn {
  width: 100%; padding: 11px; border-radius: 8px;
  font-size: .95rem; font-weight: 600; border: none; cursor: pointer;
  transition: opacity .15s, transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:not(:disabled):hover { opacity: .88; }
.btn:not(:disabled):active { transform: scale(.98); }
.btn-primary { background: #1F4E79; color: #fff; margin-top: 4px; }
.btn-google {
  background: #fff; color: #374151;
  border: 1.5px solid #d1d5db; margin-top: 10px;
}
.btn-google:not(:disabled):hover { background: #f9fafb; opacity: 1; }
.divider {
  display: flex; align-items: center;
  gap: 12px; margin: 20px 0; color: #9ca3af; font-size: .85rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: #e5e7eb;
}
.alert {
  border-radius: 8px; padding: 10px 14px;
  font-size: .875rem; margin-bottom: 16px; display: none; line-height: 1.5;
}
.alert-error  { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.error-msg {
  display: none; background: #fef2f2;
  border: 1px solid #fca5a5; border-radius: 8px;
  padding: 10px 14px; color: #991b1b;
  font-size: .875rem; margin-bottom: 16px;
}
.footer-link { text-align: center; margin-top: 24px; font-size: .875rem; color: #6b7280; }
.footer-link a { color: #1F4E79; text-decoration: none; font-weight: 600; }
.footer-link a:hover { text-decoration: underline; }

/* ── Home Page ────────────────────────────────────────────── */
body.page-home { background: #f0f4f8; }

.hero { max-width: 900px; margin: 48px auto 0; padding: 0 24px; }
.hero h2 { font-size: 2rem; font-weight: 800; color: #111827; line-height: 1.2; margin-bottom: 10px; }
.hero p { font-size: 1rem; color: #4b5563; margin-bottom: 24px; }

.convert-box {
  background: #fff; border-radius: 12px;
  min-height: 220px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; position: relative; margin-bottom: 64px;
}
.convert-box input[type="file"] { display: none; }
.convert-box.dragover { border: 2px dashed #5c6ef5; background: #eef2ff; }

.cta-btn {
  background: #5c6ef5; color: #fff; border: none;
  border-radius: 8px; font-size: 1.1rem; font-weight: 600;
  padding: 16px 48px; cursor: pointer;
  transition: opacity .15s, transform .1s; letter-spacing: .2px;
}
.cta-btn:hover { opacity: .88; }
.cta-btn:active { transform: scale(.97); }

.file-selected-state {
  display: none; flex-direction: column; align-items: center; gap: 14px; width: 100%;
}
.file-pill {
  background: #dbeafe; color: #1e40af;
  padding: 6px 16px; border-radius: 99px; font-size: .9rem; font-weight: 500;
  max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.process-btn {
  background: #1F4E79; color: #fff; border: none;
  border-radius: 8px; font-size: 1rem; font-weight: 600;
  padding: 13px 40px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: opacity .15s, transform .1s;
}
.process-btn:hover { opacity: .88; }
.process-btn:active { transform: scale(.97); }
.process-btn:disabled { opacity: .5; cursor: not-allowed; }
.change-file-link { font-size: .82rem; color: #6b7280; cursor: pointer; text-decoration: underline; }
.change-file-link:hover { color: #374151; }
.drop-hint { font-size: .8rem; color: #9ca3af; margin-top: 10px; }

.spinner-wrap { display: none; flex-direction: column; align-items: center; gap: 14px; }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid #dbeafe; border-top-color: #5c6ef5;
  border-radius: 50%; animation: spin .8s linear infinite;
}
.spinner-wrap p { color: #4b5563; font-size: .9rem; }

.error-box {
  display: none; margin-top: 16px;
  background: #fef2f2; border: 1px solid #fca5a5;
  border-radius: 8px; padding: 12px 16px; color: #991b1b;
  font-size: .875rem; text-align: center; width: 100%; max-width: 500px;
}
.error-box a { color: #991b1b; font-weight: 700; }

.usage-bar-wrap { display: none; margin-top: 16px; width: 100%; max-width: 420px; }
.usage-bar-header { display: flex; justify-content: space-between; font-size: .78rem; color: #6b7280; margin-bottom: 4px; }
.usage-bar-header a { color: #1F4E79; font-weight: 600; text-decoration: none; }
.usage-bar-header a:hover { text-decoration: underline; }
.usage-track { height: 5px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.usage-fill { height: 100%; background: #5c6ef5; border-radius: 99px; transition: width .4s; }
.usage-fill.warn { background: #f59e0b; }
.usage-fill.danger { background: #ef4444; }

.features {
  max-width: 900px; margin: 0 auto 64px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center;
}
.feature-icon { font-size: 2.8rem; margin-bottom: 12px; }
.feature h3 { font-size: 1rem; font-weight: 700; color: #111827; margin-bottom: 8px; }
.feature p { font-size: .875rem; color: #4b5563; line-height: 1.6; }

.tiers {
  max-width: 900px; margin: 0 auto 64px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.tier-card {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s;
}
.tier-card:hover { border: 2px solid #3b82f6; }
.tier-card.highlight:hover { border: 2px solid #3b82f6; }
.tier-card h3 { font-size: 1rem; font-weight: 700; color: #111827; }
.tier-card .tier-desc { font-size: .875rem; color: #4b5563; line-height: 1.5; }
.tier-card .tier-feature { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: #374151; }
.tier-card .tier-feature::before { content: "✓"; color: #10b981; font-weight: 700; flex-shrink: 0; }
.tier-card .tier-price { font-size: 1.5rem; font-weight: 800; color: #111827; margin-top: auto; }
.tier-card .tier-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tier-link { color: #3b82f6; font-size: .875rem; font-weight: 500; text-decoration: none; }
.tier-link:hover { text-decoration: underline; }

.results-section {
  display: none;
  max-width: 1100px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.need-more { background: #e8eef7; padding: 40px 24px; }
.need-more-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.need-more h3 { font-size: 1.2rem; font-weight: 700; color: #111827; margin-bottom: 8px; }
.need-more p { font-size: .9rem; color: #374151; max-width: 600px; line-height: 1.6; }
.contact-btn {
  background: #1F4E79; color: #fff; border: none;
  border-radius: 8px; font-size: .95rem; font-weight: 600;
  padding: 12px 28px; cursor: pointer; white-space: nowrap;
  text-decoration: none; display: inline-block; transition: opacity .15s;
}
.contact-btn:hover { opacity: .88; }

/* ── Results Page ─────────────────────────────────────────── */
body.page-results { background: #f0f4f8; }

.results-main { max-width: 1100px; margin: 32px auto 60px; padding: 0 24px; }
.page-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title-row h2 { font-size: 1.4rem; font-weight: 700; color: #111827; }

.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.info-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 18px; }
.info-card .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: #6b7280; margin-bottom: 4px; }
.info-card .value { font-size: 1rem; font-weight: 600; color: #111827; }

.table-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; gap: 12px;
}
.table-toolbar h3 { font-size: 1rem; font-weight: 600; color: #1F4E79; }
.export-btns { display: flex; gap: 10px; }

.btn-export {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 22px; border-radius: 7px;
  font-size: .875rem; font-weight: 600;
  border: none; cursor: pointer; transition: opacity .15s, transform .1s;
}
.btn-export:hover { opacity: .88; }
.btn-export:active { transform: scale(.97); }
.btn-excel { background: #166534; color: #fff; }
.btn-csv   { background: #854d0e; color: #fff; }
.btn-new   { background: #1F4E79; color: #fff; }

.table-wrap { overflow-x: auto; max-height: 600px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: #1F4E79; color: #fff;
  padding: 10px 14px; text-align: left;
  font-weight: 600; position: sticky; top: 0; white-space: nowrap;
}
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #eff6ff; }
td {
  padding: 8px 14px; border-bottom: 1px solid #e5e7eb;
  vertical-align: top; text-align: left; word-break: break-word;
}
td.debit  { color: #991b1b; font-weight: 500; }
td.credit { color: #166534; font-weight: 500; }
td.date   { white-space: nowrap; }
td.desc   { max-width: 340px; }
td.num    { font-variant-numeric: tabular-nums; }
.totals-row td { font-weight: 700; background: #f1f5f9 !important; border-top: 2px solid #cbd5e1; }
.totals-row .debit  { color: #991b1b; }
.totals-row .credit { color: #166534; }
.meta-note { font-size: .78rem; color: #9ca3af; padding: 10px 20px; border-top: 1px solid #e5e7eb; }

.no-data { text-align: center; padding: 60px 24px; color: #6b7280; font-size: .95rem; }
.no-data a { color: #1F4E79; font-weight: 600; }

/* ── Pricing Page ─────────────────────────────────────────── */
body.page-pricing { background: #f0f4f8; display: flex; flex-direction: column; }

.pricing-main { max-width: 1060px; margin: 0 auto; padding: 48px 20px 80px; }
.page-title { text-align: center; margin-bottom: 40px; }
.page-title h2 { font-size: 2rem; font-weight: 800; color: #1F4E79; margin-bottom: 10px; }
.page-title p { font-size: 1.05rem; color: #4b5563; }

.success-banner {
  display: none; background: #f0fdf4; border: 1px solid #86efac;
  border-radius: 10px; padding: 14px 20px; color: #166534;
  font-size: .95rem; font-weight: 500; text-align: center; margin-bottom: 32px;
}
.error-toast {
  display: none; background: #fef2f2; border: 1px solid #fca5a5;
  border-radius: 10px; padding: 12px 18px; color: #991b1b;
  font-size: .875rem; text-align: center; margin-bottom: 24px;
}

.toggle-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 40px; }
.toggle-label { font-size: .95rem; font-weight: 600; color: #374151; cursor: pointer; user-select: none; }
.toggle-label.active { color: #1F4E79; }
.toggle-pill {
  position: relative; width: 52px; height: 28px;
  background: #1F4E79; border-radius: 99px;
  cursor: pointer; transition: background .2s; border: none; outline: none;
}
.toggle-pill::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; background: #fff;
  border-radius: 50%; transition: transform .2s;
}
.toggle-pill.annual::after { transform: translateX(24px); }
.save-badge {
  background: #dcfce7; color: #166534;
  font-size: .75rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
}

.free-tier-row { display: flex; gap: 16px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.free-tier-card {
  background: #fff; border: 1.5px solid #e5e7eb;
  border-radius: 12px; padding: 18px 28px; text-align: center; min-width: 200px;
}
.free-tier-card .ft-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .8px; color: #6b7280; font-weight: 600; margin-bottom: 6px; }
.free-tier-card .ft-allowance { font-size: 1.1rem; font-weight: 700; color: #1F4E79; margin-bottom: 4px; }
.free-tier-card .ft-price { font-size: .9rem; color: #059669; font-weight: 600; }
.free-tier-card .ft-link { font-size: .82rem; color: #1F4E79; text-decoration: none; margin-top: 6px; display: inline-block; }
.free-tier-card .ft-link:hover { text-decoration: underline; }

.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 48px; }
.plan-card {
  background: #fff; border: 2px solid #e5e7eb; border-radius: 16px; padding: 32px 28px;
  position: relative; transition: box-shadow .2s, border-color .2s, transform .15s;
}
.plan-card:hover { box-shadow: 0 8px 32px rgba(31,78,121,.12); transform: translateY(-2px); }
.plan-card.featured { border-color: #1F4E79; box-shadow: 0 4px 24px rgba(31,78,121,.15); }
.plan-card.featured:hover { box-shadow: 0 10px 40px rgba(31,78,121,.22); }
.popular-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: #1F4E79; color: #fff; font-size: .75rem; font-weight: 700;
  padding: 4px 14px; border-radius: 99px; letter-spacing: .5px; white-space: nowrap;
}
.plan-name { font-size: 1.1rem; font-weight: 700; color: #1F4E79; margin-bottom: 6px; }
.plan-price-wrap { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.plan-price { font-size: 2.4rem; font-weight: 800; color: #111827; line-height: 1; }
.plan-price-period { font-size: .9rem; color: #6b7280; }
.plan-pages { font-size: .88rem; color: #4b5563; margin-bottom: 24px; }
.plan-pages strong { color: #1F4E79; }
.plan-features { list-style: none; margin-bottom: 28px; }
.plan-features li { display: flex; align-items: flex-start; gap: 9px; font-size: .875rem; color: #374151; padding: 5px 0; border-bottom: 1px solid #f3f4f6; }
.plan-features li:last-child { border-bottom: none; }
.plan-features li .check { flex-shrink: 0; width: 18px; height: 18px; background: #dcfce7; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.plan-features li .check svg { color: #16a34a; }
.btn-plan {
  width: 100%; padding: 12px; border-radius: 9px;
  font-size: .95rem; font-weight: 700; border: none; cursor: pointer;
  transition: opacity .15s, transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-plan:disabled { opacity: .55; cursor: not-allowed; }
.btn-plan:not(:disabled):hover { opacity: .88; }
.btn-plan:not(:disabled):active { transform: scale(.98); }
.btn-plan-primary { background: #fff;
    color: #1F4E79;
    border: 2px solid #1F4E79; }
.btn-plan-outline { background: #fff; color: #1F4E79; border: 2px solid #1F4E79; }
.btn-plan-outline:not(:disabled):hover { background: #f0f4f8; opacity: 1; }

.manage-section { text-align: center; margin-top: 8px; }
.manage-section p { font-size: .9rem; color: #6b7280; }
.manage-section a, .manage-section button.link-btn {
  color: #1F4E79; font-weight: 600; text-decoration: none;
  background: none; border: none; cursor: pointer; font-size: .9rem; padding: 0;
}
.manage-section a:hover, .manage-section button.link-btn:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .header-dark { padding: 14px 16px; }
  .hero h2 { font-size: 1.4rem; }
  .features { grid-template-columns: 1fr; gap: 28px; }
  .tiers { grid-template-columns: 1fr; }
  .need-more-inner { flex-direction: column; }
  .pages-badge { display: none; }
  .page-title h2 { font-size: 1.5rem; }
  .plans-grid { grid-template-columns: 1fr; }
}
