:root {
  --bg-base: #222127;
  --bg-card: rgba(40, 39, 49, 0.9);
  --bg-card-strong: #2a2932;
  --text-main: #f7f7f7;
  --text-muted: #c6c8d8;
  --line-soft: rgba(247, 247, 247, 0.15);
  --accent-main: #5464ff;
  --accent-alt: #7c88ff;
  --accent-main-strong: #8f9aff;
  --danger: #ff6670;
  --ok: #69d4a4;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.36);
  --radius-lg: 20px;
  --radius-md: 12px;
  --container: 1060px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--text-main);
  background: linear-gradient(145deg, #222127 0%, #1b1a20 100%);
  line-height: 1.4;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  filter: blur(1px);
  animation: floatSquare 11s ease-in-out infinite;
  --shape-rot: 0deg;
}

.bg-shape-a {
  width: 250px;
  height: 250px;
  top: 62px;
  right: 6%;
  border-radius: 8px;
  background: linear-gradient(165deg, rgba(84, 100, 255, 0.3), rgba(84, 100, 255, 0.1));
  --shape-rot: 8deg;
}

.bg-shape-b {
  width: 190px;
  height: 190px;
  bottom: 9%;
  left: 5%;
  border-radius: 6px;
  background: linear-gradient(165deg, rgba(84, 100, 255, 0.24), rgba(84, 100, 255, 0.08));
  --shape-rot: -7deg;
  animation-duration: 13s;
}

.container {
  width: min(var(--container), 92vw);
  margin-inline: auto;
}

.hero {
  padding: 2.6rem 0 1.2rem;
  animation: riseIn 480ms ease-out both;
}

.hero-title {
  margin: 0;
  font-family: "Syne", "Outfit", sans-serif;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  line-height: 1.1;
}

.hero-subline {
  margin-top: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.lang-switch {
  margin-top: 1rem;
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(42, 41, 50, 0.9);
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font: 600 0.82rem/1 "Outfit", sans-serif;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.lang-btn[aria-pressed="true"] {
  background: var(--accent-main);
  color: #ffffff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(290px, 760px);
  justify-content: center;
  padding-bottom: 1.2rem;
}

.panel {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1rem;
  animation: riseIn 540ms ease-out both;
}

.row {
  margin-top: 0.95rem;
  display: grid;
  gap: 12px;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field + .field {
  margin-top: 0.9rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.72rem;
  background: var(--bg-card-strong);
  color: var(--text-main);
  font: 500 0.94rem/1.35 "Outfit", sans-serif;
}

select:focus,
input:focus,
textarea:focus {
  outline: 2px solid rgba(84, 100, 255, 0.45);
  outline-offset: 1px;
}

textarea {
  resize: vertical;
}

::placeholder {
  color: var(--text-muted);
}

#output,
#langOutput {
  background: rgba(42, 41, 50, 0.94);
}

.actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.62rem;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  width: 100%;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 600 0.94rem/1 "Outfit", sans-serif;
  padding: 0.74rem 1rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.btn-primary {
  background: linear-gradient(150deg, var(--accent-main), #3949db);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(84, 100, 255, 0.31);
}

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

.btn-ghost {
  background: #2f2e38;
  color: var(--text-main);
  border-color: var(--line-soft);
}

.btn-ghost:hover:not(:disabled) {
  background: #383744;
}

.status {
  min-height: 1.2rem;
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer {
  padding: 0.2rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.footer a {
  color: var(--accent-main-strong);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-credit {
  margin: 0.45rem 0 0;
}

.footer-sep {
  opacity: 0.6;
  margin: 0 0.3rem;
}

.hidden {
  display: none;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatSquare {
  0%,
  100% {
    transform: translateY(0) rotate(var(--shape-rot));
  }
  50% {
    transform: translateY(-10px) rotate(calc(var(--shape-rot) + 2deg));
  }
}
