/* ===== DR. EVO — distributor order form ===== */
/* Extends the tokens in /style.css (--yellow, --cream, --green, --orange, --serif, --sans, --display) */

.order-page {
  --paper: var(--cream);
  --doc-surface: #fffefa;
  --line: #d9d0b0;
  --line-strong: rgba(27, 59, 34, 0.35);
  --muted: #6b6a4f;
  --mono: 'IBM Plex Mono', 'Work Sans', monospace;
  background: var(--paper);
}

.order-page .nav { background: rgba(242, 194, 48, 0.92); }
.btn-nav-static {
  cursor: default;
  background: var(--green);
  color: var(--yellow-soft);
}
.btn-nav-static:hover { transform: none; }

.order-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ---------- toolbar ---------- */
.order-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.order-toolbar-note {
  font-size: 0.85rem;
  color: var(--green-2);
  max-width: 42ch;
  line-height: 1.5;
  margin: 0;
}
.order-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.order-actions .btn { padding: 0.6rem 1.3rem; font-size: 0.85rem; }

/* ---------- document ---------- */
.doc {
  background: var(--doc-surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 8px 8px 0 rgba(27, 59, 34, 0.12);
  padding: 2.6rem 2.6rem 2.2rem;
}

.letterhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 1.3rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.brand { display: flex; gap: 0.8rem; align-items: flex-start; }
.brand-mark { font-size: 2.1rem; line-height: 1; margin-top: 0.1rem; }
.brand-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.7rem;
  color: var(--green);
  letter-spacing: 0.3px;
}
.brand-name span { color: var(--orange); }
.brand-sub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--green-2);
  margin-top: 0.15rem;
}
.seller-block {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.6;
}
.seller-block a { color: var(--green-2); text-decoration: underline; text-decoration-color: rgba(35,75,43,0.3); }
.seller-block a:hover { text-decoration-color: var(--green-2); }

.doc-meta { text-align: right; }
.doc-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
}
.meta-row {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  align-items: baseline;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--muted);
}
.meta-row .val { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.meta-row input {
  font-family: var(--mono);
  font-size: 0.8rem;
  border: none;
  border-bottom: 1px dotted var(--line-strong);
  background: transparent;
  color: var(--ink);
  width: 140px;
  text-align: right;
  padding: 2px 0;
}
.regen {
  font-size: 0.68rem;
  border: none;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 0;
  margin-left: 4px;
  cursor: pointer;
}

/* ---------- parties ---------- */
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; margin-bottom: 1.8rem; }
.party h3 {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 0.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}
.field { margin-bottom: 0.55rem; }
.field label { display: block; font-size: 0.68rem; color: var(--muted); margin-bottom: 2px; }
.field .static { font-size: 0.9rem; line-height: 1.5; color: var(--green-2); }

input[type=text], input[type=email], input[type=tel], input[type=date], textarea, select {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 4px 2px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }
textarea { resize: vertical; min-height: 3.2rem; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0.5rem; }
select { border: 1px solid var(--line-strong); border-radius: 6px; padding: 0.4rem; background: var(--doc-surface); }
.order-page input:focus-visible, .order-page textarea:focus-visible, .order-page select:focus-visible, .order-page button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

.required::after { content: " *"; color: var(--orange); }

/* ---------- line items ---------- */
.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.section-label.plain { border: none; padding: 0; }

.table-scroll { overflow-x: auto; }
table.items { width: 100%; border-collapse: collapse; margin-bottom: 0.4rem; }
table.items thead th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
  padding: 0 8px 8px 0;
  white-space: nowrap;
}
table.items tbody td {
  padding: 0.7rem 8px 0.7rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.9rem;
}
table.items tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
.sku-name { font-weight: 600; color: var(--green); }
.sku-name .format { color: var(--muted); font-weight: 400; }
.sku-use { font-size: 0.76rem; color: var(--muted); margin-top: 1px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
th.num { text-align: right; }
.qty-input {
  width: 4.2rem;
  text-align: right;
  font-family: var(--mono);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 5px 6px;
}
.price-note { font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.line-total { font-weight: 600; color: var(--green); }
.pipeline-row { opacity: 0.5; }
.pipeline-row .sku-name { color: var(--ink); }
.pipeline-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 2px 6px;
}
.pipeline-row .qty-input:disabled { background: var(--line); cursor: not-allowed; }
.catalog-note { font-size: 0.72rem; color: var(--muted); margin: 0.5rem 0 1.6rem; line-height: 1.5; }

.totals { display: flex; justify-content: flex-end; margin-bottom: 2rem; }
.totals-table { width: 260px; }
.totals-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 5px 0; }
.totals-row.grand {
  border-top: 2px solid var(--ink);
  margin-top: 4px;
  padding-top: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
}
.totals-row .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.totals-row.grand .num { color: var(--orange); }

/* ---------- terms ---------- */
.terms { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; margin-bottom: 1.8rem; }
.terms .static-line { font-size: 0.85rem; color: var(--green-2); line-height: 1.7; }
.terms .static-line b { color: var(--ink); font-weight: 600; }

.notes-block { margin-bottom: 1.8rem; }

.doc-footer {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.7;
}
.doc-footer b { color: var(--green-2); }
.doc-footer .signoff { font-size: 0.8rem; text-align: right; }
.doc-footer .line {
  border-top: 1px solid var(--line-strong);
  width: 190px;
  margin-top: 1.6rem;
  padding-top: 3px;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .order-main { padding: 1.6rem 0.9rem 3rem; }
  .doc { padding: 1.6rem 1.2rem 1.4rem; }
  .letterhead { flex-direction: column; }
  .doc-meta { text-align: left; width: 100%; }
  .meta-row { justify-content: space-between; }
  .parties, .terms { grid-template-columns: 1fr; }
  table.items thead { display: none; }
  table.items tbody td { display: block; border-bottom: none; padding: 3px 0; }
  table.items tbody tr { display: block; border-bottom: 1px solid var(--line); padding: 0.8rem 0; }
  .qty-cell { display: flex; align-items: center; gap: 8px; }
  .qty-cell::before { content: "Qty (boxes)"; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; }
  .num { text-align: left; }
  .doc-footer .signoff { text-align: left; }
  .doc-footer .line { margin-left: 0; }
}

/* ---------- print ---------- */
@media print {
  .order-page { background: #fff; }
  .nav, .order-toolbar, .grain { display: none; }
  .order-main { padding: 0; max-width: none; }
  .doc { border: none; box-shadow: none; padding: 0; }
  input, textarea, select { border-color: #999 !important; }
  .qty-input { border: 1px solid #999; }
}
