:root {
  --primary: #17a673;
  --primary-dark: #128a5f;
  --primary-light: #e7f8f1;
  --accent: #2f6fed;
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --border: #e5e9ee;
  --text: #23303c;
  --text-muted: #6b7a89;
  --success: #17a673;
  --error: #e0473e;
  --warning: #b45309;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.brand strong { color: var(--primary); }
.brand-icon { font-size: 1.4rem; }

.topnav { display: flex; gap: 28px; }
.topnav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
}
.topnav a:hover { color: var(--primary); }

/* ---------- Layout with ad rails ---------- */
.page-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  gap: 24px;
  align-items: start;
}

.main-content { min-width: 0; }

.ad-slot {
  background: repeating-linear-gradient(45deg, #eef1f4, #eef1f4 10px, #e6eaee 10px, #e6eaee 20px);
  border: 1px dashed #c7d0d9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #97a3af;
  font-size: 0.8rem;
}

.ad-slot--top {
  max-width: 1400px;
  margin: 20px auto;
  width: calc(100% - 40px);
  min-height: 90px;
}

.ad-slot--side {
  position: sticky;
  top: 20px;
  min-height: 500px;
}

.ad-slot--inline {
  min-height: 100px;
  margin: 24px 0;
}

.ad-slot__label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .page-layout { grid-template-columns: 1fr; }
  .ad-slot--side { display: none; }
}

/* ---------- Hero / upload ---------- */
.hero {
  text-align: center;
  padding: 24px 0 12px;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0 0 14px;
  color: var(--text);
}

.hero-highlight { color: var(--primary); }

.hero-subtitle {
  max-width: 640px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.dropzone-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--card-bg);
  border: 3px dashed #c9e9dc;
  border-radius: var(--radius);
  padding: 44px 24px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon { font-size: 2.6rem; margin-bottom: 6px; }

.dropzone-cta {
  display: block;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.dropzone-hint {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropzone-filename {
  margin-top: 10px;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  word-break: break-all;
}

.options-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
}

.options-row select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.92rem;
  background: white;
}

.btn-convert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 999px;
  padding: 16px 36px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(23, 166, 115, 0.3);
  transition: transform 0.1s, box-shadow 0.15s;
}

.btn-convert:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(23, 166, 115, 0.38); }
.btn-convert:active { transform: translateY(0); }
.btn-arrow { transition: transform 0.15s; }
.btn-convert:hover .btn-arrow { transform: translateX(4px); }

.hero-note {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Trust row ---------- */
.trust-row {
  max-width: 900px;
  margin: 36px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

/* ---------- How it works ---------- */
.how-it-works { padding: 56px 0 20px; text-align: center; }
.how-it-works h2, .faq h2 {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 32px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  position: relative;
}

.step-number {
  position: absolute;
  top: 14px;
  right: 18px;
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--primary-light);
}

.step-icon { font-size: 2rem; margin-bottom: 8px; }
.step h3 { margin: 0 0 8px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 40px auto 0; padding-bottom: 20px; }

.faq details {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--primary); font-weight: 900; }
.faq details[open] summary::before { content: "– "; }

.faq p { color: var(--text-muted); margin: 10px 0 2px; font-size: 0.92rem; }

/* ---------- Flash messages ---------- */
.flash-list { margin-bottom: 20px; }

.flash {
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 600;
}

.flash-error { background: #fdecea; color: var(--error); }
.flash-success { background: #e7f8f1; color: var(--success); }

/* ---------- Info boxes ---------- */
.info-box {
  margin-top: 24px;
  padding: 16px 20px;
  background: #eef2ff;
  border-radius: 10px;
  font-size: 0.9rem;
}
.info-box ul { margin: 8px 0 0; padding-left: 20px; }
.warning-box { background: #fff7ed; color: var(--warning); }

/* ---------- Result page ---------- */
.result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 900px;
  margin: 0 auto;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.result-check { font-size: 2rem; }
.result-header h1 { margin: 0; font-size: 1.5rem; }

.summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
  background: #f8faf9;
  border-radius: 10px;
  padding: 18px 22px;
}
.summary dt { color: var(--text-muted); }
.summary dd { margin: 0; font-weight: 700; }

.download-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 28px 0; }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  font-size: 0.98rem;
  color: white;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  transition: transform 0.1s;
}
.btn-download:hover { transform: translateY(-1px); }
.btn-download--ofx { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.btn-download--csv { background: linear-gradient(135deg, var(--accent), #1c4fb8); }
.btn-download__icon { font-size: 0.9rem; }

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
  padding: 10px;
}
.btn-link:hover { color: var(--text); }

.table-wrapper { overflow-x: auto; margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 700; background: #f8faf9; }
tr:last-child td { border-bottom: none; }

.positive { color: var(--success); font-weight: 700; }
.negative { color: var(--error); font-weight: 700; }

/* ---------- Footer ---------- */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}
.footer-inner p { margin: 4px 0; font-size: 0.85rem; color: var(--text-muted); }
