/* ============================================================
   zugpferd.io – Stylesheet
   Palette: Navy #1B2D4F | Amber #E8A820 | White #FFFFFF | Light #F7F8FA | Mid #B0BFD8
   Type: DM Serif Display (headlines) | Inter (body)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #1B2D4F;
  --navy-lt: #2A4170;
  --amber:   #E8A820;
  --amber-lt:#FDF3D6;
  --white:   #FFFFFF;
  --light:   #F7F8FA;
  --mid:     #B0BFD8;
  --text:    #1A1F2E;
  --muted:   #5A6478;
  --border:  #DDE3EE;
  --radius:  10px;
  --shadow:  0 4px 24px rgba(27,45,79,0.10);
  --shadow-sm: 0 2px 8px rgba(27,45,79,0.08);
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── CONTAINER ── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── NAVIGATION ── */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 2px solid var(--amber);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--amber);
  color: var(--navy);
  font-family: var(--font-serif);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
}

.logo-text {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--white);
  letter-spacing: -0.3px;
}

.logo-dot { color: var(--amber); }

.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--white); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

.lang-switch a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.lang-switch a:hover,
.lang-switch .lang-active { color: var(--amber); }

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, #243a60 100%);
  padding: 72px 0 80px;
  color: var(--white);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(232,168,32,0.15);
  border: 1px solid rgba(232,168,32,0.4);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 28px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--amber);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 20px;
  max-width: 700px;
}

.hero h1 em {
  color: var(--amber);
  font-style: normal;
}

.hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.75);
  max-width: 580px;
  margin-bottom: 48px;
  line-height: 1.7;
}

/* ── DROP ZONE ── */
.drop-zone {
  width: 100%;
  max-width: 680px;
  background: var(--white);
  border: 2.5px dashed var(--mid);
  border-radius: 16px;
  padding: 48px 32px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.drag-over {
  border-color: var(--amber);
  background: var(--amber-lt);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25), 0 0 0 4px rgba(232,168,32,0.2);
}

.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.drop-zone label { pointer-events: auto; }

.drop-icon { margin-bottom: 8px; }

.drop-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}

.drop-sub {
  font-size: 14px;
  color: var(--muted);
}

.drop-formats {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}

.btn-primary:hover { background: var(--navy-lt); transform: translateY(-1px); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover { background: var(--light); border-color: var(--mid); }

/* ── RESULT AREA ── */
.result-area {
  width: 100%;
  max-width: 780px;
  margin-top: 32px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 10px 10px 0 0;
  font-size: 14px;
}

.result-filename {
  font-weight: 500;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.batch-area .result-filename {
  max-width: none;
  overflow: visible;
  white-space: normal;
}

.result-area .btn-secondary,
.batch-area .btn-secondary {
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
  white-space: nowrap;
}
.result-area .btn-secondary:hover,
.batch-area .btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* ── INVOICE VIEW ── */
.invoice-view {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: left;
  color: var(--text);
}

.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--navy);
}

.inv-title {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--navy);
}

.inv-number {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.inv-badge {
  background: var(--amber-lt);
  border: 1px solid var(--amber);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.inv-party-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}

.inv-party-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 4px;
}

.inv-party-addr {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.inv-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: var(--light);
  border-radius: var(--radius);
}

.inv-meta-item { display: flex; flex-direction: column; gap: 2px; }
.inv-meta-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.inv-meta-value { font-size: 15px; font-weight: 600; color: var(--navy); }

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.inv-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.inv-table th:last-child,
.inv-table td:last-child { text-align: right; }

.inv-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.inv-table tr:last-child td { border-bottom: none; }
.inv-table tr:nth-child(even) td { background: var(--light); }

.inv-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-top: 16px;
}

.inv-total-row {
  display: flex;
  gap: 40px;
  font-size: 14px;
}

.inv-total-row.grand {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  border-top: 2px solid var(--navy);
  padding-top: 10px;
  margin-top: 6px;
}

.inv-notes {
  margin-top: 32px;
  padding: 16px;
  background: var(--light);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--muted);
}

