/* ================================================================
   Letusplay Offertgenerator – offert.css  v4.1
   Design: pill buttons, clean typography, professional spacing
================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --yellow:  #FCCA29;
  --dark:    #1a1a1a;
  --mid:     #3c3c3b;
  --gray:    #878787;
  --lgray:   #e8e8e8;
  --bg:      #f7f7f7;
  --white:   #ffffff;
  --font:    'Montserrat', sans-serif;
  --radius:  50px;
  --border:  1.5px solid var(--dark);
}

/* ── Reset & base ── */
#lup-app {
  font-family: var(--font);
  max-width: 1080px;
  margin: 0 auto;
  color: var(--dark);
}
#lup-app *, #lup-app *::before, #lup-app *::after {
  box-sizing: border-box;
}

/* ================================================================
   TABS
================================================================ */
.lup-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
  border-bottom: 1.5px solid var(--lgray);
  padding-bottom: 0;
}

.lup-tab {
  padding: .6rem 1.5rem;
  border: var(--border);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--dark) !important;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: background .18s, color .18s;
}
.lup-tab:hover {
  background: var(--dark);
  color: var(--white) !important;
}
.lup-tab.active {
  background: var(--dark);
  color: var(--white) !important;
  border-bottom-color: var(--dark);
}

/* ================================================================
   TYPOGRAPHY
================================================================ */
.lup-step-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 1.75rem;
  padding-bottom: .6rem;
  border-bottom: 2.5px solid var(--yellow);
  display: inline-block;
  color: var(--dark);
}

.lup-desc {
  font-size: .85rem;
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  max-width: 620px;
}

/* ================================================================
   FORM
================================================================ */
.lup-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 2rem;
  margin-bottom: 1.75rem;
}

.lup-label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #666;
}

.lup-label input {
  padding: .7rem 1rem;
  border: 1.5px solid var(--lgray);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 500;
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.lup-label input:focus {
  outline: none;
  border-color: var(--dark);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

/* ── Cover upload section ── */
.lup-cover-section {
  margin-bottom: 1.5rem;
}
.lup-section-label {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: .6rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #666;
}
.lup-optional {
  font-size: .72rem;
  color: #aaa;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Upload areas ── */
.lup-upload-area {
  border: 1.5px dashed var(--lgray);
  border-radius: 10px;
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color .15s, background .15s;
}
.lup-upload-area:hover,
.lup-upload-area.dragover {
  border-color: var(--dark);
  background: #f0f0f0;
}

.lup-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  color: #aaa;
  pointer-events: none;
  font-size: .82rem;
  font-weight: 500;
}
.lup-upload-icon { font-size: 1.5rem; }
.lup-upload-hint { font-size: .7rem; color: #ccc; }

.lup-image-preview {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}
.lup-cover-remove {
  position: absolute;
  top: .6rem;
  right: .6rem;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: .25rem .75rem;
  font-family: var(--font);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.lup-cover-remove:hover { background: #333; }

/* ── Price toggle ── */
.lup-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--mid);
  padding: .5rem 0;
  user-select: none;
}
.lup-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--dark);
  cursor: pointer;
}

/* ── Editing badge ── */
.lup-editing-badge {
  background: #f5f5f5;
  border: 1.5px solid var(--lgray);
  color: #666;
  padding: .3rem 1rem;
  border-radius: var(--radius);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ================================================================
   BUTTONS  – pill shape, consistent dark/outline system
================================================================ */
.lup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.75rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--dark);
  cursor: pointer;
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s, transform .1s;
  line-height: 1;
  background: var(--dark);
  color: var(--white);
}
.lup-btn:active { transform: scale(.97); }
.lup-btn:disabled { opacity: .4; cursor: not-allowed; }
.lup-btn:hover:not(:disabled) {
  background: transparent;
  color: var(--dark);
}

/* Primary: same as default */
.lup-btn--primary {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}
.lup-btn--primary:hover:not(:disabled) {
  background: transparent;
  color: var(--dark);
}

