:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #172033;
  background: #f3f6fb;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 15%, rgba(88, 114, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 85% 82%, rgba(35, 186, 151, 0.10), transparent 28rem),
    #f3f6fb;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 44px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #61708d;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 760;
}

.subtitle {
  margin: 18px 0 0;
  color: #66728a;
  font-size: 1.02rem;
}

.badge {
  flex: 0 0 auto;
  margin-bottom: 5px;
  padding: 9px 12px;
  border: 1px solid #dce2ee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #6d7890;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.badge.ready {
  color: #116c54;
  border-color: #cae9df;
  background: #eefaf6;
}

.badge.warning {
  color: #985100;
  border-color: #f2dfbd;
  background: #fff8ea;
}

.translator-card {
  overflow: hidden;
  border: 1px solid #dce3ef;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 22px 70px rgba(28, 43, 75, 0.10),
    0 2px 8px rgba(28, 43, 75, 0.04);
}

.language-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  padding: 0 26px;
  border-bottom: 1px solid #e5eaf2;
  color: #293650;
  font-size: 0.92rem;
  font-weight: 720;
}

.language-row span:last-child {
  padding-left: 6px;
}

.arrow {
  color: #9aa6ba;
}

.panes {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  min-height: 360px;
}

.divider {
  background: #e8edf4;
}

.pane {
  display: flex;
  flex-direction: column;
  padding: 24px 26px 20px;
}

.pane label {
  margin-bottom: 12px;
  color: #748199;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  flex: 1;
  min-height: 250px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #19243a;
  font-size: 1.22rem;
  line-height: 1.65;
}

textarea::placeholder {
  color: #aab4c5;
}

.output {
  flex: 1;
  min-height: 250px;
  color: #19243a;
  font-size: 1.22rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.placeholder {
  color: #aab4c5;
}

.pane-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-top: 12px;
  color: #98a3b7;
  font-size: 0.78rem;
}

.output-footer {
  justify-content: flex-end;
}

.text-button {
  border: 0;
  padding: 5px 0;
  background: transparent;
  color: #5d6b84;
  font-weight: 700;
}

.text-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-top: 1px solid #e5eaf2;
  background: #f9fbfe;
}

.status {
  margin: 0;
  color: #7a869c;
  font-size: 0.85rem;
}

.status.error {
  color: #a83c3c;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 130px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 20px;
  background: #1f2a44;
  color: #fff;
  font-weight: 760;
  box-shadow: 0 8px 20px rgba(31, 42, 68, 0.18);
  transition: transform 120ms ease, opacity 120ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.64;
  cursor: default;
}

.spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.primary-button.loading .spinner {
  display: inline-block;
}

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

.footnote {
  margin: 16px 5px 0;
  color: #8a96aa;
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 24px, 1100px);
    padding-top: 38px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .badge {
    margin: 0;
  }

  .language-row {
    grid-template-columns: 1fr auto 1fr;
    padding-inline: 20px;
  }

  .panes {
    grid-template-columns: 1fr;
  }

  .divider {
    width: 100%;
    height: 1px;
  }

  .pane {
    min-height: 300px;
    padding-inline: 20px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

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