:root {
  --navy: #071a33;
  --navy-2: #102b50;
  --blue: #135eea;
  --cyan: #60d7ff;
  --ink: #122033;
  --muted: #637083;
  --line: #dce3ed;
  --soft: #f3f6fa;
  --white: #fff;
  --green: #087f5b;
  --brand-peach: #d59a77;
  --header-height: 96px;
  --header-height-scrolled: 72px;
  --logo-height: 50px;
  --red: #b42318;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: linear-gradient(180deg, #eaf2ff 0, #f7f9fc 340px, #f7f9fc 100%); min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { position: sticky; top: 0; z-index: 1000; height: var(--header-height); padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: rgba(7,26,51,.97); color: white; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(14px); transition: height .35s ease, box-shadow .35s ease, background .35s ease; }
.topbar.is-scrolled { height: var(--header-height-scrolled); background: rgba(7,26,51,.985); box-shadow: 0 14px 40px rgba(7,26,51,.2); }
.brand-logo { position: relative; display: block; width: 214px; height: var(--logo-height); overflow: hidden; flex: 0 0 auto; transition: width .35s ease; }
.topbar.is-scrolled .brand-logo { width: var(--logo-height); }
.brand-logo img { position: absolute; left: 0; top: 50%; display: block; height: var(--logo-height); width: auto; transform: translateY(-50%); pointer-events: none; user-select: none; transition: opacity .35s ease, transform .35s ease; }
.brand-logo-full { opacity: 1; }
.brand-logo-icon { opacity: 0; transform: translateY(-50%) scale(.84) !important; }
.topbar.is-scrolled .brand-logo-full { opacity: 0; transform: translateY(-50%) scale(.92); }
.topbar.is-scrolled .brand-logo-icon { opacity: 1; transform: translateY(-50%) scale(1) !important; }
.contact-button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 0 21px; border-radius: 999px; background: linear-gradient(135deg, #dfa684, #c7835f); color: var(--navy); text-decoration: none; font-weight: 800; box-shadow: 0 9px 24px rgba(213,154,119,.2); transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.contact-button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 12px 28px rgba(213,154,119,.3); }
.contact-button:focus-visible { outline: 3px solid rgba(255,255,255,.72); outline-offset: 3px; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 36px; }
.intro { max-width: 720px; margin-bottom: 28px; }
.eyebrow, .label { display: block; margin: 0 0 7px; color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0 0 12px; color: var(--navy); font-size: clamp(34px, 5vw, 56px); line-height: 1.02; letter-spacing: -.045em; }
.intro > p:last-child { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }

.card { background: rgba(255,255,255,.97); border: 1px solid rgba(197,208,223,.85); border-radius: 22px; box-shadow: 0 18px 50px rgba(27,55,91,.08); }
.upload-card { padding: 10px; }
.drop-zone { width: 100%; min-height: 245px; border: 2px dashed #9eb8df; border-radius: 16px; background: #f9fbff; color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: pointer; user-select: none; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging, .drop-zone:focus-visible { border-color: var(--blue); background: #eff5ff; outline: none; transform: translateY(-1px); }
.drop-zone strong { font-size: 20px; }
.drop-zone > span:not(.upload-icon) { color: var(--muted); }
.drop-zone small { margin-top: 10px; color: var(--green); font-weight: 650; }
.select-button { margin-top: 7px; padding: 10px 17px; border-radius: 10px; background: var(--blue); color: white !important; font-weight: 750; box-shadow: 0 6px 16px rgba(19,94,234,.2); }
.drop-zone:hover .select-button { background: #0c50ce; }
.upload-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 6px; color: white; background: var(--blue); font-size: 29px; font-weight: 300; }
.processing { min-height: 245px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.processing div { display: flex; flex-direction: column; gap: 5px; }
.processing span { color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #dce6f5; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.message { padding: 16px 18px; margin-top: 16px; border-radius: 12px; line-height: 1.5; }
.error { color: #7a271a; background: #fff1ef; border: 1px solid #f8b4aa; }
.summary-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.summary-card { min-height: 250px; padding: 28px; display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 24px; }
.summary-card strong { font-size: 22px; color: var(--navy); }
.check-status { grid-column: 1 / -1; align-self: end; margin-top: 34px; border-radius: 14px; padding: 15px 17px; font-weight: 720; }
.check-status.ok { color: #075e45; background: #e8fbf3; border: 1px solid #a6e9cf; }
.check-status.bad { color: #8d241b; background: #fff1ef; border: 1px solid #f8b4aa; }
.export-card { padding: 28px; }
.export-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.text-button { border: 0; background: none; padding: 4px; color: var(--blue); font-weight: 700; }
.format-picker { border: 0; padding: 0; margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.format-picker label { position: relative; }
.format-picker input { position: absolute; opacity: 0; }
.format-picker span { min-height: 68px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 3px; transition: .15s ease; }
.format-picker small { color: var(--muted); }
.format-picker input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(19,94,234,.12); background: #f4f8ff; }
.format-picker input:focus-visible + span { outline: 3px solid rgba(19,94,234,.24); }
.iban-field { display: block; margin-bottom: 18px; }
.iban-field > span { display: block; font-size: 14px; font-weight: 720; margin-bottom: 7px; }
.iban-field input { width: 100%; border: 1px solid #bfc9d8; border-radius: 10px; padding: 12px 13px; color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.iban-field input:focus { outline: 3px solid rgba(19,94,234,.14); border-color: var(--blue); }
.iban-field small { display: block; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.primary-button { width: 100%; border: 0; border-radius: 11px; padding: 14px 18px; color: white; background: var(--blue); font-weight: 780; box-shadow: 0 8px 18px rgba(19,94,234,.22); }
.primary-button:hover { background: #0c50ce; }
.primary-button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.transactions-card { margin-top: 20px; padding: 28px; }
.filename { max-width: 45%; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { overflow-x: auto; margin-top: 22px; }
table { width: 100%; border-collapse: collapse; min-width: 730px; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .055em; }
td { padding: 15px 12px; border-bottom: 1px solid #edf0f5; font-size: 15px; }
tbody tr:last-child td { border-bottom: 0; }
.amount { text-align: right; font-variant-numeric: tabular-nums; }
.type-badge { display: inline-flex; padding: 5px 8px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.type-badge.debit { color: #922018; background: #fff0ee; }
.type-badge.credit { color: #087252; background: #e9f9f2; }
.notice { margin: 18px 2px 0; padding: 18px 20px; border-left: 4px solid #e8a317; background: #fff9e9; color: #5f4610; border-radius: 4px 12px 12px 4px; }
.notice p { margin: 5px 0 0; line-height: 1.5; }
footer { padding: 28px 16px 34px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
  .topbar { padding: 0 18px; }
  .shell { width: min(100% - 24px, 620px); padding-top: 34px; }
  .intro > p:last-child { font-size: 16px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: auto; }
}

@media (max-width: 520px) {
  :root { --header-height: 84px; --header-height-scrolled: 66px; --logo-height: 44px; }
  .topbar { padding-inline: 15px; }
  .brand-logo { width: 188px; }
  .contact-button { min-height: 39px; padding-inline: 16px; font-size: 14px; }
  .shell { width: calc(100% - 20px); padding-top: 28px; }
  .intro { margin-bottom: 20px; }
  h1 { font-size: 37px; }
  .drop-zone { min-height: 220px; }
  .summary-card, .export-card, .transactions-card { padding: 20px; border-radius: 17px; }
  .summary-card { grid-template-columns: 1fr 1fr; gap: 20px; }
  .summary-card > div:nth-child(3) { grid-column: 1 / -1; }
  .check-status { margin-top: 10px; }
  .format-picker { grid-template-columns: 1fr; }
  .format-picker span { min-height: auto; flex-direction: row; justify-content: space-between; align-items: center; }
  .filename { display: none; }
}