/* Secondary: same styling – consistent system */
.lup-btn--secondary {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}
.lup-btn--secondary:hover:not(:disabled) {
  background: transparent;
  color: var(--dark);
}

/* Danger */
.lup-btn--danger {
  background: var(--white);
  color: #991b1b;
  border-color: #991b1b;
}
.lup-btn--danger:hover:not(:disabled) {
  background: #991b1b;
  color: var(--white);
}

/* Sizes */
.lup-btn--sm   { padding: .65rem 1.75rem; font-size: .72rem; }
.lup-btn--wide { width: 100%; margin-top: 1.1rem; }

/* ================================================================
   SEARCH
================================================================ */
.lup-search {
  width: 100%;
  padding: .7rem 1.1rem;
  border: 1.5px solid var(--lgray);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  box-sizing: border-box;
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
}
.lup-search:focus {
  outline: none;
  border-color: var(--dark);
  box-shadow: 0 0 0 3px rgba(0,0,0,.05);
}

/* ================================================================
   PRODUCT GRID
================================================================ */
.lup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: .25rem;
  margin-bottom: 1rem;
}

.lup-loading-msg {
  grid-column: 1/-1;
  text-align: center;
  color: #aaa;
  padding: 3rem;
  font-size: .88rem;
}

.lup-card {
  border: 1.5px solid var(--lgray);
  border-radius: 10px;
  padding: .7rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
  background: var(--white);
  user-select: none;
}
.lup-card:hover  {
  border-color: var(--dark);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.lup-card.selected {
  border-color: var(--dark);
  background: #f5f5f5;
}

.lup-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
  display: block;
  margin-bottom: .5rem;
}
.lup-card__no-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: .68rem;
  margin-bottom: .5rem;
}
.lup-card__name {
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .15rem;
  color: var(--dark);
}
.lup-card__sku {
  font-size: .67rem;
  color: #aaa;
  margin-bottom: .3rem;
}
.lup-card__badge {
  position: absolute;
  top: .45rem;
  right: .45rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--white);
  font-size: .7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.lup-card.selected .lup-card__badge { opacity: 1; }

/* Price inputs */
.lup-card__price-row {
  display: flex;
  gap: .3rem;
  margin-top: .4rem;
}
.lup-card__price-row--hint {
  font-size: .63rem;
  color: #bbb;
  font-style: italic;
}
.lup-qty-input,
.lup-price-input {
  width: 50%;
  padding: .25rem .4rem;
  border: 1.5px solid var(--lgray);
  border-radius: 5px;
  font-family: var(--font);
  font-size: .7rem;
  font-weight: 500;
  color: var(--dark);
}
.lup-qty-input:focus,
.lup-price-input:focus {
  outline: none;
  border-color: var(--dark);
}

/* ================================================================
   BOTTOM BAR
================================================================ */
.lup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 .5rem;
  border-top: 1.5px solid var(--lgray);
  position: sticky;
  bottom: 0;
  background: var(--white);
  z-index: 10;
}
#lup-count {
  font-size: .82rem;
  font-weight: 600;
  color: #888;
}

