/* Base layout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #1f2933;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #b22222;
  color: #ffffff;
  font-size: 0.9rem;
}

.brand-text {
  font-size: 1rem;
}

/* Navigation */

.main-nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: #4b5563;
}

.nav-link:hover {
  background: #f3f4f6;
  color: #111827;
}

.nav-link.active {
  background: #111827;
  color: #ffffff;
}

/* Hero */

.hero {
  padding: 3rem 0 2.5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: stretch;
}

.hero-content h1 {
  font-size: clamp(1.9rem, 2.6vw, 2.4rem);
  margin: 0 0 0.75rem;
}

.hero-subtitle {
  margin: 0 0 1rem;
  color: #4b5563;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hero-list {
  list-style: disc;
  padding-left: 1.2rem;
  margin: 0;
  color: #374151;
  font-size: 0.95rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.primary-btn {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.primary-btn:hover {
  background: #000000;
  border-color: #000000;
}

.ghost-btn {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}

.ghost-btn:hover {
  background: #f3f4f6;
}

.full-width-btn {
  width: 100%;
  justify-content: center;
}

/* Hero card */

.hero-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.step-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.95rem;
}

/* Sections */

.section {
  padding: 2.5rem 0;
}

.section-muted {
  background: #f3f4f6;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h1,
.section-header h2 {
  margin: 0 0 0.5rem;
}

.section-subtitle {
  margin: 0;
  color: #4b5563;
}

/* Grid */

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.align-start {
  align-items: flex-start;
}

/* Cards */

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.small-card {
  margin-top: 1rem;
}

/* Lists */

.bullet-list {
  padding-left: 1.2rem;
  margin: 0;
}

.bullet-list li {
  margin-bottom: 0.35rem;
}

/* Text helpers */

.muted-text {
  color: #6b7280;
}

.small-text {
  font-size: 0.85rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 1.25rem 0;
  margin-top: 1rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Generate page: drop zone and controls */

.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone-title {
  margin: 0 0 0.25rem;
  font-weight: 500;
}

.drop-zone-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.drop-zone.dragover {
  border-color: #111827;
  background: #e5e7eb;
}

.upload-success {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #16a34a; /* green */
}

.file-input {
  display: none;
}

.form-row {
  margin-top: 0.75rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.status-text {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

/* Mapping UI */

.mapping-grid {
  display: grid;
  gap: 0.5rem 1rem;
}

.mapping-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.mapping-row label {
  font-size: 0.85rem;
  color: #4b5563;
}

.mapping-row select {
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.85rem;
  background: #ffffff;
}

.mapping-warning {
  box-shadow: 0 0 0 2px #b22222;
  border-radius: 12px;
  transition: box-shadow 0.2s ease;
}

/* Avery Label Layout (Fixed) */

.label-sheet-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

/* Full sheet — slightly smaller than 8.5x11 to prevent clipping */
.label-sheet {
  width: 8in;
  max-width: 100%;
  margin: 0 auto 1rem auto;
  background: #ffffff;
  padding: 0.4in 0.25in;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  page-break-after: always;
}

/* 3 x 10 grid, with slightly reduced sizes to fit print margins */
.labels-grid {
  display: grid;
  grid-template-columns: repeat(3, 2.45in);
  grid-template-rows: repeat(10, 0.95in);
  column-gap: 0.05in;
  row-gap: 0.05in;
}

/* Individual label cell */
.label-preview-item {
  height: 0.95in;
  padding: 0.05in 0.08in;
  font-size: 0.7rem;
  display: flex;
  align-items: center;     /* vertical centering */
  justify-content: center; /* horizontal centering */
  text-align: center;      /* center multiline text */
  color: #111827;
  word-wrap: break-word;
  border: 1px dashed #d1d5db;
}

/* NEW: highlight mapping card when attention is required */
.mapping-warning {
  box-shadow: 0 0 0 2px #b91c1c;
  border-radius: 12px;
  transition: box-shadow 0.2s ease;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2rem;
  }

  .site-header {
    position: static;
  }
}

/* PRINT MODE */
.print-area {
  zoom: 0.6;  /* try 0.6–0.8 depending on your preference */
}
@media print {
  body {
    margin: 0;
    padding: 0;
    background: #ffffff;
  }

  /* Hide everything except label sheets */
  body * {
    visibility: hidden !important;
  }

  .print-area,
  .print-area * {
    visibility: visible !important;
  }
  .print-area {
    zoom: 1 !important; /* reset to full size when printing */
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .label-sheet {
    box-shadow: none;
    border-radius: 0;
    margin: 0 auto;
  }

  .card,
  .section,
  .container {
    box-shadow: none;
  }
}
