*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #f0f4fa 0%, #e2e8f2 100%);
  color: #1a1a2e;
  min-height: 100vh;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.page-wide {
  max-width: 760px;
}

.nav-links {
  text-align: center;
  margin: -1rem 0 1.25rem;
}

.nav-links a {
  color: #1c3687;
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
}

.nav-links a:hover {
  text-decoration: underline;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  max-width: 220px;
  height: auto;
  margin-bottom: 1rem;
}

.header h1 {
  font-size: 1.5rem;
  color: #1c3687;
  margin: 0 0 0.5rem;
}

.subtitle {
  color: #666;
  font-size: 0.95rem;
  margin: 0;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 4px 24px rgba(28, 54, 135, 0.1);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1c3687;
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}

label:first-of-type {
  margin-top: 0;
}

.hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hints-label {
  font-size: 0.85rem;
  color: #666;
}

.hint-btn {
  padding: 0.35rem 0.75rem;
  border: 1.5px solid #d0d8e8;
  border-radius: 999px;
  background: #f8fafc;
  color: #1c3687;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.hint-btn:hover {
  background: #e8ecf4;
  border-color: #1c3687;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #d0d8e8;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #1c3687;
}

button[type="submit"] {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  background: #1c3687;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover:not(:disabled) {
  background: #152a6b;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: wait;
}

.loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  color: #666;
  font-size: 0.9rem;
}

.loading.hidden {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #d0d8e8;
  border-top-color: #1c3687;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8ecf4;
}

.result h2 {
  font-size: 1.1rem;
  color: #1c3687;
  margin: 0 0 0.75rem;
}

.result-meta {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.vat-note {
  font-size: 0.85rem;
  color: #666;
  font-weight: 400;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-download,
.btn-copy-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-download {
  background: #e5a024;
  color: #fff;
  text-decoration: none;
}

.btn-download:hover {
  background: #c98a1a;
}

.btn-copy-link {
  background: #1c3687;
  color: #fff;
  border: none;
}

.btn-copy-link:hover {
  background: #152a6b;
}

.link-hint {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: #888;
}

.disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #888;
  line-height: 1.5;
}

.footer {
  text-align: center;
  margin-top: 2rem;
  color: #888;
  font-size: 0.85rem;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e8ecf4;
  border-radius: 8px;
  background: #f8fafc;
}

.file-name {
  color: #1c3687;
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-all;
}

.file-meta {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #888;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.empty-state {
  margin: 0;
  color: #666;
  line-height: 1.6;
}

.empty-state a {
  color: #1c3687;
}
