:root {
  --ink: #1f2a37;
  --ink-2: #4a5563;
  --ink-3: #6b7480;
  --paper: #f5f6f3;
  --panel: #ffffff;
  --rule: #d9dbd4;
  --rule-strong: #b9bdb3;
  --good: #3b8a4c;
  --good-bg: #e9f3eb;
  --warn: #a86a12;
  --warn-bg: #fbf1df;
  --bad: #b42318;
  --bad-bg: #fbe9e7;
  --focus: #2f6fb2;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-panel: 14px;
  --r-control: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
}
[hidden] { display: none !important; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* masthead */
.masthead { background: var(--ink); color: #fff; }
.masthead-row { display: flex; align-items: baseline; gap: 14px; padding-top: 16px; padding-bottom: 16px; }
.wordmark { font-weight: 700; font-size: 20px; letter-spacing: .06em; }
.masthead-title { color: #c9ced6; font-size: 15px; }
.masthead-code { margin-left: auto; color: #c9ced6; font-size: 14px; font-variant-numeric: tabular-nums; }

/* states */
.state { padding: 72px 0; max-width: 60ch; }
.state h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; }

/* intro */
.intro { padding: 44px 0 26px; }
.intro-kicker { margin: 0 0 6px; color: var(--ink-3); font-size: 15px; }
.intro h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; margin: 0; }
.intro-status { margin: 14px 0 0; font-size: 17px; color: var(--ink-2); max-width: 62ch; }

/* status strip: the file's tabs */
.strip {
  display: grid; grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--rule-strong); border-radius: var(--r-panel); overflow: hidden;
  background: var(--panel); margin-bottom: 28px;
}
.strip a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px 16px; text-decoration: none; color: var(--ink);
  border-right: 1px solid var(--rule); border-top: 5px solid var(--rule);
  min-height: 92px;
}
.strip a:last-child { border-right: 0; }
.strip a:hover { background: #fafbf9; }
.strip .s-name { font-weight: 700; font-size: 15px; }
.strip .s-state { font-size: 13px; color: var(--ink-2); }
.strip a[data-state="ok"] { border-top-color: var(--good); }
.strip a[data-state="warn"] { border-top-color: var(--warn); }
.strip a[data-state="warn"] .s-state { color: var(--warn); }
.strip a[data-state="bad"] { border-top-color: var(--bad); }
.strip a[data-state="bad"] .s-state { color: var(--bad); font-weight: 700; }

/* confirm */
.confirm {
  display: flex; gap: 24px; align-items: center; justify-content: space-between;
  padding: 20px 22px; margin-bottom: 28px; background: var(--good-bg); border-radius: var(--r-panel);
}
.confirm h2 { margin: 0 0 4px; font-size: 18px; }
.confirm p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 58ch; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); padding: 26px 26px 22px; margin-bottom: 22px; scroll-margin-top: 16px; }
.panel-head { margin-bottom: 18px; }
.panel-head h2 { font-size: 22px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
.panel-head p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 66ch; }

/* forms */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field { display: block; margin-bottom: 16px; }
.field.narrow { max-width: 320px; }
.field > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field > span em { font-style: normal; font-weight: 400; color: var(--ink-3); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--rule-strong); border-radius: var(--r-control);
  padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; }
input[name="iban"], input[name="accountNumber"], input[name="routingCode"], input[name="swift"] { letter-spacing: .04em; font-variant-numeric: tabular-nums; }
input[type="file"] { padding: 8px; background: var(--paper); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 111, 178, .2); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); background: #fffafa; }
.field-error { color: var(--bad); font-size: 14px; margin: 6px 0 0; font-weight: 700; }
.field-error:empty { display: none; }
.hint { color: var(--ink-2); font-size: 14px; margin: 0 0 14px; }
.hint.warn { color: var(--warn); font-weight: 700; }
.hint.ok { color: var(--good); font-weight: 700; }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.btn {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: var(--r-control);
  padding: 11px 18px; min-height: 44px;
}
.btn:hover { background: #2c3a4c; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-quiet:hover { background: var(--paper); }
.btn-link { background: none; border: 0; padding: 4px 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; font-size: 14px; }
.btn-link.danger { color: var(--bad); }
.saved { font-size: 14px; color: var(--good); font-weight: 700; }
.saved.err { color: var(--bad); }

.disclose { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 14px; }
.disclose > summary { cursor: pointer; font-weight: 700; list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--rule-strong); border-radius: 50%; font-weight: 400; }
.disclose[open] > summary::before { content: "−"; }
.disclose[open] > summary { margin-bottom: 16px; }

/* contacts */
.contact-row {
  display: grid; gap: 12px 14px; padding: 16px 0; border-bottom: 1px solid var(--rule);
  grid-template-columns: 1.1fr 1.5fr 1fr;
  grid-template-areas: "name email phone" "role act act" "err err err";
}
.contact-row:first-child { padding-top: 0; }
.contact-row .field { margin-bottom: 0; }
.c-name { grid-area: name; } .c-email { grid-area: email; } .c-phone { grid-area: phone; } .c-role { grid-area: role; }
.c-act { grid-area: act; display: flex; align-items: flex-end; gap: 20px; }
.contact-row .primary { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; min-height: 44px; }
.contact-row .primary input { width: 18px; min-height: 18px; height: 18px; }
.contact-row .btn-link { min-height: 44px; }
.contact-row .row-errors { grid-area: err; }
.contact-row .row-errors:empty { display: none; }

/* summaries & lists */
.summary { display: grid; gap: 10px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 15px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.note { padding: 12px 14px; border-radius: var(--r-control); font-size: 15px; }
.note.warn { background: var(--warn-bg); }
.note.good { background: var(--good-bg); }
.note.bad { background: var(--bad-bg); }
.empty { color: var(--ink-3); margin: 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 16px; align-items: baseline; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 0; }
.rows .r-main { min-width: 0; }
.rows .r-title { font-weight: 700; display: block; }
.rows .r-sub { color: var(--ink-3); font-size: 14px; overflow-wrap: anywhere; }
.rows .r-side { text-align: right; font-size: 14px; white-space: nowrap; display: flex; gap: 12px; align-items: baseline; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill.ok { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

.foot { color: var(--ink-3); font-size: 14px; padding: 8px 0 48px; max-width: 70ch; }

/* toast-like status for whole-page errors */
.banner { position: sticky; top: 0; z-index: 5; background: var(--bad); color: #fff; padding: 10px 20px; font-weight: 700; }

@media (max-width: 760px) {
  .strip { grid-template-columns: repeat(3, 1fr); }
  .strip a:nth-child(3) { border-right: 0; }
  .strip a:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .grid2 { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "email email" "phone role" "act act" "err err"; }
  .confirm { flex-direction: column; align-items: flex-start; }
  .panel { padding: 20px 16px 16px; }
  .masthead-title { display: none; }
}
@media (max-width: 420px) {
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip a:nth-child(3) { border-right: 1px solid var(--rule); }
  .strip a:nth-child(2n) { border-right: 0; }
  .strip a:nth-child(-n+4) { border-bottom: 1px solid var(--rule); }
  .contact-row { grid-template-columns: 1fr; grid-template-areas: "name" "email" "phone" "role" "act" "err"; }
  .rows li { flex-direction: column; gap: 4px; }
  .rows .r-side { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
html { scroll-behavior: smooth; }
#ibanHint { margin: 6px 0 0; }
#ibanHint:empty { display: none; }