/* ================================================================
   NOTICES
================================================================ */
.lup-notice {
  padding: .8rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: .82rem;
  font-weight: 500;
}
.lup-notice--info { background: #f0f4ff; border: 1.5px solid #c7d2fe; color: #3730a3; }
.lup-notice--ok   { background: #f0fdf4; border: 1.5px solid #bbf7d0; color: #166534; }
.lup-notice--warn { background: #fffbeb; border: 1.5px solid #fde68a; color: #92400e; }

/* ================================================================
   MATCH RESULTS
================================================================ */
.lup-results-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 2rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1.5px solid var(--lgray);
  color: var(--dark);
}

.lup-prev-matches-banner {
  background: #fafafa;
  border: 1.5px solid var(--lgray);
  color: #666;
  padding: .7rem 1rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .75rem;
}

.lup-match-card {
  display: flex;
  gap: 1.1rem;
  padding: 1.1rem;
  border: 1.5px solid var(--lgray);
  border-radius: 10px;
  margin-bottom: .75rem;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.lup-match-card:hover {
  border-color: var(--dark);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.lup-match-card--previous {
  background: #fafafa;
  border-color: #e0e0e0;
}

.lup-match-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg);
  flex-shrink: 0;
}
.lup-match-no-img {
  width: 80px;
  height: 80px;
  background: var(--bg);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: .68rem;
}

.lup-match-info   { flex: 1; min-width: 0; }
.lup-match-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .35rem;
}
.lup-match-name { font-weight: 700; font-size: .9rem; color: var(--dark); }
.lup-match-sku  { font-size: .72rem; color: #aaa; margin-bottom: .4rem; }

.lup-score {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .8rem;
  color: var(--white);
}
.lup-score--high   { background: #16a34a; }
.lup-score--medium { background: var(--dark); }
.lup-score--low    { background: #9ca3af; }

.lup-match-specs {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: .5rem;
}
.mc-spec { font-size: .72rem; color: #666; }

.lup-match-reason {
  font-size: .77rem;
  color: #666;
  line-height: 1.5;
  background: var(--bg);
  padding: .4rem .65rem;
  border-radius: 5px;
  border-left: 2.5px solid var(--lgray);
  margin-bottom: .5rem;
}
.lup-match-actions { margin-top: .4rem; }

/* ================================================================
   LOADING / SPINNER
================================================================ */
.lup-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem;
  gap: 1.1rem;
  color: #888;
  font-size: .85rem;
}
.lup-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--lgray);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: lup-spin .7s linear infinite;
}
@keyframes lup-spin { to { transform: rotate(360deg); } }
.lup-loading-sub { font-size: .75rem; color: #bbb; margin-top: -.5rem; }

.lup-progress-wrap {
  width: 100%;
  max-width: 260px;
  height: 4px;
  background: var(--lgray);
  border-radius: 2px;
  overflow: hidden;
}
.lup-progress-bar {
  height: 100%;
  background: var(--dark);
  border-radius: 2px;
  width: 0%;
  transition: width .3s;
}

/* ================================================================
   OFFER HISTORY
================================================================ */
.lup-history-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.lup-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 1.4rem;
  border: 1.5px solid var(--lgray);
  border-radius: 10px;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.lup-history-card:hover {
  border-color: var(--dark);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.lup-history-info { flex: 1; min-width: 0; }
.lup-history-name {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .3rem;
  color: var(--dark);
}
.lup-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  font-size: .75rem;
  color: #aaa;
  font-weight: 500;
}
.lup-history-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}

/* ================================================================
   TEXTAREA
================================================================ */
.lup-textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--lgray);
  border-radius: 8px;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  resize: vertical;
  color: var(--dark);
  transition: border-color .15s;
  box-sizing: border-box;
  background: var(--white);
}
.lup-textarea:focus {
  outline: none;
  border-color: var(--dark);
  box-shadow: 0 0 0 3px rgba(0,0,0,.05);
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 640px) {
  .lup-form-grid  { grid-template-columns: 1fr; }
  .lup-grid       { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .lup-bar        { flex-wrap: wrap; }
  .lup-history-card { flex-direction: column; align-items: flex-start; }
  .lup-tabs       { flex-wrap: wrap; }
}

/* ── Card extra fields (position + prescribed image) ── */
.lup-card__extra {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--lgray);
}
.lup-card__extra-row { display: flex; flex-direction: column; gap: .2rem; }
.lup-card__extra-lbl {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gray);
}
.lup-pos-input {
  width: 100%;
  padding: .3rem .5rem;
  border: 1.5px solid var(--lgray);
  border-radius: 5px;
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 600;
  color: var(--dark);
  background: var(--white);
}
.lup-pos-input:focus {
  outline: none;
  border-color: var(--dark);
}
.lup-card__upload-btn {
  display: inline-block;
  padding: .25rem .6rem;
  border: 1.5px solid var(--dark);
  border-radius: 50px;
  font-family: var(--font);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--dark);
  background: var(--white);
  transition: all .15s;
  margin-top: .2rem;
}
.lup-card__upload-btn:hover {
  background: var(--dark);
  color: var(--white);
}

