/* Factur-X tool: the drop zone, the check report and the invoice form. Loaded after tools.css. */

/* Drop zone */
.fx-drop {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: clamp(40px, 6vw, 64px) 24px; text-align: center;
  border: 2px dashed #c9d1e3; border-radius: 24px; background: var(--mist); cursor: pointer; transition: border-color .25s, background-color .25s;
}
.fx-drop input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.fx-drop:hover, .fx-drop.over { border-color: var(--cobalt); background: #eef2ff; }
.fx-drop:has(input:focus-visible) { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.fx-drop[aria-busy='true'] { pointer-events: none; opacity: .7; }
.fx-drop-i { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 10px; border-radius: 50%; background: #fff; color: var(--cobalt); box-shadow: 0 12px 24px -16px rgb(10 21 56 / .5); transition: transform .45s var(--out); }
.fx-drop:hover .fx-drop-i { transform: translateY(-3px); }
.fx-drop-i .ico { width: 26px; height: 26px; stroke-width: 2.2; }
.fx-drop b { color: var(--ink); font-size: clamp(19px, 2vw, 22px); font-weight: 700; letter-spacing: -.015em; }
.fx-drop span { color: var(--muted); font-size: 15px; }
.fx-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.fx-sample .r-btn { color: var(--cobalt); }

/* Result: file name, verdict, facts, checks and lines */
.fx-result { margin-top: 32px; }
.fx-file { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.fx-file b { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.fx-file span { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.fx-report { display: grid; gap: 22px; padding-top: 24px; }
.fx-verdict { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--ink); font-size: clamp(21px, 2.2vw, 26px); font-weight: 700; letter-spacing: -.02em; }
.fx-verdict > :first-child, .fx-checks li > :first-child {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--tone); color: #fff; font-size: 15px; font-weight: 800; stroke-width: 2.6;
}
.fx-verdict .ico { padding: 7px; }
.fx-report .ok { --tone: #0f7a5a; }
.fx-report .warn { --tone: #b7700a; }
.fx-report .bad { --tone: #c4372c; }
.fx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0; }
.fx-facts div { padding: 14px 16px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.fx-facts dt { color: var(--muted); font-size: 13px; font-weight: 620; }
.fx-facts dd { margin: 2px 0 0; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.fx-checks { margin: 0; padding: 0; list-style: none; }
.fx-checks li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 15.5px; line-height: 1.5; }
.fx-checks li > :first-child { width: 24px; height: 24px; margin-top: 0; font-size: 13px; }
.fx-checks .ico { padding: 5px; }
.fx-table { overflow-x: auto; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.fx-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.fx-table th, .fx-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.fx-table th { background: var(--mist); color: var(--ink); font-size: 13.5px; font-weight: 650; }
.fx-table th:not(:first-child), .fx-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.fx-table tr:last-child td { border-bottom: 0; }
.fx-limit { margin: 0; color: var(--muted); font-size: 14px; }

/* Invoice form */
.fx-form { display: grid; gap: 20px; }
.fx-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.fx-set, .fx-go { min-width: 0; margin: 0; padding: clamp(20px, 2.6vw, 28px); border: 0; border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px rgb(12 21 51 / .06), 0 30px 60px -44px rgb(10 21 56 / .45); }
.fx-set legend { float: left; width: 100%; margin-bottom: 18px; padding: 0; color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.fx-set legend + * { clear: both; }
.fx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fx-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fx-f { display: grid; align-content: start; gap: 6px; min-width: 0; }
.fx-f.wide { grid-column: 1 / -1; }
.fx-f > span { margin: 0; color: var(--muted); font-size: 13px; font-weight: 620; }
.fx-f i { color: var(--cobalt); font-style: normal; }
.fx-f input, .fx-f textarea {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.fx-f textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.fx-f input:hover, .fx-f textarea:hover { border-color: #b9c3da; }
.fx-f input:focus, .fx-f textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgb(43 91 255 / .15); }
.fx-f input:user-invalid { border-color: #c4372c; }
.fx-f small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

.fx-lines { display: grid; gap: 12px; }
.fx-line { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 84px 140px 100px 120px 32px; gap: 12px; align-items: end; }
.fx-lines.novat .fx-line { grid-template-columns: minmax(0, 1fr) 84px 140px 120px 32px; }
.fx-line + .fx-line .fx-f > span, .fx-line + .fx-line .fx-line-total span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fx-line-total { display: grid; gap: 6px; margin: 0; color: var(--ink); font-weight: 650; line-height: 44px; text-align: right; white-space: nowrap; }
.fx-line-total span { color: var(--muted); font-size: 13px; font-weight: 620; line-height: 1.5; }
.fx-x { grid-column: -2; display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 6px; padding: 0; border: 0; border-radius: 50%; background: none; color: #98a1bd; cursor: pointer; transition: color .2s, background-color .2s; }
.fx-x:hover { background: #fdeceb; color: #c4372c; }
.fx-x .ico { width: 15px; height: 15px; stroke-width: 2.2; }
.fx-set .l-add { margin: 12px 0 0 -12px; }
.fx-novat { margin-top: 18px; }

.fx-go { display: flex; flex-wrap: wrap-reverse; justify-content: space-between; align-items: flex-end; gap: 24px; }
.fx-go-btns { display: grid; justify-items: start; gap: 12px; }
.fx-go-btns .rail-private { margin: 0; }
.fx-go .btn[disabled] { opacity: .7; pointer-events: none; }
.fx-error { margin: 0; color: #c4372c; font-weight: 600; }

@media (max-width: 900px) {
  .fx-parties { grid-template-columns: 1fr; }
  .fx-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fx-grid, .fx-grid-4 { grid-template-columns: 1fr; }
  .fx-line, .fx-lines.novat .fx-line { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 0 14px; border-bottom: 1px solid var(--line); }
  .fx-line > .fx-f:first-child { grid-column: 1 / -1; padding-right: 40px; }
  .fx-line + .fx-line .fx-f > span, .fx-line + .fx-line .fx-line-total span { position: static; width: auto; height: auto; clip-path: none; }
  .fx-line-total { text-align: left; }
  .fx-x { position: absolute; top: 22px; right: -4px; }
  .fx-go { padding: 20px; }
  .fx-go .totals { width: 100%; }
}
