:root {
  --ink: #13242d;
  --muted: #526873;
  --line: #d3e4ea;
  --paper: #ffffff;
  --soft: #eef7fa;
  --brand: #0098ad;
  --brand-dark: #073f52;
  --accent: #f05b43;
  --sun: #ffc247;
  --ok: #12805c;
  --violet: #6c55d9;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  background: #f8fbfc;
}

a {
  color: var(--brand-dark);
}

.skip-link {
  left: 1rem;
  position: absolute;
  top: -4rem;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(7, 63, 82, 0.08);
  position: sticky;
  top: 0;
  z-index: 5;
}

.nav {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
  padding: 1rem 1.25rem;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 700;
  gap: 0.5rem;
  text-decoration: none;
}

.brand::before {
  background: var(--accent);
  border-radius: 3px;
  content: "";
  height: 1.4rem;
  width: 0.45rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
}

.nav-links a {
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus {
  background: var(--soft);
  color: var(--brand);
}

.hero {
  background: linear-gradient(105deg, rgba(7, 63, 82, 0.98) 0%, rgba(0, 152, 173, 0.92) 46%, rgba(19, 36, 45, 0.55) 100%), url("../img/factur-x-hero.png") center/cover;
  color: #fff;
  overflow: hidden;
  position: relative;
}

.hero::after {
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(255, 194, 71, 0.9) 38% 41%, transparent 41% 100%),
    linear-gradient(135deg, transparent 0 58%, rgba(240, 91, 67, 0.9) 58% 60%, transparent 60% 100%);
  bottom: -4rem;
  content: "";
  height: 16rem;
  opacity: 0.85;
  position: absolute;
  right: -2rem;
  transform: rotate(-5deg);
  width: 28rem;
}

.hero-inner {
  margin: 0 auto;
  max-width: 1120px;
  padding: 6rem 1.25rem 5.5rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  max-width: 780px;
}

.alert-badge {
  align-items: center;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(240, 91, 67, 0.72), 0 18px 38px rgba(11, 28, 37, 0.26);
  color: #fff;
  display: inline-flex;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  padding: 0.5rem 0.9rem;
  text-transform: uppercase;
  animation: alert-pulse 1.1s infinite;
}

.alert-badge strong {
  letter-spacing: 0.08em;
}

.alert-badge span:last-child {
  font-size: 0.86rem;
  font-weight: 700;
}

.alert-dot {
  background: #fff;
  border-radius: 50%;
  height: 0.7rem;
  width: 0.7rem;
}

@keyframes alert-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 91, 67, 0.72), 0 18px 38px rgba(11, 28, 37, 0.26);
    transform: translateY(0);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(240, 91, 67, 0), 0 18px 38px rgba(11, 28, 37, 0.26);
    transform: translateY(-1px);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(240, 91, 67, 0), 0 18px 38px rgba(11, 28, 37, 0.26);
    transform: translateY(0);
  }
}

.countdown-kicker {
  color: #e3fbff;
  display: block;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.countdown-value {
  display: block;
}

.countdown-units {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1.25rem 0 2rem;
  max-width: 680px;
}

.countdown-unit {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(2, 28, 37, 0.22);
  color: var(--ink);
  padding: 0.85rem;
  position: relative;
}

.countdown-unit::before {
  background: var(--brand);
  border-radius: 8px 8px 0 0;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.countdown-unit:nth-child(2)::before {
  background: var(--sun);
}

.countdown-unit:nth-child(3)::before {
  background: var(--accent);
}

.countdown-unit:nth-child(4)::before {
  background: var(--violet);
}

.countdown-number {
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
}

.countdown-label {
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.hero p {
  font-size: 1.18rem;
  margin: 0 0 2rem;
  max-width: 720px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
}

.hero-badges span {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
}

.official-mark {
  background: #fff;
  box-shadow: 0 16px 34px rgba(6, 25, 34, 0.24);
  display: block;
  height: auto;
  margin: 0 0 1.5rem;
  max-width: min(360px, 100%);
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  align-items: center;
  background: var(--brand);
  border: 2px solid var(--brand);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 152, 173, 0.25);
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  min-height: 44px;
  padding: 0.72rem 1.05rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.48;
}

.button:hover,
.button:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 14px 30px rgba(7, 63, 82, 0.28);
  transform: translateY(-1px);
}

.button.secondary {
  background: #fff;
  border-color: #fff;
  color: var(--brand-dark);
}

.button.secondary:hover,
.button.secondary:focus {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--ink);
}

