/* FaxFair send widget (.send) and fax status page (.fax-status). Scoped to those two classes.
   Colors and fonts come from the site's CSS variables, with the brand values as fallbacks. */

.send, .fax-status {
  --sd-paper: var(--paper, #F6F7F4);
  --sd-ink: var(--ink, #2B2A25);
  --sd-ink-2: var(--ink-2, #504C42);
  --sd-rule: var(--rule, rgba(47, 48, 44, 0.18));
  --sd-go: var(--go, #1F7A70);
  --sd-go-edge: var(--go-edge, #13524B);
  --sd-plastic: var(--plastic, #D6D1C2);
  --sd-key: var(--key, #E7E3D7);
  --sd-key-edge: var(--key-edge, #ACA693);
  --sd-lcd: var(--lcd, #A7B198);
  --sd-lcd-ink: var(--lcd-ink, #1D2318);
  --sd-focus: var(--focus, #214D99);
  --sd-error: var(--error, #A3291C);
  color: var(--sd-ink);
  font-family: var(--font-body, Chivo, system-ui, sans-serif);
}
.send { min-height: 30rem; }
.send.is-ready { min-height: 0; }
.send *, .send *::before, .send *::after, .fax-status *, .fax-status *::before, .fax-status *::after { box-sizing: border-box; }
.send [hidden], .fax-status [hidden] { display: none !important; }
.send__vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* steps */
.send__step { border-top: 1px solid var(--sd-rule); padding: 1.25rem 0 1.5rem; min-width: 0; }
.send__step:first-child { border-top: 0; padding-top: 0; }
.send__h { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.9rem; font-size: 1.15rem; line-height: 1.3; }
.send__h label { cursor: pointer; }
.send__num {
  display: inline-grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 5px;
  background: var(--sd-lcd); color: var(--sd-lcd-ink); font-family: var(--font-lcd, VT323, ui-monospace, monospace);
  font-size: 1.35rem; font-weight: 400; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25);
}
.send__h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }

/* fields */
.send__field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; max-width: 26rem; margin-bottom: 0.9rem; }
.send__field:last-child { margin-bottom: 0; }
.send__field > label { font-weight: 700; font-size: 0.95rem; }
.send__input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--sd-ink); background: #fff;
  border: 1.5px solid var(--sd-key-edge); border-radius: 6px; padding: 0.6rem 0.7rem; min-height: 2.9rem;
}
.send__input--big { font-size: 1.3rem; letter-spacing: 0.02em; max-width: 20rem; }
.send__input:focus-visible, .send button:focus-visible, .send a:focus-visible, .send__review:focus-visible { outline: 3px solid var(--sd-focus); outline-offset: 2px; }
.send [aria-invalid="true"] { border-color: var(--sd-error); border-width: 2px; }
.send__field > .send__hint { margin-top: 0; }
.send__hint { margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--sd-ink-2); }
.send__ok { margin: 0.4rem 0 0; font-weight: 700; color: var(--sd-go-edge); min-height: 1.4em; }
.send__error { margin: 0.4rem 0 0; font-size: 0.92rem; font-weight: 700; color: var(--sd-error); }
.send__error::before { content: "! "; }
.send__price { margin: 0 0 0.75rem; font-weight: 700; }
.send__note { margin: 0 0 1rem; padding: 0.6rem 0.9rem; border-radius: 8px; background: var(--sd-lcd); color: var(--sd-lcd-ink); font-weight: 700; }
.send__law { margin: 0 0 0.9rem; color: var(--sd-ink-2); }

.send__check { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 2.5rem; cursor: pointer; font-weight: 700; }
.send__check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--sd-go); flex: none; }
.send__check input:focus-visible { outline: 3px solid var(--sd-focus); outline-offset: 2px; }

/* files */
.send__file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.send__drop {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem;
  padding: 1.25rem 1rem; border: 2px dashed var(--sd-key-edge); border-radius: 12px; background: #FAFAF7;
  text-align: center;
}
.send__drop.is-over { border-color: var(--sd-go); background: rgba(31, 122, 112, 0.08); }
.send__drop-text { margin: 0; color: var(--sd-ink-2); }
.send__count { margin: 0.75rem 0 0; font-weight: 700; }
.send__count:empty { display: none; }
.send__files { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.send__file {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 0.6rem;
  background: #fff; border: 1px solid var(--sd-rule); border-radius: 10px; padding: 0.5rem 0.6rem;
}
.send__pos { font-family: var(--font-lcd, VT323, ui-monospace, monospace); font-size: 1.3rem; width: 1.2rem; text-align: center; }
.send__thumb { width: 2.6rem; height: 3.3rem; object-fit: cover; border-radius: 3px; border: 1px solid var(--sd-rule); background: var(--sd-paper); }
.send__thumb--badge { display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: var(--sd-ink-2); }
.send__file-name { display: flex; flex-direction: column; min-width: 0; }
.send__file-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send__file-meta { font-size: 0.85rem; color: var(--sd-ink-2); }
.send__file-buttons { display: flex; gap: 0.35rem; }
.send__mini {
  font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; min-width: 2.5rem; min-height: 2.5rem; padding: 0.3rem 0.55rem;
  color: var(--sd-ink); background: var(--sd-key); border: 1px solid var(--sd-key-edge); border-radius: 8px; box-shadow: 0 3px 0 var(--sd-key-edge);
}
.send__mini:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sd-key-edge); }
.send__mini:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }
@media (max-width: 30rem) {
  .send__file { grid-template-columns: auto auto minmax(0, 1fr); }
  .send__file-buttons { grid-column: 1 / -1; justify-content: flex-end; }
}

/* cover sheet */
.send__cover { margin-top: 1rem; padding: 1rem; border: 1px solid var(--sd-rule); border-radius: 12px; background: #FAFAF7; }

/* the logo row, right under the design picker */
.send__logo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0 0 1.5rem;
  padding: 0.75rem 0.9rem; background: #fff; border: 1px solid var(--sd-rule); border-radius: 10px;
}
.send__logo-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; flex: 1 1 18rem; min-width: 0; }
.send__logo-text { margin: 0; font-size: 0.92rem; color: var(--sd-ink-2); flex: 1 1 12rem; min-width: 0; }
.send__logo.is-on .send__logo-text { color: var(--sd-ink); order: 1; flex: 0 1 auto; }
.send__logo.is-on .send__addon { order: 2; }
.send__logo.is-off { background: transparent; border-style: dashed; }
.send__logo-thumb { width: 3.75rem; height: 2.5rem; object-fit: contain; background: #fff; border: 1px solid var(--sd-rule); border-radius: 4px; flex: none; }
.send__addon { font-weight: 700; font-size: 1.05rem; color: var(--sd-go-edge); white-space: nowrap; }
.send__logo-keys { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.send__logo-keys:not(:has(button:not([hidden]))) { display: none; }
.send__logo > .send__error { flex-basis: 100%; margin: 0; }

/* keys */
.send__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.send__key {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; min-height: 2.9rem; padding: 0.6rem 1.15rem; border-radius: 10px;
  color: var(--sd-ink); background: var(--sd-key); border: 1px solid var(--sd-key-edge); box-shadow: 0 4px 0 var(--sd-key-edge);
}
.send__key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sd-key-edge); }
.send__key--go { color: #fff; background: var(--sd-go); border-color: var(--sd-go-edge); box-shadow: 0 4px 0 var(--sd-go-edge); font-size: 1.1rem; padding-inline: 1.5rem; }
.send__key--go:active { box-shadow: 0 1px 0 var(--sd-go-edge); }
.send__key--plain { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; padding-inline: 0.5rem; }
.send__key--small { font-size: 0.92rem; min-height: 2.5rem; padding: 0.4rem 0.85rem; box-shadow: 0 3px 0 var(--sd-key-edge); }
.send__key--small.send__key--plain { box-shadow: none; }
.send__key:disabled { opacity: 0.6; cursor: progress; }
.send__progress { width: 100%; max-width: 24rem; height: 0.75rem; margin-top: 0.9rem; accent-color: var(--sd-go); }
.send__status { margin: 0.75rem 0 0; }
.send__status:empty { display: none; }

/* total before upload */
.send__sum { max-width: 26rem; }
.send__sum-list { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 0.3rem 0; margin: 0; }
.send__sum-list dt, .send__sum-list dd { margin: 0; }
.send__sum-list dd { text-align: right; font-variant-numeric: tabular-nums; padding-left: 1rem; }
.send__sum-list .send__sum-total { border-top: 1px solid var(--sd-rule); padding-top: 0.4rem; font-weight: 700; font-size: 1.15rem; }
.send__sum-empty { margin: 0; color: var(--sd-ink-2); }

/* review */
.send__review { background: var(--sd-plastic); border-radius: 14px; padding: 1rem 1.1rem 1.2rem; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08); }
.send__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0; }
.send__facts dt { font-weight: 700; }
.send__facts dd { margin: 0; overflow-wrap: anywhere; }
.send__total { font-weight: 700; font-size: 1.15rem; }
.send__breakdown { font-weight: 400; font-size: 0.9rem; color: var(--sd-ink-2); }
.send__pay { font-size: 1.2rem; }
.send__hold { margin: 0.9rem 0 0; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .send__key, .send__mini { transition: none; } }

/* status page */
.fax-status__lcd {
  margin: 0 0 1rem; padding: 0.5rem 0.9rem; border-radius: 8px; background: var(--sd-lcd); color: var(--sd-lcd-ink);
  font-family: var(--font-lcd, VT323, ui-monospace, monospace); font-size: clamp(1.5rem, 6vw, 2.25rem); line-height: 1.2;
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.28); overflow-wrap: anywhere;
}
.fax-status__message { margin: 0 0 0.75rem; font-size: 1.05rem; }
.fax-status__reason { margin: 0 0 0.5rem; font-weight: 700; }
.fax-status__charge { margin: 0 0 0.75rem; font-weight: 700; color: var(--sd-go-edge); }
.fax-status__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0; }
.fax-status__facts dt { font-weight: 700; }
.fax-status__facts dd { margin: 0; }
.fax-status[data-state="failed"] .fax-status__lcd { box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.28), 0 0 0 3px var(--sd-error); }
