:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f6fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 35%),
    linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  color: #111827;
  padding: 1rem;
}

.page-shell {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
}

.app-card {
  width: 100%;
  max-width: 760px;
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
}

.language-switcher {
  display: inline-flex;
  flex-direction: column;
  font-size: 0.95rem;
  color: #475569;
  font-weight: 600;
}

.language-switcher select {
  width: auto;
  min-width: 160px;
  margin-top: 0.5rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  line-height: 1.05;
}

.hero p {
  margin: 0.8rem 0 0;
  color: #4b5563;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.7;
}

form {
  width: 100%;
}

label {
  display: block;
  margin-top: 1.2rem;
  font-weight: 600;
  color: #1f2937;
}

input,
select {
  width: 100%;
  padding: 0.95rem 1rem;
  margin-top: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  font-size: 1rem;
  color: #111827;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 14px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.result,
.status-box {
  width: 100%;
  margin-top: 1.5rem;
  border-radius: 18px;
}

.result {
  padding: 1.2rem 1.25rem;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.status-box {
  padding: 1rem 1.1rem;
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.14);
  display: none;
}

.status-box.active {
  display: block;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.75rem;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-container {
  margin-top: 0.95rem;
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #2563eb;
  width: 0%;
  transition: width 0.3s ease;
}

.controls {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.controls button {
  flex: 1;
  min-width: 150px;
}

.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

#transcript-output {
  margin-top: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.75;
  color: #111827;
}

@media (max-width: 680px) {
  .app-card {
    padding: 1.4rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .controls {
    flex-direction: column;
  }

  .controls button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  body {
    padding: 0.7rem;
  }

  .app-card {
    border-radius: 20px;
  }

  input,
  select,
  button {
    font-size: 0.98rem;
  }
}
