:root {
  --gold: #c19941;
  --gold-dark: #a07c2a;
  --navy: #0b1c33;
  --navy-light: #0a2850;
  --paper: #f5f6f8;
  --line: #e8e9ec;
  --text: #4a4a4a;
  --white: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
}

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

button {
  min-height: 44px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--gold-dark);
  color: var(--white);
}

button.secondary {
  background: var(--white);
  color: var(--navy);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 4px solid var(--gold);
  background: var(--navy);
  color: var(--white);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 240px;
  gap: 12px;
}

.brand img {
  width: 54px;
  height: 46px;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--gold);
  font-size: 12px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 310px;
  padding: 52px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.5;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.hero-stats span {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: var(--white);
  text-align: center;
}

.hero-stats strong {
  color: var(--navy);
  font-size: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.panel,
.band {
  border-left: 6px solid var(--gold);
  background: var(--white);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 14px 35px rgba(11, 28, 51, 0.08);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}

.section-title span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--navy);
  color: var(--gold);
  font-weight: 700;
}

h2,
h3 {
  color: var(--navy);
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--navy);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text);
  padding: 10px 12px;
}

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

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(193, 153, 65, 0.32);
  outline-offset: 2px;
}

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

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

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.actions,
.download-grid,
.history-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-panel {
  position: sticky;
  top: 96px;
}

.qr-stage {
  display: grid;
  place-items: center;
  min-height: 380px;
  padding: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, #f0f1f3 25%, transparent 25%),
    linear-gradient(-45deg, #f0f1f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f1f3 75%),
    linear-gradient(-45deg, transparent 75%, #f0f1f3 75%);
  background-color: var(--white);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

#qr-canvas {
  max-width: 100%;
  height: auto;
  background: var(--white);
}

#caption-preview {
  margin: 12px 0 0;
  color: var(--navy);
  font-weight: 700;
  text-align: center;
}

#status {
  min-height: 24px;
  color: var(--gold-dark);
  font-weight: 700;
}

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

.band {
  margin-top: 20px;
}

.history-toolbar {
  grid-template-columns: minmax(0, 1fr) 120px;
  margin-bottom: 14px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
}

.history-item strong,
.history-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item strong {
  color: var(--navy);
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.roadmap-grid article {
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  padding: 18px;
}

.roadmap-grid p {
  line-height: 1.5;
}

@media (max-width: 900px) {
  .app-header,
  .hero,
  .workspace,
  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .app-header {
    align-items: flex-start;
  }

  nav {
    justify-content: flex-start;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .app-header {
    padding: 12px;
  }

  .hero {
    min-height: auto;
    padding: 34px 0 24px;
  }

  .hero-stats,
  .fields-grid.two,
  .actions,
  .download-grid,
  .history-toolbar {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 36px;
  }

  .qr-stage {
    min-height: 300px;
  }
}

@media print {
  body > *:not(main),
  .form-panel,
  .band,
  #status,
  .download-grid {
    display: none !important;
  }

  main,
  .workspace,
  .preview-panel {
    display: block;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: 0;
  }
}
