:root {
  color-scheme: light;
  --bg: #f4f7f1;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #65716b;
  --line: #d8ded6;
  --field: #fbfcfa;
  --accent: #0d7a67;
  --accent-strong: #095c4d;
  --accent-soft: #d9f36a;
  --danger: #a9362b;
  --shadow: 0 24px 70px rgba(23, 32, 27, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  letter-spacing: 0;
  background:
    linear-gradient(120deg, rgba(217, 243, 106, 0.18), transparent 34%),
    linear-gradient(160deg, transparent 54%, rgba(13, 122, 103, 0.12)),
    var(--bg);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(290px, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 40px 0;
}

.tool-panel,
.qr-stage {
  border: 1px solid rgba(23, 32, 27, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tool-panel {
  border-radius: 8px;
  padding: clamp(22px, 4vw, 36px);
}

.title-block {
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.5rem);
  line-height: 0.94;
  font-weight: 850;
}

.url-form {
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--field);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 122, 103, 0.14);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(9, 92, 77, 0.2);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.message.is-error {
  color: var(--danger);
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.actions button {
  min-width: 0;
  color: var(--ink);
  background: var(--accent-soft);
}

.actions button:hover {
  background: #c8e952;
  box-shadow: 0 8px 18px rgba(118, 145, 31, 0.2);
}

.qr-stage {
  min-height: min(680px, calc(100vh - 80px));
  border-radius: 8px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: clamp(22px, 5vw, 56px);
  background:
    linear-gradient(45deg, rgba(23, 32, 27, 0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 32, 27, 0.045) 25%, transparent 25%),
    #fdfefc;
  background-position:
    0 0,
    0 14px;
  background-size: 28px 28px;
}

.qr-output {
  width: min(100%, 460px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 22px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.qr-output svg {
  width: 100%;
  height: 100%;
  display: block;
}

.result-meta {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(20px, 4vw, 32px);
  border-top: 1px solid rgba(23, 32, 27, 0.08);
  color: var(--muted);
  background: #ffffff;
  font-size: 0.95rem;
  font-weight: 760;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 560px);
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 24px 0;
  }

  .qr-stage {
    min-height: auto;
  }

  .qr-frame {
    min-height: 330px;
  }
}

@media (max-width: 460px) {
  .input-row,
  .actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3rem;
  }

  .result-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