/* ================================================================
   SELECTED PRODUCTS LIST
================================================================ */
.lup-selected-title {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gray);
  margin: 1.5rem 0 .75rem;
  padding-top: 1.25rem;
  border-top: 1.5px solid var(--lgray);
}

.lup-sel-row {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: .85rem;
  border: 1.5px solid var(--lgray);
  border-radius: 10px;
  margin-bottom: .6rem;
  background: var(--white);
  transition: border-color .15s;
}
.lup-sel-row:hover { border-color: #ccc; }

.lup-sel-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}
.lup-sel-thumb--empty {
  width: 56px;
  height: 56px;
  background: var(--bg);
  border-radius: 6px;
  flex-shrink: 0;
}

.lup-sel-info { flex: 1; min-width: 0; }
.lup-sel-name { font-size: .82rem; font-weight: 700; color: var(--dark); margin-bottom: .1rem; }
.lup-sel-sku  { font-size: .7rem; color: var(--gray); margin-bottom: .6rem; }

.lup-sel-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem .85rem;
}

.lup-sel-lbl {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gray);
}

.lup-pos-input {
  padding: .4rem .65rem;
  border: 1.5px solid var(--lgray);
  border-radius: 6px;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
}
.lup-pos-input:focus { outline: none; border-color: var(--dark); }

/* Prescribed image area */
.lup-pres-upload-area {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.lup-pres-mini {
  width: 48px;
  height: 36px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--lgray);
  display: block;
  flex-shrink: 0;
}
.lup-pres-mini--empty {
  width: 48px;
  height: 36px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px dashed var(--lgray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .58rem;
  color: #bbb;
  flex-shrink: 0;
}

.lup-pres-upload-btn {
  padding: .3rem .7rem;
  border: 1.5px solid var(--dark);
  border-radius: 50px;
  font-family: var(--font);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--dark);
  background: var(--white);
  transition: all .15s;
  white-space: nowrap;
}
.lup-pres-upload-btn:hover { background: var(--dark); color: var(--white); }

.lup-pres-clear {
  font-size: .62rem;
  color: var(--gray);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  text-decoration: underline;
}
.lup-pres-clear:hover { color: #991b1b; }

/* Remove button */
.lup-sel-remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--lgray);
  background: var(--white);
  color: var(--gray);
  cursor: pointer;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.lup-sel-remove:hover { border-color: #991b1b; color: #991b1b; background: #fee2e2; }

/* ── Card inline extras (position + prescribed image) ── */
.lup-card-extras {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--lgray);
}
.lup-card-extras__lbl {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: .2rem;
  display: block;
}
.lup-pos-input {
  width: 100%;
  padding: .3rem .55rem;
  border: 1.5px solid var(--lgray);
  border-radius: 5px;
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 600;
  color: var(--dark);
  background: var(--white);
  box-sizing: border-box;
}
.lup-pos-input:focus { outline: none; border-color: var(--dark); }
.lup-card-extras__upload {
  display: inline-block;
  padding: .4rem 1rem;
  border: 1.5px solid var(--dark);
  border-radius: 50px;
  font-family: var(--font);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--white);
  background: var(--dark);
  transition: all .15s;
}
.lup-card-extras__upload:hover { background: transparent; color: var(--dark); }
.lup-card-extras__clear {
  font-size: .58rem;
  color: #bbb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  text-decoration: underline;
}
.lup-card-extras__clear:hover { color: #991b1b; }
