/* style.css: doc-translator stylesheet.
   Functional baseline for step 1; a fuller pass comes in step 5. */

:root {
  --ink: #111;
  --muted: #555;
  --line: #ccc;
  --bg: #fafafa;
  --card: #fff;
  --error-bg: #fdecea;
  --error-ink: #611a15;
  --accent: #111;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.masthead h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

.tagline {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

/* Signing out is a POST, so it has to be a form and a button rather than a
   link — a plain GET link would let any page (or a prefetcher) sign the
   operator out. These two rules make it sit inline in the tagline and read
   like the links beside it. */
.signout {
  display: inline;
  margin: 0;
}

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
}

.field { margin-bottom: 1.25rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

label.checkbox {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input[type="file"],
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
}

textarea { resize: vertical; }

/* The sign-in page has one field, so it reads better narrow than at the
   full form width. */
.login { max-width: 26rem; }

/* The demo passcode form sits under the sign-in card once revealed. */
.demo-form { margin-top: 1rem; }
.demo-form[hidden] { display: none; }

/* Marks a restricted demo session, so nobody mistakes it for the real app
   and wonders where their receipt went. */
.demo-banner {
  margin: 0 0 1.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 0.95rem;
}

.client-details {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem 0.25rem;
  margin: 0 0 1.5rem;
}

.client-details legend {
  font-weight: 600;
  padding: 0 0.4rem;
}

.client-details .optional {
  font-weight: 400;
  color: var(--muted);
}

.two-up {
  display: flex;
  gap: 1rem;
}

.two-up > div { flex: 1; }

.address-line {
  display: flex;
  gap: 1rem;
}

.address-line .city { flex: 3; }
.address-line .state { flex: 1; }
.address-line .zip { flex: 1.5; }

@media (max-width: 480px) {
  .two-up,
  .address-line { flex-direction: column; }
}

label.checkbox input { width: auto; }

.hint {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #fff;
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.error {
  background: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid #f5c6c2;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.success {
  background: #e7f4e8;
  color: #1e4620;
  border: 1px solid #b6dbb8;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.email {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.email h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.client-summary {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.client-summary h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.client-summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
}

.client-summary dt {
  font-weight: 600;
  color: var(--muted);
}

.client-summary dd {
  margin: 0;
  white-space: pre-line;
}

.client-summary .hint { margin-top: 0.75rem; }

.result {
  margin-bottom: 2rem;
}

.result h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}

.text-block {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
}

.billing {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.billing h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.line-items {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.75rem;
}

.line-items th {
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 0.5rem 0.4rem 0;
}

.line-items th.amount-col { width: 8rem; }

.line-items td {
  padding: 0.2rem 0.5rem 0.2rem 0;
  vertical-align: middle;
}

.line-items td:last-child,
.line-items th:last-child { width: 2rem; padding-right: 0; }

.line-items .amount { text-align: right; }

.remove-row {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.button.small {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.cash-field .amount { text-align: right; max-width: 10rem; }

/* Change due: the number the operator reads out loud while handing back
   money, so it is set larger than the surrounding form text. */
.change-due {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.change-due.short {
  font-size: 1rem;
  font-weight: 400;
  color: var(--error-ink);
}

.billing-actions { margin-top: 1.25rem; margin-bottom: 0; }

.disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 2rem;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-form input { flex: 1; }

/* All-time sales-by-service summary above the records list. Narrow, because
   it holds two short numeric columns and shouldn't read as the main table. */
.sales-summary {
  margin-bottom: 1.75rem;
  max-width: 26rem;
}

.sales-summary h2 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.sales-summary .optional {
  font-weight: 400;
  color: var(--muted);
}

.records {
  width: 100%;
  border-collapse: collapse;
}

.records th,
.records td {
  text-align: left;
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.records th {
  font-size: 0.85rem;
  color: var(--muted);
}

.records .amount,
.records .amount-col { text-align: right; }

.record-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.reemail-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.reemail-form input { width: 11rem; padding: 0.3rem 0.4rem; }

.empty {
  color: var(--muted);
  padding: 1rem 0;
}
