:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee9;
  --brand: #1769e0;
  --brand-dark: #0e4fb3;
  --accent: #12b981;
  --danger: #c83232;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(23, 105, 224, 0.14), transparent 34rem),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero {
  padding: 18px 2px 24px;
}

.hero-content {
  display: grid;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
}

.language-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 54px;
  height: 30px;
  border: 1px solid rgba(23, 105, 224, 0.22);
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 8px 20px rgba(23, 32, 51, 0.08);
}

.toggle-track::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--brand);
  content: "";
  transition: transform 160ms ease;
}

.language-toggle input:checked + .toggle-track::after {
  transform: translateX(24px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.04;
}

h1 {
  max-width: 660px;
  font-size: clamp(2.15rem, 9vw, 4.4rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1.15rem;
}

.hero-copy {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.generator,
.result-panel,
.qr-panel {
  border: 1px solid rgba(216, 222, 233, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.generator {
  margin-top: 22px;
  overflow: hidden;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: #edf2f9;
}

.mode-tab {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4d5a6f;
  font-weight: 750;
  cursor: pointer;
}

.mode-tab.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.1);
}

.form-stack {
  padding: 18px;
}

.form-panel {
  display: none;
}

.form-panel.active {
  display: grid;
  gap: 16px;
}

.field,
.check-field {
  display: grid;
  gap: 8px;
}

.field span,
.check-field span {
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 13px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(23, 105, 224, 0.72);
  box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.12);
}

.field-grid {
  display: grid;
  gap: 14px;
}

.check-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.advanced {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.advanced summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.advanced .field-grid {
  margin-top: 14px;
}

.form-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-message.ok {
  color: #087a52;
}

.result-panel {
  margin-top: 18px;
  padding: 18px;
}

.qr-panel {
  margin-top: 18px;
  padding: 18px;
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.url-length {
  border-radius: 999px;
  background: #eef6ff;
  color: var(--brand);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.url-length.warning {
  background: #fff1f1;
  color: var(--danger);
}

.result-url {
  min-height: 128px;
  background: #0f172a;
  color: #e7edf7;
  line-height: 1.55;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}

.button.primary {
  background: var(--brand);
  color: #fff;
}

.button.primary:hover {
  background: var(--brand-dark);
}

.button.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button[disabled],
.button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.qr-box {
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.qr-code {
  display: grid;
  place-items: center;
  width: min(100%, 280px);
  aspect-ratio: 1;
}

.qr-code canvas,
.qr-code img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.qr-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.seo-content {
  margin-top: 18px;
  padding: 8px 2px 0;
}

.seo-content h2 {
  font-size: 1.25rem;
}

.seo-content p {
  color: var(--muted);
  line-height: 1.7;
}

.seo-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.seo-grid article {
  border: 1px solid rgba(216, 222, 233, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  padding: 16px;
}

.seo-grid h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.seo-grid p {
  margin: 0;
  font-size: 0.93rem;
}

@media (min-width: 680px) {
  .app-shell {
    padding: 42px 24px 60px;
  }

  .hero {
    padding-top: 26px;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .mode-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-stack,
  .result-panel,
  .qr-panel {
    padding: 24px;
  }

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

  .field-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .actions {
    grid-template-columns: 180px 180px;
  }

  .seo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
