/* Agency Desk Sign — Phase 0 lo-fi wireframes
   LOFI · not production · English only */

:root {
  --navy: #0b1f33;
  --navy-mid: #14324f;
  --teal: #1a7a6d;
  --teal-hover: #15665c;
  --teal-soft: #e6f4f1;
  --ink: #1a2332;
  --muted: #5a6a7a;
  --line: #d5dde6;
  --bg: #f4f6f8;
  --white: #ffffff;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(11, 31, 51, 0.08);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— Index —— */
.index-wrap { max-width: 920px; margin: 0 auto; padding: 32px 20px 64px; }
.index-wrap h1 { font-size: 1.6rem; color: var(--navy); margin: 0 0 6px; }
.index-wrap .sub { color: var(--muted); margin: 0 0 24px; }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--navy);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.screen-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.screen-card a { font-weight: 600; color: var(--navy); text-decoration: none; }
.screen-card a:hover { color: var(--teal); }
.screen-card .code { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.screen-card p { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
section h2 { font-size: 1.05rem; color: var(--navy); margin: 0 0 12px; border-bottom: 2px solid var(--teal); padding-bottom: 6px; display: inline-block; }

/* —— Shared chrome —— */
.lofi-banner {
  background: #fef7e0;
  color: #7a5b00;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 10px;
  border-bottom: 1px solid #f0e2a8;
}
.phone-shell {
  max-width: 390px;
  margin: 16px auto 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(11, 31, 51, 0.12);
  overflow: hidden;
  min-height: 720px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.desktop-shell {
  max-width: 1100px;
  margin: 16px auto 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(11, 31, 51, 0.1);
  overflow: hidden;
  min-height: 640px;
}
.brand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  flex-shrink: 0;
  position: relative;
}
.mark::after {
  content: "AD";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.65rem; font-weight: 800; letter-spacing: -0.02em;
}
.brand-name { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.brand-sub { font-size: 0.72rem; color: var(--muted); }
/* AgencyDesk + Sign signature lockup */
.brand-lockup {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(280px, 72vw);
  object-fit: contain;
  flex-shrink: 0;
}
.brand-mark {
  display: block;
  width: 36px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-sub-wrap { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.brand-bar { gap: 12px; }
/* Void token for dark plates / CoC reference — #07080c */
:root { --void: #07080c; }

.screen-body { padding: 20px 18px 24px; flex: 1; display: flex; flex-direction: column; }
.screen-body h1 { font-size: 1.35rem; color: var(--navy); margin: 0 0 10px; line-height: 1.25; }
.screen-body .lead { color: var(--muted); font-size: 0.92rem; margin: 0 0 18px; }
.doc-title {
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 0.95rem;
}
.meta { font-size: 0.85rem; color: var(--muted); margin: 0 0 20px; }
.footer-note {
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.btn {
  display: block;
  width: 100%;
  text-align: center;
  border: none;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-hover); color: #fff; }
.btn-primary:disabled,
.btn-primary.is-disabled {
  background: #a8c5c0;
  color: #eef6f4;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.btn-secondary:hover { border-color: var(--muted); color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--teal);
  padding: 10px;
  margin-top: 8px;
  font-weight: 500;
}
.btn-danger-text {
  background: transparent;
  color: var(--danger);
  padding: 10px;
  margin-top: 4px;
  font-weight: 500;
  font-size: 0.88rem;
}
.link-row { text-align: center; margin-top: 8px; }
.link-row a { font-size: 0.88rem; }

/* —— PDF fake —— */
.pdf-bleed {
  flex: 1;
  background: #e8ecf0;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  position: relative;
}
.pdf-page {
  margin: 12px;
  background: #fff;
  border: 1px solid #c5ced8;
  border-radius: 2px;
  flex: 1;
  min-height: 420px;
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
}
.pdf-lorem {
  color: #9aa8b6;
  font-size: 0.72rem;
  line-height: 1.7;
  user-select: none;
}
.pdf-lorem .block {
  height: 10px;
  background: #e4eaf0;
  border-radius: 2px;
  margin-bottom: 8px;
}
.pdf-lorem .block.short { width: 62%; }
.pdf-lorem .block.mid { width: 85%; }
.pdf-title-fake {
  font-size: 0.95rem;
  font-weight: 700;
  color: #7a8a9a;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.page-indicator {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255,255,255,0.9);
  padding: 4px;
}
.sticky-bottom {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
}

/* —— Consent —— */
.disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 14px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.82rem;
  color: var(--ink);
  margin-bottom: 16px;
}
.disclosure h3 { font-size: 0.85rem; margin: 0 0 8px; color: var(--navy); }
.disclosure p { margin: 0 0 10px; }
.disclosure .ver { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
  font-size: 0.88rem;
}
.check-row input[type="checkbox"] {
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

/* —— OTP —— */
.masked-email {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
  margin: 4px 0 18px;
  word-break: break-all;
}
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.otp-row input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--mono);
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  outline: none;
}
.otp-row input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.help-micro { font-size: 0.8rem; color: var(--muted); margin: 0 0 16px; text-align: center; }
.error-inline {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.82rem;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: none;
}
.error-inline.show { display: block; }
.resend-row {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
}
.resend-row button {
  background: none; border: none; color: var(--teal);
  font-weight: 600; font-family: inherit; cursor: pointer; font-size: 0.85rem;
  padding: 0;
}
.resend-row button:disabled { color: var(--muted); cursor: default; }
.toast {
  position: absolute;
  top: 56px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff;
  font-size: 0.8rem; padding: 8px 14px; border-radius: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  z-index: 20; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* —— Fields —— */
.progress-chip {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin: 10px 12px 0;
}
.field-box {
  position: absolute;
  border: 2px dashed #b0bec9;
  background: rgba(255,255,255,0.7);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #7a8a9a;
  display: flex; align-items: center; justify-content: center;
  padding: 4px 6px;
}
.field-box.active {
  border: 2px solid var(--teal);
  background: rgba(26, 122, 109, 0.12);
  color: var(--teal);
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--teal-soft);
  z-index: 2;
}
.field-nav {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.field-nav .btn { flex: 1; width: auto; }
.field-nav .btn-back {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* —— Adopt signature sheet —— */
.sheet-overlay {
  background: rgba(11, 31, 51, 0.45);
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  z-index: 10;
}
.sheet {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  width: 100%;
  padding: 16px 18px 24px;
  max-height: 88%;
  overflow-y: auto;
}
.sheet-handle {
  width: 36px; height: 4px; background: var(--line);
  border-radius: 2px; margin: 0 auto 12px;
}
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}
.tab.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.draw-canvas {
  border: 1px dashed var(--line);
  border-radius: 8px;
  height: 120px;
  background: #fafbfc;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
  margin-bottom: 10px;
  position: relative;
}
.draw-canvas canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: crosshair;
}
.font-picks { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.font-pick {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  background: var(--white);
}
.font-pick.selected { border-color: var(--teal); background: var(--teal-soft); }
.font-pick .sample { font-size: 1.4rem; color: var(--navy); }
.font-script-1 { font-family: "Segoe Script", "Brush Script MT", cursive; }
.font-script-2 { font-family: "Snell Roundhand", "Apple Chancery", cursive; }
.font-script-3 { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.input-text {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.input-text:focus { border-color: var(--teal); }
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--bg);
}
.preview-sig {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin: 14px 0;
  min-height: 64px;
  background: #fafbfc;
  font-family: "Segoe Script", cursive;
  font-size: 1.6rem;
  color: var(--navy);
}

/* —— Confirm / Done —— */
.recap {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}
.recap dt { color: var(--muted); font-size: 0.75rem; margin-top: 8px; }
.recap dt:first-child { margin-top: 0; }
.recap dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }
.legal-line {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}
.done-hero {
  text-align: center;
  padding: 32px 12px 20px;
}
.check-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
  font-weight: 700;
}
.dead-hero {
  text-align: center;
  padding: 48px 18px 24px;
  flex: 1;
}
.dead-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
}
.phone-cta {
  display: inline-block;
  margin-top: 16px;
  font-weight: 600;
  color: var(--navy);
  background: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* —— Staff B2 editor —— */
/* mobile prepare/Send */

.staff-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--navy);
  color: #fff;
}
.staff-top .left { display: flex; align-items: center; gap: 12px; }
.staff-top .mark { width: 24px; height: 24px; }
.staff-top .brand-mark { width: 32px; height: 36px; }
.staff-top .title { font-weight: 600; font-size: 0.95rem; }
.staff-top .actions { display: flex; gap: 8px; }
.staff-btn {
  border: none; border-radius: 6px;
  padding: 8px 14px; font-size: 0.82rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.staff-btn-ghost { background: transparent; color: #c5d4e0; border: 1px solid #2a4560; }
.staff-btn-ghost:hover { color: #fff; border-color: #4a6a88; }
.staff-btn-send { background: var(--teal); color: #fff; }
.staff-btn-send:hover { background: var(--teal-hover); }

/* Staff prepare/send — mobile portrait sticky Send (see /staff/index.html). */
.staff-primary-actions { display: inline-flex; align-items: center; gap: 8px; }

.editor-layout {
  display: grid;
  grid-template-columns: 72px 1fr 280px;
  min-height: 580px;
}
.page-rail {
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.page-thumb {
  width: 48px; height: 64px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 3px;
  font-size: 0.65rem;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.page-thumb.active { border-color: var(--teal); color: var(--teal); font-weight: 700; }
.canvas-area {
  background: #dfe5eb;
  padding: 20px;
  overflow: auto;
  position: relative;
}
.fake-pdf {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  min-height: 820px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  padding: 40px 36px;
  position: relative;
}
.fake-pdf .doc-heading {
  font-size: 1.1rem; font-weight: 700; color: #8a98a8; margin-bottom: 20px;
}
.toolbox-side {
  border-left: 1px solid var(--line);
  background: var(--white);
  display: flex; flex-direction: column;
}
.toolbox-side h3 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 0; padding: 14px 14px 8px;
}
.tool-list { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.tool {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  cursor: grab;
  text-align: left;
  font-family: inherit;
}
.tool:hover { border-color: var(--teal); background: var(--teal-soft); }
.tool span { display: block; font-size: 0.7rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.inspector { border-top: 1px solid var(--line); padding: 14px; flex: 1; }
.inspector label {
  display: block; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
  margin: 10px 0 4px;
}
.inspector label:first-child { margin-top: 0; }
.inspector input[type="text"],
.inspector input[type="email"],
.inspector textarea,
.inspector select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
}
.inspector textarea { resize: vertical; min-height: 56px; }
.inspector .req-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; margin-top: 10px;
}
.placed {
  position: absolute;
  border: 2px solid var(--teal);
  background: rgba(26, 122, 109, 0.15);
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  padding: 2px 6px;
}
.placed.selected { box-shadow: 0 0 0 3px var(--teal-soft); }
.hint-bar {
  padding: 8px 14px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.78rem;
  border-top: 1px solid #c5e4de;
  text-align: center;
}

.nav-back {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 8px;
  margin-bottom: 0;
}
.nav-back a { color: var(--muted); }

/* staff mobile helpers — sticky Send SoR lives in /staff/index.html
   (.staff-primary-actions). Do NOT fix entire .actions here (would fight prepare bar
   + envelopes topbar).. */
@media (max-width: 900px) {
  .staff-top {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }
  .staff-top .left {
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
  }
  .staff-top .actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .staff-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* compact glisten lockup in staff chrome */
  .staff-top .ads-sign-glisten.staff-glisten {
    width: 112px;
    max-width: min(112px, 32vw);
  }
}


/* read-only Open for sent/completed envelopes */
.readonly-banner {
  margin: 8px 0 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #eef4ff;
  border: 1px solid #b6c8ea;
  color: #0b3a66;
  font: 600 0.85rem/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.field-box.field-box--readonly {
  cursor: default;
}
/* hide prepare actions on read-only Open */
body.envelope-readonly #btnSave,
body.envelope-readonly #btnSend,
body.envelope-readonly #sendHint {
  display: none !important;
}
body.envelope-readonly .field-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
