/* Generator page: form, document tabs, paper preview, license box, downloads, print view. */
.app { padding: 28px 0 48px; }
.app.is-loading { min-height: 60vh; }
.app-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.app-top h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
.app-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.companies { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.companies select { min-width: 220px; }
.notice { border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; }
.notice--info { background: #eaf4f2; border: 1px solid #b9ddd8; }
.notice--warn { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.step-count { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--teal-dark); text-transform: uppercase; letter-spacing: 0.05em; }
.step-head h2 { margin: 2px 0 4px; }
.step-intro { color: var(--muted); margin-bottom: 14px; }

/* form */
.set { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.set > legend { font-weight: 700; color: var(--navy-dark); font-size: 1.05rem; padding: 0; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.93rem; }
.req { color: var(--error); }
.opt { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select {
  font: inherit; font-size: 0.97rem; padding: 9px 10px; border: 1px solid #b8c4d2; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; min-height: 42px;
}
input:focus, select:focus { border-color: var(--teal); outline: 3px solid rgba(15, 118, 110, 0.18); outline-offset: 0; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0; }
.hint--inline { display: inline; margin-left: 4px; }
.field--check .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.radios { border: 0; padding: 0; margin: 4px 0 0; min-width: 0; }
.radios > legend { font-weight: 600; font-size: 0.93rem; margin-bottom: 6px; padding: 0; }
.radio { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--teal); background: #f0f8f7; }
.radio input { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.radio__label { display: block; font-weight: 600; }
.radio .hint { display: block; }

/* issues */
.issues { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.issues ul { margin: 6px 0 0; padding: 0; list-style: none; }
.issues--ok { background: #ecf7ef; border: 1px solid #b7e0c2; }
.issues--ok p { margin: 0; display: flex; gap: 8px; align-items: center; }
.issues--warning { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.issues--error { background: #fdecec; border: 1px solid #f0b4b4; }
.issues__head { font-weight: 700; margin: 0; }
.issue { display: flex; gap: 10px; align-items: baseline; margin: 4px 0; }
.issue__tag { flex: none; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 5px; padding: 1px 6px; background: #fff; border: 1px solid currentColor; }
.issue--error .issue__tag { color: var(--error); }
.issue--warning .issue__tag { color: #8a5a00; }
.tick { width: 18px; height: 18px; border-radius: 50%; background: var(--ok); display: inline-block; position: relative; flex: none; }
.tick::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* documents */
.docs { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tab { font: inherit; font-size: 0.92rem; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--navy-dark); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.preview { background: #e9eef3; border-radius: var(--radius); padding: 18px; max-height: 78vh; overflow: auto; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; margin-bottom: 14px; }
.side-title { margin: 0 0 8px; font-size: 1rem; }
.tiers { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.tier { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-decoration: none; color: var(--ink); }
a.tier:hover { border-color: var(--teal); background: #f0f8f7; }
.tier__text { display: flex; flex-direction: column; font-weight: 600; font-size: 0.93rem; }
.tier__per { font-weight: 400; font-size: 0.82rem; color: var(--muted); }
.tier__price { font-weight: 800; font-size: 1.15rem; color: var(--navy-dark); }
.lic-form { margin-top: 12px; }
.lic-form label { font-weight: 600; font-size: 0.9rem; }
.lic-form__row { display: flex; gap: 8px; margin-top: 4px; }
.lic-form__row input { min-width: 0; }
.lic-msg { min-height: 1.2em; font-size: 0.88rem; margin: 6px 0 0; }
.lic-msg--error, .text-error { color: var(--error); }
.lic-ok { display: flex; gap: 8px; align-items: flex-start; color: var(--ok); font-weight: 600; font-size: 0.93rem; }
.lic-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.9rem; margin: 8px 0 12px; }
.lic-facts dt { color: var(--muted); }
.lic-facts dd { margin: 0; }
.dl-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.dl-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.92rem; }
.export-msg { min-height: 1.2em; font-size: 0.88rem; margin: 8px 0 0; }
.export-msg--ok { color: var(--ok); }
.export-msg--error { color: var(--error); }
.kit-note { font-size: 0.88rem; color: var(--muted); margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }

/* paper preview */
.paper { position: relative; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); max-width: 816px; margin: 0 auto; padding: 56px 64px; font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.45; color: #111; overflow: hidden; }
.paper.is-preview .paper-body { user-select: none; -webkit-user-select: none; }
.paper .watermark { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.paper-body { position: relative; z-index: 1; }
.d-header { text-align: right; font-size: 0.78em; color: #666; margin-bottom: 22px; }
.d-title { font-size: 1.55em; color: var(--navy); margin: 0 0 4px; }
.d-subtitle { color: #444; border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin: 0 0 16px; }
.d-heading { font-size: 1.1em; color: var(--navy); margin: 18px 0 6px; }
.d-para { margin: 0 0 8px; }
.d-justify { text-align: justify; }
.d-center { text-align: center; }
.d-right { text-align: right; }
.d-bold { font-weight: 700; }
.d-italic { font-style: italic; }
.d-small { font-size: 0.88em; }
.d-clause { display: grid; grid-template-columns: 3.2em 1fr; margin: 0 0 6px; }
.d-num { font-variant-numeric: tabular-nums; }
.d-bullet { margin: 0 0 4px 1.2em; padding-left: 1em; text-indent: -1em; }
.d-bullet::before { content: "\2022"; display: inline-block; width: 1em; text-indent: 0; }
.d-bullet--2 { margin-left: 4.2em; }
.d-table-wrap { overflow-x: auto; margin: 6px 0 12px; }
.d-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 0.88em; }
.d-table th, .d-table td { border: 1px solid #a6b4c4; padding: 5px 7px; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.d-table th { background: #e8eef5; }
.d-sign p { display: flex; gap: 10px; align-items: flex-end; margin: 14px 0 0; }
.d-sign span:first-child { min-width: 8.5em; }
.d-line { flex: 1; border-bottom: 1px solid #333; height: 1.1em; max-width: 340px; }
.d-note { font-style: italic; font-size: 0.82em; color: #555; border-top: 1px solid #a6b4c4; padding-top: 8px; margin-top: 18px; }
.d-spacer { height: 10px; }
.d-pagebreak { border-top: 1px dashed #b8c4d2; margin: 22px -64px; }

/* toast and print */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: var(--navy-dark); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: all 0.2s ease; z-index: 60; max-width: calc(100% - 32px); }
#toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
#print-root { display: none; }
@media print {
  body.is-printing > *:not(#print-root) { display: none !important; }
  body.is-printing #print-root { display: block; }
  #print-root .paper { box-shadow: none; padding: 0; max-width: none; font-size: 11pt; }
  #print-root .d-pagebreak { break-after: page; border: 0; margin: 0; }
  @page { size: letter; margin: 0.9in; }
}

@media (max-width: 960px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .card { padding: 16px; }
  .paper { padding: 26px 18px; font-size: 14px; }
  .d-pagebreak { margin: 18px -18px; }
  .d-clause { grid-template-columns: 2.7em 1fr; }
  .preview { padding: 8px; }
}

/* Employer Update additions: free badges, union slots, checkbox groups, euro price line */
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.badge--free { background: #e6f4f1; color: #0b5d56; border: 1px solid #9fd3ca; }
.tab[aria-selected="true"] .badge--free { background: #fff; }
.set-intro { margin: -4px 0 12px; font-size: 0.93rem; color: var(--muted); }
.slot { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px 14px; }
.slot__title { margin: 0 0 8px; font-weight: 700; font-size: 0.9rem; color: var(--navy-dark); }
.checks { border: 0; padding: 0; margin: 4px 0 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.checks > legend { font-weight: 600; font-size: 0.93rem; margin-bottom: 6px; padding: 0; }
.checks .field--check { grid-column: auto; }
.tier__eur { display: block; font-weight: 500; font-size: 0.78rem; color: var(--muted); text-align: right; }
@media (max-width: 720px) { .checks { grid-template-columns: 1fr; } }
