:root {
  --ink: #14213d;
  --muted: #5b6577;
  --line: #d9dfea;
  --bg: #f4f6fb;
  --card: #ffffff;
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --accent: #0f9d8a;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --err: #c62828;
  --err-bg: #fdecea;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

header.hero {
  background: linear-gradient(135deg, #14306b 0%, #1d4ed8 60%, #0f9d8a 130%);
  color: #fff;
  padding: 34px 20px 44px;
}
.wrap { max-width: 860px; margin: 0 auto; }
.brand { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; opacity: .85; margin: 0 0 8px; }
.hero h1 { margin: 0 0 10px; font-size: clamp(26px, 5vw, 38px); line-height: 1.15; }
.hero p { margin: 0; max-width: 640px; opacity: .93; }

.progress {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 246, 251, .94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
}
.progress .wrap { display: flex; align-items: center; gap: 14px; }
.bar { flex: 1; height: 10px; background: #e3e8f4; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .25s; }
.progress small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

main.wrap { margin-top: 18px; padding: 0 16px 80px; position: relative; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(20, 33, 61, .04), 0 8px 24px rgba(20, 33, 61, .05);
}
.card > h2 { margin: 0 0 4px; font-size: 21px; }
.card > .sub { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; }

.notice { border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px; }
.notice.info { background: #eef4ff; border: 1px solid #c9dafc; }
.notice.warn { background: var(--warn-bg); border: 1px solid #f6d7a8; color: #7c3a07; }
.notice.ok { background: var(--ok-bg); border: 1px solid #b7e8c8; color: #14532d; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: 1fr 1fr 1fr; } .span2 { grid-column: span 2; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, fieldset > legend { font-weight: 650; font-size: 15px; }
.req { color: var(--err); margin-left: 2px; }
.hint { color: var(--muted); font-size: 13.5px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .drop:focus-within, a:focus-visible {
  outline: 3px solid #93b4ff; outline-offset: 1px; border-color: var(--brand);
}
.field.invalid input, .field.invalid select, .field.invalid textarea, fieldset.invalid { border-color: var(--err); background: var(--err-bg); }
.error { color: var(--err); font-size: 14px; font-weight: 600; min-height: 0; }
.error:empty { display: none; }

fieldset { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px 8px; margin: 0; min-width: 0; }
fieldset > legend { padding: 0 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; cursor: pointer; border-radius: 8px; }
.choice:hover { background: #f4f7ff; }
.choice input { width: 20px; height: 20px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--brand); }
.choice span { flex: 1; }
.inline-choices { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.inline-choices .choice { padding: 6px 4px; }

.question { padding: 14px 0; border-top: 1px solid var(--line); }
.question:first-of-type { border-top: 0; padding-top: 0; }
.question p { margin: 0 0 6px; }

.hidden { display: none !important; }

/* dokumenty */
.doc { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fbfcff; }
.doc.required { border-color: #f1b27a; background: #fffaf4; }
.doc h3 { margin: 0 0 2px; font-size: 16px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.tag.req { background: #ffe3c2; color: #7c3a07; margin-left: 6px; }
.tag.opt { background: #e3e8f4; color: var(--muted); }
.drop {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  border: 2px dashed #b7c3dd; border-radius: 12px; padding: 16px; margin-top: 10px;
  color: var(--muted); cursor: pointer; background: #fff; position: relative;
}
.drop.over { border-color: var(--brand); background: #eef4ff; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.files { list-style: none; padding: 0; margin: 10px 0 0; }
.files li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fff; font-size: 14px; }
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.files button { border: 0; background: transparent; color: var(--err); font-weight: 700; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.files button:hover { background: var(--err-bg); }

button.primary {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; font: inherit; font-weight: 700; font-size: 18px;
  padding: 16px 20px; border-radius: 14px; box-shadow: 0 6px 18px rgba(29, 78, 216, .35);
}
button.primary:disabled { opacity: .6; cursor: progress; }
button.secondary { appearance: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 10px; cursor: pointer; }

.upbar { height: 10px; background: #e3e8f4; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.upbar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
#formError { margin-top: 14px; }

.done { text-align: center; padding: 38px 22px; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 40px; margin: 0 auto 14px; }
.done .ref { display: inline-block; font-weight: 800; letter-spacing: .04em; font-size: 22px; background: #eef4ff; padding: 8px 16px; border-radius: 10px; margin: 8px 0 14px; user-select: all; }
.done ul { text-align: left; display: inline-block; }

footer { max-width: 860px; margin: 0 auto; padding: 0 20px 50px; color: var(--muted); font-size: 13.5px; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .bar > span, .upbar > span { transition: none; } }
