:root {
  --brand: #0090bb;
  --brand-deep: #066f8e;
  --brand-soft: #dff5fb;
  --brand-mist: #f2fbfe;
  --ink: #113649;
  --muted: #5f7c8b;
  --line: rgba(0, 144, 187, 0.14);
  --danger: #c53939;
  --white: #ffffff;
  --shadow-lg: 0 30px 80px rgba(8, 71, 92, 0.16);
  --shadow-md: 0 16px 42px rgba(8, 71, 92, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 28%),
    radial-gradient(circle at bottom right, rgba(0, 144, 187, 0.14), transparent 26%),
    linear-gradient(145deg, #eaf8fd, #f7fcfe 55%, #edf8fb);
}

.page-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
}

.ambient-one {
  top: -120px;
  left: -40px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(0, 144, 187, 0.20), transparent 72%);
}

.ambient-two {
  right: -100px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 144, 187, 0.14), transparent 72%);
}

.card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(320px, 620px);
  width: min(1120px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 34px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.brand-panel {
  padding: 24px 22px;
  background:
    linear-gradient(180deg, rgba(0, 144, 187, 0.08), rgba(0, 144, 187, 0.03)),
    linear-gradient(145deg, #f4fcff, #e9f8fd);
  border-right: 1px solid var(--line);
}

.brand-top {
  display: grid;
  gap: 12px;
}

.brand-logo {
  width: min(100%, 210px);
  height: auto;
  object-fit: contain;
}

.brand-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.08;
}

.brand-text,
.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.info-card {
  margin-top: 14px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 144, 187, 0.12);
  box-shadow: var(--shadow-md);
}

.info-card-soft {
  background: linear-gradient(180deg, rgba(0, 144, 187, 0.08), rgba(255, 255, 255, 0.92));
}

.info-card strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 1.05rem;
}

.info-label {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.content-panel {
  padding: 22px;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(0, 144, 187, 0.12);
}

.language-switcher {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: #f4fbfe;
  box-shadow: inset 0 0 0 1px rgba(0, 144, 187, 0.1);
}

.language-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.language-btn:hover,
.language-btn:focus-visible {
  background: rgba(0, 144, 187, 0.08);
  color: var(--ink);
  outline: none;
}

.language-btn.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 10px 20px rgba(0, 144, 187, 0.22);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.subtitle {
  max-width: 580px;
  margin-bottom: 18px;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.5;
}

.stacked-form {
  display: grid;
  gap: 14px;
  max-width: 360px;
}

.input-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.field-label {
  font-weight: 700;
}

.text-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 144, 187, 0.18);
  border-radius: 18px;
  background: var(--white);
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.text-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 144, 187, 0.14);
  outline: none;
}

.barcode-input {
  text-align: center;
  font-size: clamp(1.12rem, 2.4vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.action-row {
  display: flex;
  justify-content: center;
}

.primary-btn,
.secondary-btn {
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
  color: var(--white);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 16px 28px rgba(0, 144, 187, 0.24);
}

.secondary-btn {
  color: var(--brand-deep);
  background: rgba(0, 144, 187, 0.1);
}

.primary-btn:hover,
.primary-btn:focus-visible,
.secondary-btn:hover,
.secondary-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.error-text {
  margin-top: 12px;
  font-weight: 700;
  color: var(--danger);
}

.preview-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(0, 144, 187, 0.05), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(0, 144, 187, 0.12);
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.preview-header h2 {
  margin-bottom: 6px;
  font-size: 1.12rem;
}

.preview-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.label-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 144, 187, 0.09);
  color: var(--brand-deep);
  font-weight: 800;
}

.label-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 210px;
  padding: 14px 14px 12px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 255, 0.98));
  box-shadow: inset 0 0 0 1px rgba(0, 144, 187, 0.08);
}

.product-name-preview {
  min-height: 1.5em;
  max-width: 100%;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  color: #000000;
  word-break: break-word;
}

#barcode-preview {
  width: min(100%, 430px);
  max-width: 100%;
  height: 88px;
  flex: 0 0 88px;
}

.barcode-text {
  min-height: 1.4em;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
  word-break: break-all;
}

.preview-footer {
  margin-top: 2px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

@media (max-height: 780px) and (min-width: 641px) {
  .page-shell {
    padding: 12px;
  }

  .card {
    max-height: calc(100vh - 24px);
  }

  .brand-panel,
  .content-panel {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .brand-logo {
    width: min(100%, 180px);
  }

  .brand-copy h2 {
    font-size: 1.3rem;
  }

  .brand-text,
  .info-card p,
  .subtitle,
  .preview-subtitle {
    font-size: 0.9rem;
  }

  .info-card {
    margin-top: 10px;
    padding: 12px;
  }

  .content-toolbar {
    margin-bottom: 10px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    margin-bottom: 14px;
  }

  .preview-panel {
    margin-top: 14px;
    padding: 14px;
  }

  .label-preview {
    min-height: 184px;
    padding: 12px 12px 10px;
  }

  #barcode-preview {
    height: 78px;
    flex-basis: 78px;
  }

  .barcode-text {
    font-size: 1.04rem;
  }

  .preview-footer {
    font-size: 0.72rem;
  }
}

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

  .brand-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 10px;
    align-items: stretch;
  }

  .ambient {
    display: none;
  }

  .card {
    display: flex;
    flex-direction: column;
    border-radius: 24px;
  }

  .content-panel,
  .brand-panel {
    padding: 18px 16px;
  }

  .content-panel {
    order: 1;
  }

  .brand-panel {
    order: 2;
    background: linear-gradient(180deg, #f7fcfe, #eef9fd);
  }

  .brand-top {
    gap: 12px;
  }

  .brand-logo {
    width: 170px;
  }

  .brand-copy h2 {
    font-size: 1.4rem;
  }

  .brand-text {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .info-card {
    margin-top: 14px;
    padding: 14px 14px 12px;
    border-radius: 18px;
    box-shadow: none;
  }

  .content-toolbar,
  .preview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .content-toolbar {
    margin-bottom: 16px;
  }

  .language-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .language-btn {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
  }

  h1 {
    font-size: 1.9rem;
  }

  .subtitle {
    margin-bottom: 20px;
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .text-input,
  .primary-btn,
  .secondary-btn {
    min-height: 54px;
    border-radius: 16px;
  }

  .preview-panel {
    margin-top: 22px;
    padding: 16px;
    border-radius: 22px;
  }

  .label-preview {
    min-height: 220px;
    padding: 16px 12px 14px;
    gap: 8px;
  }

  #barcode-preview {
    width: 100%;
    height: 96px;
    flex-basis: 96px;
  }

  .product-name-preview {
    font-size: 0.94rem;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

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

  .action-row {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .brand-copy h2 {
    font-size: 1.25rem;
  }

  .brand-text,
  .info-card p,
  .subtitle,
  .preview-subtitle {
    font-size: 0.9rem;
  }

  .label-size,
  .hero-badge {
    font-size: 0.82rem;
  }

  .barcode-text {
    font-size: 0.98rem;
  }

  .preview-footer {
    font-size: 0.76rem;
  }
}

@page {
  size: 58mm 40mm;
  margin: 0;
}

@media print {
  html,
  body {
    width: 58mm;
    height: 40mm;
    margin: 0;
    background: #fff;
  }
}
