* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #e7eef3;
  background:
    radial-gradient(circle at 84% 12%, rgba(118, 72, 190, 0.24), transparent 34%),
    linear-gradient(135deg, rgba(0, 123, 167, 0.22), rgba(58, 42, 88, 0.34) 36%, rgba(20, 28, 36, 0.95) 58%, rgba(10, 15, 21, 0.98)),
    #0a0f15;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  padding: 20px 0 28px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 26px;
  color: #62c8e8;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #0d9488;
  outline-offset: 3px;
}

.site-name {
  margin: 0 0 10px;
  color: #9baab6;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  color: #f5f8fb;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p:last-child {
  max-width: 720px;
  margin: 18px 0 0;
  color: #b6c4ce;
  font-size: 1.1rem;
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid #273746;
  border-radius: 8px;
  background: rgba(15, 23, 31, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.input-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  color: #d9e3ea;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #334655;
  border-radius: 7px;
  background: #111b24;
  color: #f0f5f8;
  font: inherit;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  padding: 12px;
  line-height: 1.5;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 7px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0f766e;
  background: #007ba7;
  color: #ffffff;
}

.secondary-button {
  border: 1px solid #3b5264;
  background: #172532;
  color: #dce8ef;
}

.result-panel {
  min-height: 464px;
  padding: 22px;
}

.empty-state {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #3b5264;
  border-radius: 8px;
  color: #9fb0bd;
  text-align: center;
}

.empty-state strong {
  color: #eef5f8;
  font-size: 1.3rem;
}

.result {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: 8px;
  background: #081016;
  border: 1px solid #273746;
}

.qr-frame img {
  display: block;
  max-width: 100%;
  height: auto;
}

.result-copy h2 {
  margin: 4px 0 10px;
  color: #f5f8fb;
  font-size: 1.75rem;
  line-height: 1.15;
}

.result-copy p {
  color: #b6c4ce;
  line-height: 1.6;
}

.target-line {
  display: grid;
  gap: 6px;
  word-break: break-word;
}

.target-line span {
  color: #8fa1ae;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.target-line a {
  color: #62c8e8;
  font-weight: 800;
}

.status-line {
  min-height: 24px;
  margin: 18px 0 0;
  color: #9baab6;
  font-size: 0.92rem;
}

.watermark {
  position: fixed;
  right: 16px;
  bottom: 12px;
  color: rgba(214, 226, 234, 0.38);
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 20px;
  }

  .workspace,
  .result {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: 0;
  }

  .empty-state {
    min-height: 220px;
  }

  .qr-frame {
    min-height: 0;
    padding: 16px;
  }
}

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

  .actions,
  .result-actions {
    flex-direction: column;
  }

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