:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #1a2230;
  --muted: #5b6575;
  --line: #d7deea;
  --brand: #1068d8;
  --brand-dark: #0d54ad;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #dbeafe, transparent 50%), var(--bg);
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.logout-button {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #344054;
}

.logout-button:hover:not(:disabled) {
  background: #1f2937;
}

.ui-language-block {
  display: grid;
  gap: 6px;
  min-width: 164px;
}

.ui-language-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.ui-language-select {
  min-width: 164px;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

label {
  font-weight: 600;
}

select,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

button {
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  background: var(--brand);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  background: #8da9ce;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  background: var(--brand-dark);
}

.progress,
.result,
.error {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e8edf4;
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #1f80ff, #3aa0ff);
  transition: width 0.3s ease;
}

.download {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  background: #0f766e;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}

.error {
  color: var(--danger);
  font-weight: 600;
}

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

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .card {
    padding: 18px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .header-controls {
    width: 100%;
    align-items: stretch;
  }

  .ui-language-block {
    width: 100%;
  }

  .ui-language-select {
    width: 100%;
  }

  .logout-button {
    width: 100%;
  }
}
