:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --bg: #f8fafc;
  --card: #fff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -2px rgb(0 0 0 / 10%);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px -1px rgb(0 0 0 / 10%);
}

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

body {
  padding: 0;
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: Outfit, Inter, sans-serif;
  color: #0f172a;
}

.container {
  max-width: 740px;
  padding: 32px 16px 48px;
  margin: 0 auto;
}

header {
  margin-bottom: 40px;
  text-align: center;
}

header h1 {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header h1 .bike {
  display: inline-block;
  margin-right: 8px;
  font-size: 1.8rem;
  -webkit-text-fill-color: initial;
}

header p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.card {
  padding: 24px 28px;
  margin-bottom: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card h2 {
  display: flex;
  align-items: center;
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.card h2 .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

textarea {
  min-height: 120px;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

select,
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  background-color: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

select:hover,
input[type="text"]:hover,
input[type="password"]:hover,
textarea:hover {
  background-color: #fff;
  border-color: #cbd5e1;
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  background-color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(14 165 233 / 15%);
}

.row {
  display: flex;
  gap: 16px;
}

.row > .field {
  flex: 1;
}

.drop-zone {
  display: block;
  width: 100%;
  position: relative;
  padding: 32px 20px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  appearance: none;
  background-color: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  background: rgb(14 165 233 / 4%);
  border-color: var(--primary);
}

.drop-zone:focus-visible {
  background-color: #fff;
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.drop-zone .icon {
  margin-bottom: 8px;
  font-size: 2.5rem;
}

.drop-zone .filename {
  margin-top: 8px;
  font-weight: 600;
  color: var(--primary);
}

.or-divider {
  margin: 16px 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hint {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: Inter, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  box-shadow:
    0 4px 6px -1px rgb(14 165 233 / 25%),
    0 2px 4px -2px rgb(14 165 233 / 25%);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow:
    0 6px 8px -1px rgb(14 165 233 / 30%),
    0 4px 6px -2px rgb(14 165 233 / 30%);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  box-shadow: 0 2px 4px -1px rgb(14 165 233 / 25%);
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
  transform: none;
}

.export-bar {
  display: flex;
  gap: 16px;
  align-items: center;
}

.export-bar .status {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

#log {
  max-height: 260px;
  padding: 16px;
  overflow-y: auto;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  color: #e2e8f0;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  background: #0f172a;
  border-radius: 8px;
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 15%);
}

#log:empty {
  display: none;
}

.results {
  margin-top: 16px;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.result-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.result-item .name {
  flex: 1;
  margin-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.btn-download-all {
  width: 100%;
  margin-top: 12px;
  background: var(--success);
  box-shadow:
    0 4px 6px -1px rgb(16 185 129 / 20%),
    0 2px 4px -2px rgb(16 185 129 / 20%);
}

.btn-download-all:hover {
  background: #059669;
  box-shadow:
    0 6px 8px -1px rgb(16 185 129 / 25%),
    0 4px 6px -2px rgb(16 185 129 / 25%);
  transform: translateY(-1px);
}

.hidden {
  display: none !important;
}

footer {
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

footer a,
.result-item a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover,
.result-item a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgb(255 255 255 / 30%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (width <= 600px) {
  .row {
    flex-direction: column;
    gap: 0;
  }

  .container {
    padding: 16px 12px 36px;
  }

  .card {
    padding: 20px;
  }
}

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

.lang-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.lang-btn.active {
  color: var(--primary-dark);
  background: rgb(14 165 233 / 10%);
}

.flag-icon {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 10%);
}