.button.ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
  box-shadow: none;
}

.section {
  padding: 4.5rem 1.25rem;
}

.section.soft {
  background: linear-gradient(180deg, #eef7fa 0%, #ffffff 100%);
}

.container {
  margin: 0 auto;
  max-width: 1120px;
}

.narrow {
  max-width: 820px;
}

h1,
h2,
h3 {
  line-height: 1.18;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin: 0 0 1rem;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 2rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(7, 63, 82, 0.1);
  overflow: hidden;
  position: relative;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card:hover {
  box-shadow: 0 24px 56px rgba(7, 63, 82, 0.16);
  transform: translateY(-3px);
}

.card-body {
  padding: 1.45rem;
}

.card img {
  display: block;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
}

.card-eyebrow {
  color: var(--accent);
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.steps {
  counter-reset: steps;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  background: linear-gradient(90deg, #fff 0%, #f8fdff 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(7, 63, 82, 0.06);
  counter-increment: steps;
  margin-top: 0.75rem;
  padding: 1rem 1rem 1rem 3.75rem;
  position: relative;
}

.steps li:first-child {
  margin-top: 0;
}

.steps li::before {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 152, 173, 0.25);
  color: #fff;
  content: counter(steps);
  display: flex;
  font-weight: 700;
  height: 2rem;
  justify-content: center;
  left: 1rem;
  position: absolute;
  top: 1rem;
  width: 2rem;
}

.cta-panel {
  background: var(--brand-dark);
  border-radius: 8px;
  color: #fff;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

.cta-panel::after {
  background: var(--sun);
  content: "";
  height: 8px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.cta-panel p {
  color: #e9f8fb;
}

.upload-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 1.25rem;
}

.verify-panel {
  box-shadow: 0 24px 56px rgba(7, 63, 82, 0.14);
  overflow: hidden;
  position: relative;
}

.verify-panel::before {
  background: linear-gradient(90deg, var(--brand), var(--sun), var(--accent));
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.verify-panel h2 {
  margin-top: 0.6rem;
}

.service-status {
  align-self: start;
  background: #fff7f0;
  border-color: rgba(240, 91, 67, 0.35);
}

.service-status h2 {
  margin-top: 0;
}

.service-status p {
  color: var(--brand-dark);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0;
}

.contact-intro-panel {
  align-self: start;
}

.contact-hero-image {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(7, 63, 82, 0.16);
  display: block;
  height: auto;
  margin: 1.5rem 0 1rem;
  width: min(520px, 100%);
}

.contact-credentials {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(160px, 1fr) 72px;
  max-width: 520px;
}

.contact-credentials img {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(7, 63, 82, 0.1);
  display: block;
  height: auto;
  width: 100%;
}

.contact-credentials a {
  display: block;
}

.contact-credentials a img {
  aspect-ratio: 1;
  object-fit: cover;
}

.contact-credentials img:last-child {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

label {
  font-weight: 700;
}

input,
textarea,
select {
  border: 1px solid #bdcbd2;
  border-radius: 6px;
  font: inherit;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

textarea {
  min-height: 150px;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.field-error {
  color: #b42318;
  font-size: 0.92rem;
  font-weight: 700;
}

input.is-invalid {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.captcha-box {
  background:
    linear-gradient(135deg, rgba(0, 152, 173, 0.08), rgba(255, 194, 71, 0.12)),
    var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 0.75rem;
  min-height: 64px;
  padding: 0.75rem;
}

.captcha-box input[type="checkbox"] {
  flex: 0 0 20px;
  height: 20px;
  min-height: 20px;
  width: 20px;
}

.captcha-question {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  font-weight: 700;
}

.captcha-question strong {
  background: #fff;
  border: 1px solid rgba(0, 152, 173, 0.24);
  border-radius: 999px;
  color: var(--brand-dark);
  padding: 0.25rem 0.65rem;
}

.phone-keypad {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(5, minmax(46px, 1fr));
  max-width: 330px;
}

.phone-keypad button {
  align-items: center;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid #bdcbd2;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.phone-keypad button:hover,
.phone-keypad button:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 152, 173, 0.14);
  transform: translateY(-1px);
}

.phone-keypad button.is-selected {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 10px 22px rgba(0, 152, 173, 0.28);
  color: #fff;
}

.phone-keypad button.is-invalid {
  background: #fff0f0;
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
  color: #b42318;
}

.control-runner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
}

.control-track {
  background: #f1d7d4;
  border-radius: 999px;
  height: 8px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.control-progress {
  background: var(--accent);
  display: block;
  height: 100%;
  transition: width 260ms ease;
  width: 0;
}

.control-timeline {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.control-timeline li {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.2rem 0.75rem;
  grid-template-columns: 28px 1fr auto;
  padding: 0.85rem;
}

.control-timeline li[hidden] {
  display: none;
}

.control-timeline strong,
.control-timeline span:not(.control-dot) {
  grid-column: 2;
}

.control-dot {
  align-self: center;
  background: #cbd8de;
  border-radius: 50%;
  grid-column: 1;
  grid-row: 1 / span 2;
  height: 18px;
  width: 18px;
}

.control-timeline li.is-running {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(240, 91, 67, 0.14);
}

.control-timeline li.is-running .control-dot {
  background: var(--accent);
}

.control-timeline li.is-done {
  border-color: rgba(18, 128, 92, 0.35);
  background: #f1fbf7;
}

.control-timeline li.is-done .control-dot {
  background: var(--ok);
}

.control-timeline li.is-failed {
  border-color: rgba(190, 38, 52, 0.35);
  background: #fff1f3;
}

.control-timeline li.is-failed .control-dot {
  background: #be2634;
}

.control-timeline li.is-skipped {
  border-color: #d5dde1;
  background: #f7fafb;
}

.control-result {
  align-self: center;
  background: #dff8ec;
  border-radius: 999px;
  color: var(--ok);
  display: none;
  font-style: normal;
  font-weight: 800;
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 0.25rem 0.6rem;
}

.control-timeline li.is-done .control-result {
  display: inline-flex;
}

.control-timeline li.is-failed .control-result {
  background: #ffe0e5;
  color: #be2634;
  display: inline-flex;
}

.control-timeline li.is-skipped .control-result {
  background: #e9eef1;
  color: var(--muted);
  display: inline-flex;
}

.control-status {
  color: var(--brand-dark);
  font-weight: 700;
  margin: 1rem 0 0;
}

.analysis-summary {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}

.failure-explanation {
  background: #fff7f0;
  border: 1px solid rgba(240, 91, 67, 0.35);
  border-radius: 8px;
  color: var(--brand-dark);
  margin-top: 1rem;
  padding: 0.9rem;
}

.failure-explanation[hidden] {
  display: none;
}

.failure-explanation h3 {
  margin: 0 0 0.5rem;
}

.failure-explanation p {
  margin: 0.35rem 0 0;
}

.modal-backdrop.is-failure-result .modal-panel {
  max-width: min(760px, calc(100vw - 2rem));
}

.modal-backdrop.is-failure-result .control-track,
.modal-backdrop.is-failure-result .control-timeline {
  display: none;
}

.modal-backdrop.is-failure-result .control-runner {
  border-color: rgba(240, 91, 67, 0.28);
}

.modal-backdrop.is-failure-result .control-status {
  color: var(--brand-dark);
  font-size: 1rem;
  margin-top: 0;
}

.modal-backdrop.is-corrected-result .control-runner {
  border-color: rgba(18, 128, 92, 0.35);
}

.modal-backdrop.is-corrected-result .control-status {
  background: #e7f8ef;
  border: 1px solid rgba(18, 128, 92, 0.28);
  border-radius: 8px;
  color: #0f6b50;
  font-weight: 700;
  padding: 0.85rem 1rem;
}

.modal-backdrop.is-failure-result .failure-explanation {
  background: #fff7f0;
  border-color: rgba(240, 91, 67, 0.45);
  box-shadow: 0 14px 34px rgba(122, 18, 12, 0.08);
  margin-top: 1rem;
  padding: 1rem 1.1rem;
}

.modal-backdrop.is-failure-result .failure-explanation h3 {
  font-size: 1.25rem;
}

.failure-correction {
  background: #f7fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 1rem;
  padding: 1rem;
}

.failure-correction[hidden] {
  display: none;
}

.failure-correction h3 {
  color: var(--brand-dark);
  margin: 0 0 0.45rem;
}

.failure-correction .button {
  margin-top: 1rem;
}

.correction-status {
  border-radius: 6px;
  font-weight: 700;
  margin: 1rem 0 0;
  padding: 0.75rem 0.85rem;
}

.correction-status[hidden] {
  display: none;
}

.correction-status.is-success {
  background: #e7f8ef;
  border: 1px solid rgba(18, 128, 92, 0.28);
  color: #0f6b50;
}

.correction-status.is-error {
  background: #fff1f1;
  border: 1px solid rgba(180, 35, 24, 0.28);
  color: #9f1d14;
}

.failure-correction-fields {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  max-height: 42vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.correction-section {
  background: #fff;
  border: 1px solid rgba(7, 63, 82, 0.12);
  border-radius: 8px;
  padding: 0.85rem;
}

.correction-section h4,
.correction-section h5 {
  color: var(--brand-dark);
  margin: 0 0 0.65rem;
}

.correction-section h5 {
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.correction-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.correction-field {
  display: grid;
  gap: 0.25rem;
}

.correction-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.correction-field input {
  min-height: 38px;
}

.correction-field.is-missing input {
  border-color: #d58b00;
  background: #fff8e5;
}

.correction-field.is-invalid-data input {
  border-color: #b42318;
  background: #fff1f1;
}

.correction-field small {
  color: #9f1d14;
  font-size: 0.76rem;
  font-weight: 700;
}

.correction-field small:empty {
  display: none;
}

.success-panel {
  background:
    radial-gradient(circle at 16% 20%, rgba(247, 178, 61, 0.28) 0 6%, transparent 7%),
    radial-gradient(circle at 78% 18%, rgba(0, 157, 185, 0.22) 0 8%, transparent 9%),
    radial-gradient(circle at 82% 88%, rgba(18, 128, 92, 0.2) 0 12%, transparent 13%),
    linear-gradient(135deg, #ecfff6 0%, #ffffff 42%, #fff2c9 100%);
  border: 1px solid rgba(18, 128, 92, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 24px 70px rgba(0, 65, 81, 0.18);
  overflow: hidden;
  min-height: 260px;
  padding: 1.75rem;
  position: relative;
}

.success-panel[hidden] {
  display: none;
}

.success-panel h2,
.success-panel h3 {
  color: var(--ok);
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  margin: 0 0 0.35rem;
  position: relative;
  z-index: 1;
}

.result-section {
  background: linear-gradient(180deg, #f7fcfd 0%, #ffffff 100%);
  padding-top: 0;
}

.result-section[hidden] {
  display: none;
}

.result-container {
  max-width: min(1180px, calc(100vw - 2rem));
}

.success-hero {
  align-items: center;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) 132px;
  position: relative;
  z-index: 1;
}

.success-medal {
  align-items: center;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 24%),
    linear-gradient(135deg, #0f8e68, #12b58f 48%, #f7b23d);
  border: 6px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 18px 40px rgba(15, 142, 104, 0.32);
  color: #fff;
  display: flex;
  font-size: 2.15rem;
  font-weight: 900;
  justify-content: center;
}

.success-medal span {
  transform: rotate(-8deg);
}

.success-kicker {
  color: #0f8e68;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.success-file {
  background: rgba(7, 63, 82, 0.08);
  border: 1px solid rgba(7, 63, 82, 0.12);
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-flex;
  font-weight: 700;
  margin: 0.65rem 0 0.2rem;
  padding: 0.35rem 0.7rem;
}

.success-panel p,
.success-panel .button,
.success-invoice-summary {
  position: relative;
  z-index: 1;
}

.success-invoice-summary {
  margin: 1.35rem 0 1.1rem;
}

.success-warnings {
  background: #fff8e8;
  border: 1px solid #f0b84f;
  border-radius: 8px;
  color: #5b3b00;
  margin: 0 0 1.1rem;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.success-warnings[hidden] {
  display: none;
}

.success-warnings h3 {
  color: #8a5a00;
  font-size: 1.05rem;
  margin: 0 0 0.7rem;
}

.success-warnings ul {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.success-warnings li {
  background: rgba(255, 255, 255, 0.68);
  border-radius: 6px;
  padding: 0.72rem 0.8rem;
}

.success-warnings small {
  color: #6b5018;
  display: block;
  margin-top: 0.3rem;
}

.failure-result-section {
  background: linear-gradient(180deg, #fff7f0 0%, #ffffff 100%);
}

.failure-result-panel {
  background: #fff;
  border: 1px solid rgba(190, 38, 52, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(80, 26, 18, 0.14);
  overflow: hidden;
  padding: 1.75rem;
}

.failure-result-panel[hidden] {
  display: none;
}

.failure-result-hero {
  align-items: center;
  border-bottom: 1px solid rgba(190, 38, 52, 0.18);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) 132px;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
}

.failure-result-kicker {
  color: #9f1d14;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.failure-result-panel h2 {
  color: #9f1d14;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  margin: 0 0 0.35rem;
}

.failure-medal {
  align-items: center;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #9f1d14, #be2634 52%, #f0b84f);
  border: 6px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 18px 40px rgba(159, 29, 20, 0.25);
  color: #fff;
  display: flex;
  font-size: 2.15rem;
  font-weight: 900;
  justify-content: center;
}

.failure-medal span {
  transform: rotate(-8deg);
}

.api-validation-details {
  display: grid;
  gap: 1rem;
}

.api-validation-meta {
  background: #f7fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 1rem;
}

.api-validation-meta div {
  display: grid;
  gap: 0.2rem;
}

.api-validation-meta dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.api-validation-meta dd {
  color: var(--brand-dark);
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.api-subreport {
  border: 1px solid rgba(190, 38, 52, 0.18);
  border-radius: 8px;
  padding: 1rem;
}

.api-subreport h3 {
  color: var(--brand-dark);
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.api-items {
  display: grid;
  gap: 0.55rem;
}

.api-items + .api-items {
  margin-top: 1rem;
}

.api-items h4 {
  color: #9f1d14;
  font-size: 0.95rem;
  margin: 0;
}

.api-item-list {
  display: grid;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.api-item-list li {
  background: #fff7f0;
  border-left: 4px solid #be2634;
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
}

.api-item-list strong {
  color: var(--ink);
  display: block;
}

.api-item-list small {
  color: var(--muted);
  display: block;
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.api-items-message .api-item-list li {
  background: #f7fbfc;
  border-left-color: var(--brand);
}

.failure-invoice-summary {
  margin-top: 1.25rem;
}

.failure-invoice-lines {
  margin-top: 1.25rem;
}

.invoice-preview-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 152, 173, 0.22);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(7, 63, 82, 0.1);
  display: grid;
  min-height: 420px;
  overflow: hidden;
}

.invoice-preview-card h4 {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  margin: 0;
  padding: 0.82rem 1rem;
  text-transform: uppercase;
}

.invoice-preview-main,
.invoice-preview-footer {
  padding: 1rem;
}

.invoice-preview-main {
  align-self: start;
}

.invoice-preview-footer {
  align-self: end;
  background: linear-gradient(180deg, rgba(235, 248, 250, 0.6), rgba(255, 247, 227, 0.88));
  border-top: 1px solid rgba(0, 152, 173, 0.2);
}

.invoice-preview-footer h5 {
  color: var(--brand-dark);
  font-size: 0.92rem;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.invoice-preview-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.invoice-preview-grid > div {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(7, 63, 82, 0.1);
  border-radius: 8px;
  padding: 0.72rem 0.8rem;
}

.invoice-preview-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-preview-grid dd {
  color: var(--ink);
  font-weight: 700;
  margin: 0.22rem 0 0;
  overflow-wrap: anywhere;
}

.success-panel [data-show-invoice-lines] {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  box-shadow: 0 18px 34px rgba(0, 152, 173, 0.28);
}

.fireworks {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.fireworks span {
  animation: firework-pop 1.7s ease-in-out infinite;
  background:
    radial-gradient(circle, var(--accent) 0 7%, transparent 8%),
    radial-gradient(circle, var(--sun) 0 7%, transparent 8%),
    radial-gradient(circle, var(--brand) 0 7%, transparent 8%),
    radial-gradient(circle, #1b8a5a 0 7%, transparent 8%),
    radial-gradient(circle, #d83b60 0 7%, transparent 8%),
    radial-gradient(circle, #7149c6 0 7%, transparent 8%);
  background-position: 50% 0, 88% 24%, 88% 76%, 50% 100%, 12% 76%, 12% 24%;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  height: 118px;
  opacity: 0.82;
  position: absolute;
  width: 118px;
}

.fireworks span:nth-child(1) {
  right: 8%;
  top: 8%;
}

.fireworks span:nth-child(2) {
  animation-delay: 180ms;
  right: 26%;
  top: 30%;
}

.fireworks span:nth-child(3) {
  animation-delay: 360ms;
  right: 4%;
  top: 54%;
}

.fireworks span:nth-child(4) {
  animation-delay: 520ms;
  left: 8%;
  top: 14%;
}

.fireworks span:nth-child(5) {
  animation-delay: 700ms;
  left: 26%;
  top: 48%;
}

.fireworks span:nth-child(6) {
  animation-delay: 880ms;
  left: 48%;
  top: 3%;
}

.fireworks span:nth-child(7) {
  animation-delay: 1040ms;
  right: 42%;
  top: 60%;
}

@keyframes firework-pop {
  0% {
    transform: scale(0.4) rotate(0deg);
    opacity: 0;
  }

  35% {
    opacity: 0.82;
  }

  100% {
    transform: scale(1.35) rotate(45deg);
    opacity: 0;
  }
}

.analysis-summary[hidden] {
  display: none;
}

.analysis-summary h3 {
  margin: 0 0 0.85rem;
}

.analysis-summary dl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.analysis-summary dl > div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
}

.analysis-summary dt {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.analysis-summary dd {
  margin: 0.2rem 0 0;
}

.invoice-tables {
  display: grid;
  gap: 1rem;
}

.invoice-table-block {
  overflow-x: auto;
}

.invoice-table-block h4 {
  margin: 0 0 0.5rem;
}

.invoice-line-card {
  background: #fff;
  border: 1px solid rgba(0, 152, 173, 0.22);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(7, 63, 82, 0.08);
  overflow: hidden;
}

.invoice-line-toolbar {
  align-items: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.8rem;
}

.invoice-line-toolbar strong {
  font-size: 1rem;
}

.invoice-line-toolbar .button {
  box-shadow: none;
  min-height: 38px;
  padding: 0.48rem 0.75rem;
}

.invoice-line-toolbar .button.secondary {
  border-color: rgba(255, 255, 255, 0.7);
}

.invoice-line-content {
  padding: 1rem;
}

.invoice-line-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-table {
  border-collapse: collapse;
  min-width: 100%;
  width: 100%;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.invoice-table th {
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.invoice-table tbody tr:nth-child(even) td {
  background: #f9fcfd;
}

.modal-backdrop {
  align-items: center;
  background: rgba(10, 27, 36, 0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1.25rem;
  position: fixed;
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  max-height: min(760px, calc(100vh - 2.5rem));
  max-width: 760px;
  overflow: auto;
  padding: 1.5rem;
  position: relative;
  width: 100%;
}

.modal-panel h2 {
  margin-right: 2.5rem;
}

.modal-close {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 1.5rem;
  height: 2.25rem;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 2.25rem;
}

.modal-close:hover,
.modal-close:focus {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.notice {
  border-left: 4px solid var(--brand);
  background: #eef8fb;
  margin: 1.25rem 0;
  padding: 1rem;
}

.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 2rem 1.25rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
}

.site-footer a {
  color: #fff;
}

@media (max-width: 760px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero-inner {
    padding: 3.5rem 1.25rem;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .invoice-preview-grid {
    grid-template-columns: 1fr;
  }

  .invoice-line-grid {
    grid-template-columns: 1fr;
  }

  .success-hero {
    grid-template-columns: 1fr;
  }

  .failure-result-hero {
    grid-template-columns: 1fr;
  }

  .success-medal {
    max-width: 116px;
  }

  .failure-medal {
    max-width: 116px;
  }

  .api-validation-meta {
    grid-template-columns: 1fr;
  }

  .countdown-units {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alert-badge {
    animation: none;
  }
}

.diagnostic-mail-form {
  margin: 1.25rem 0 1rem;
  padding: 1rem;
  border: 1px solid rgba(5, 54, 72, 0.14);
  background: rgba(248, 251, 252, 0.92);
}

.diagnostic-mail-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--ink);
}

.diagnostic-mail-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.diagnostic-mail-row input {
  flex: 1 1 18rem;
  min-width: 0;
}

.diagnostic-mail-status {
  border-left: 4px solid var(--brand);
  background: #eef8fb;
  color: var(--ink);
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  font-weight: 700;
}

.diagnostic-mail-status[hidden] {
  display: none;
}

.diagnostic-mail-status.is-success {
  background: #edf8f1;
  border-left-color: #23864b;
  color: #14542e;
}

.diagnostic-mail-status.is-error {
  background: #fff0f0;
  border-left-color: #c0362c;
  color: #7d201a;
}

@media (max-width: 640px) {
  .diagnostic-mail-row {
    align-items: stretch;
    flex-direction: column;
  }
}