/* ── EMBEDDED ATTACHMENTS ── */
.inv-attachments {
  margin-top: 32px;
  padding: 20px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.inv-attachments-head {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.inv-attachments-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.attachment-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.attachment-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.attachment-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  font-size: 12px;
  color: var(--muted);
}

.attachment-download {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .attachment-item { flex-wrap: wrap; }
  .attachment-download { width: 100%; text-align: center; }
}

/* ── VALIDATION BANNER ── */
.val-banner {
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1.5px solid;
}

.val-banner.val-valid   { border-color: #86EFAC; background: #F0FDF4; }
.val-banner.val-warning { border-color: var(--amber); background: var(--amber-lt); }
.val-banner.val-error   { border-color: #FCA5A5; background: #FEF2F2; }

.val-banner-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: default;
}

.val-banner-head[role="button"] {
  cursor: pointer;
}

.val-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
}

.val-valid   .val-icon { background: #16A34A; }
.val-warning .val-icon { background: var(--amber); color: var(--navy); }
.val-error   .val-icon { background: #DC2626; }

.val-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.val-text strong {
  font-size: 15px;
  font-weight: 600;
}

.val-valid   .val-text strong { color: #166534; }
.val-warning .val-text strong { color: #92400E; }
.val-error   .val-text strong { color: #991B1B; }

.val-text span {
  font-size: 13px;
  color: var(--muted);
}

.val-toggle {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
}

.val-issues {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 16px;
}

.val-issues.open { display: flex; }

.val-issue {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: white;
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.val-issue-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  margin-top: 1px;
}

.val-issue-error .val-issue-icon   { background: #DC2626; }
.val-issue-warning .val-issue-icon { background: var(--amber); color: var(--navy); }

.val-issue-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.val-issue-rule {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--navy);
  font-family: monospace;
}

.val-issue-msg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.val-disclaimer {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  padding: 12px 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.val-disclaimer a {
  color: var(--navy);
  text-decoration: underline;
}

@media print {
  .val-banner { display: none !important; }
  .inv-attachments { display: none !important; }
}

/* ── BATCH AREA ── */
.batch-area {
  width: 100%;
  max-width: 1080px;
  margin-top: 32px;
}

.batch-table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  text-align: left;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 920px;
}

.batch-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--navy);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.batch-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text);
}

.batch-table .batch-num { text-align: right; font-variant-numeric: tabular-nums; }
.batch-table th:nth-child(8),
.batch-table th:nth-child(9),
.batch-table th:nth-child(10) { text-align: right; }

.batch-row {
  cursor: pointer;
  transition: background 0.12s;
}

.batch-row:hover,
.batch-row:focus {
  background: var(--light);
  outline: none;
}

.batch-row:nth-child(even) { background: rgba(247,248,250,0.5); }
.batch-row:nth-child(even):hover { background: var(--light); }

.batch-filename {
  font-weight: 500;
  color: var(--navy);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-status { width: 28px; text-align: center; }

.batch-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.batch-status-dot-valid   { background: #16A34A; }
.batch-status-dot-warning { background: var(--amber); }
.batch-status-dot-error,
.batch-status-dot-unknown { background: #DC2626; }
.batch-row-error .batch-status-dot-unknown { background: #DC2626; }

.batch-error-cell {
  color: #991B1B;
  font-style: italic;
  white-space: normal;
}

.batch-foot-row td {
  border-top: 2px solid var(--navy);
  border-bottom: none;
  background: var(--light);
  padding: 12px;
}

.batch-foot-row .batch-num { font-size: 14px; }

.batch-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  margin-top: 12px;
}

@media print {
  .batch-area { display: none !important; }
}

@media (max-width: 768px) {
  .batch-table { font-size: 12px; }
}

/* ── ERROR BOX ── */
.error-box {
  width: 100%;
  max-width: 680px;
  margin-top: 24px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius);
  padding: 20px 24px;
  color: #991B1B;
}

.error-box p { margin-top: 6px; font-size: 14px; }

/* ── AD SLOT ── */
.ad-slot {
  padding: 28px 24px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── TRUST STRIP ── */
.trust-strip {
  padding: 64px 0;
  background: var(--white);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.trust-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trust-icon { font-size: 28px; margin-bottom: 4px; }

.trust-item strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

.trust-item p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── HOW IT WORKS ── */
.how-it-works {
  padding: 64px 0;
  background: var(--light);
}

.how-it-works h2,
.faq h2,
.related h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 38px);
  color: var(--navy);
  text-align: center;
  margin-bottom: 48px;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}

.step {
  flex: 1;
  max-width: 280px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--amber);
  color: var(--navy);
  font-weight: 700;
  font-size: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.step-arrow {
  font-size: 24px;
  color: var(--mid);
  margin-top: 52px;
  flex-shrink: 0;
}

/* ── FAQ ── */
.faq {
  padding: 64px 0;
  background: var(--white);
}

.faq-inner { max-width: 720px; margin: 0 auto; }

.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.faq-item summary::after { content: '+'; font-size: 20px; color: var(--amber); }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--light); }

.faq-item p {
  padding: 0 20px 20px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
}

/* ── RELATED TOOLS ── */
.related {
  padding: 64px 0;
  background: var(--light);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.related-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--navy);
  transform: translateY(-2px);
}

.related-icon { font-size: 32px; }

.related-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.related-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 40px 0;
  border-top: 2px solid var(--amber);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--amber); }

.footer-copy { font-size: 13px; }

/* ── PRINT STYLES ── */
@media print {
  .nav-bar, .hero .trust-badge, .drop-zone, .result-toolbar,
  .ad-slot, .trust-strip, .how-it-works, .faq, .related, .site-footer { display: none !important; }
  .hero { background: none; padding: 0; color: var(--text); }
  .invoice-view { border: none; box-shadow: none; padding: 0; }
  .result-area { max-width: 100%; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); margin: 0; }
  .related-grid { grid-template-columns: 1fr; }
  .inv-parties { grid-template-columns: 1fr; }
  .invoice-view { padding: 24px 16px; }
  .inv-header { flex-direction: column; gap: 12px; }
  .hero { padding: 48px 0 56px; }
}

@media (max-width: 480px) {
  .trust-grid { grid-template-columns: 1fr; }
  .drop-zone { padding: 32px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .badge-dot { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
