/* ============================================================
   GOX ASSINA — Design System
   Paleta: Roxo Escuro #3D0F6B (cor principal GOX)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Roxo GOX — escala completa */
  --p-950: #0D0218;
  --p-900: #1A0535;
  --p-800: #280A50;
  --p-700: #3D0F6B;   /* cor principal */
  --p-600: #5A1A9E;
  --p-500: #7B2FBE;
  --p-400: #9B4DCA;
  --p-300: #C084FC;
  --p-200: #DDD6FE;
  --p-100: #EDE9FE;
  --p-50:  #F5F3FF;

  /* Semântico */
  --brand:        var(--p-700);
  --brand-dark:   var(--p-800);
  --brand-darker: var(--p-900);
  --brand-light:  var(--p-600);

  /* UI base */
  --bg:           #F8F7FF;
  --surface:      #FFFFFF;
  --surface-2:    #FAFAFA;
  --border:       #E8E4F0;
  --border-strong:#C9C0E0;

  /* Texto */
  --text:         #1A0A2E;
  --text-2:       #5B4E72;
  --text-3:       #9B8FB0;
  --text-inv:     #FFFFFF;

  /* Status */
  --green:        #10B981;
  --green-bg:     #ECFDF5;
  --yellow:       #F59E0B;
  --yellow-bg:    #FFFBEB;
  --red:          #EF4444;
  --red-bg:       #FEF2F2;
  --blue:         #3B82F6;
  --blue-bg:      #EFF6FF;

  /* Layout */
  --sidebar-w:    260px;
  --topbar-h:     64px;

  /* Misc */
  --font:         'Inter', system-ui, sans-serif;
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-full:  9999px;
  --shadow-xs:    0 1px 2px rgba(61,15,107,.06);
  --shadow-sm:    0 1px 4px rgba(61,15,107,.08), 0 2px 8px rgba(61,15,107,.06);
  --shadow:       0 4px 16px rgba(61,15,107,.12);
  --shadow-lg:    0 8px 32px rgba(61,15,107,.18);
  --shadow-xl:    0 16px 64px rgba(61,15,107,.22);
  --t:            160ms ease;
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); outline: none; }
ul { list-style: none; }

/* ============================================================ TYPOGRAPHY */
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.125rem; font-weight: 700; }
h4 { font-size: .9375rem; font-weight: 600; }
.text-sm  { font-size: .8125rem; }
.text-xs  { font-size: .75rem; }
.text-2   { color: var(--text-2); }
.text-3   { color: var(--text-3); }
.fw-500   { font-weight: 500; }
.fw-600   { font-weight: 600; }
.fw-700   { font-weight: 700; }
.fw-800   { font-weight: 800; }

/* ============================================================ LAYOUT ADMIN */
.admin-layout { display: flex; min-height: 100vh; }

/* — Sidebar — */
.sidebar {
  width: var(--sidebar-w);
  background: var(--p-900);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  z-index: 100;
  transition: transform var(--t);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar-top {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo { height: 32px; width: auto; flex-shrink: 0; }
.sidebar-product {
  font-size: .625rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--p-400);
  background: rgba(155,77,202,.15); padding: 3px 8px;
  border-radius: var(--radius-full); white-space: nowrap;
}

.sidebar-nav { flex: 1; padding: 14px 10px; }

.nav-group { margin-bottom: 22px; }
.nav-group-label {
  font-size: .6rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.28);
  padding: 0 8px; margin-bottom: 5px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.58); font-size: .875rem; font-weight: 500;
  transition: all var(--t); cursor: pointer; margin-bottom: 2px;
  position: relative;
}
.nav-link:hover  { background: rgba(255,255,255,.07); color: rgba(255,255,255,.88); }
.nav-link.active {
  background: var(--p-700); color: #fff;
  box-shadow: 0 2px 12px rgba(61,15,107,.45);
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
.nav-link.active svg { opacity: 1; }
.nav-link span { flex: 1; }
.nav-chip {
  font-size: .6rem; font-weight: 800; padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(155,77,202,.35); color: var(--p-300);
}
.nav-link.active .nav-chip { background: rgba(255,255,255,.2); color: #fff; }

.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--t);
}
.user-row:hover { background: rgba(255,255,255,.06); }
.user-av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--p-700); display: flex; align-items: center; justify-content: center;
  font-size: .8125rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.user-name  { font-size: .8125rem; font-weight: 600; color: rgba(255,255,255,.85); }
.user-role  { font-size: .6875rem; color: rgba(255,255,255,.38); }
.user-logout { margin-left: auto; color: rgba(255,255,255,.3); cursor: pointer; }
.user-logout:hover { color: rgba(255,255,255,.7); }
.user-logout svg { width: 16px; height: 16px; }

/* — Main — */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-xs);
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.mobile-menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--text-2);
}
.mobile-menu-btn svg { width: 20px; height: 20px; }
.mobile-menu-btn:hover { background: var(--bg); }

.page { padding: 28px; flex: 1; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title  { font-size: 1.375rem; font-weight: 800; color: var(--text); }
.page-sub    { font-size: .875rem; color: var(--text-3); margin-top: 3px; }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600; transition: all var(--t);
  white-space: nowrap; cursor: pointer; border: 1.5px solid transparent;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--p-700); color: #fff; border-color: var(--p-700);
  box-shadow: 0 2px 8px rgba(61,15,107,.3);
}
.btn-primary:hover {
  background: var(--p-600); border-color: var(--p-600);
  box-shadow: 0 4px 18px rgba(61,15,107,.42); transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(61,15,107,.25); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: var(--red-bg); color: var(--red); border-color: rgba(239,68,68,.2); }
.btn-danger:hover { background: #FEE2E2; }

.btn-success { background: var(--green-bg); color: #065F46; border-color: rgba(16,185,129,.2); }

.btn-sm { padding: 6px 12px; font-size: .8125rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; }

.btn:disabled { opacity: .55; pointer-events: none; }
.btn.loading::after {
  content: ''; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}

/* ============================================================ CARDS */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-body { padding: 22px; }
.card-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-bottom: 22px; }

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), transform var(--t);
  cursor: default;
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-ico {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-ico svg { width: 22px; height: 22px; }
.stat-ico.purple { background: var(--p-50);    color: var(--p-700); }
.stat-ico.green  { background: var(--green-bg); color: var(--green); }
.stat-ico.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-ico.red    { background: var(--red-bg);   color: var(--red); }
.stat-ico.blue   { background: var(--blue-bg);  color: var(--blue); }

.stat-n { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--text); }
.stat-l { font-size: .8125rem; color: var(--text-3); margin-top: 3px; }

/* ============================================================ BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: .725rem; font-weight: 700; letter-spacing: .02em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-pending  { background: var(--yellow-bg); color: #92400E; }
.badge-sent     { background: var(--blue-bg);   color: #1E40AF; }
.badge-viewed   { background: var(--p-100);     color: var(--p-800); }
.badge-signed   { background: var(--green-bg);  color: #065F46; }
.badge-expired  { background: var(--red-bg);    color: #991B1B; }
.badge-cancelled{ background: #F3F4F6;          color: #4B5563; }

/* ============================================================ TABLE */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead tr { background: var(--bg); border-bottom: 1px solid var(--border); }
thead th {
  padding: 11px 16px; text-align: left;
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--t); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--p-50); }
td { padding: 13px 16px; vertical-align: middle; }
.td-name { font-weight: 600; color: var(--text); }
.td-sub  { font-size: .8rem; color: var(--text-3); margin-top: 2px; }

/* ============================================================ FORMS */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: .8125rem; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.req { color: var(--red); margin-left: 2px; }

.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .875rem; color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control::placeholder { color: var(--text-3); }
.form-control:focus { border-color: var(--p-400); box-shadow: 0 0 0 3px rgba(61,15,107,.1); }
.form-control:disabled { background: var(--bg); opacity: .65; cursor: not-allowed; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239B8FB0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

.form-hint  { font-size: .75rem; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: .75rem; color: var(--red); margin-top: 5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }

/* File drop */
.file-drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all var(--t); background: var(--bg); position: relative;
}
.file-drop:hover, .file-drop.over { border-color: var(--p-400); background: var(--p-50); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop-ico {
  width: 48px; height: 48px; background: var(--p-50); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; color: var(--p-500);
}
.file-drop-ico svg { width: 24px; height: 24px; }
.file-name {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--p-50); border-radius: var(--radius-sm);
  border: 1px solid var(--p-200); font-size: .875rem; font-weight: 500; color: var(--p-700);
}
.file-name svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ============================================================ SEARCH / TOOLBAR */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

.search {
  position: relative; flex: 1; min-width: 200px; max-width: 360px;
}
.search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-3); pointer-events: none;
}
.search input {
  width: 100%; padding: 8px 12px 8px 35px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .875rem; color: var(--text);
  transition: all var(--t);
}
.search input:focus { background: var(--surface); border-color: var(--p-400); box-shadow: 0 0 0 3px rgba(61,15,107,.08); }

/* ============================================================ TIMELINE */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; margin-bottom: 20px; }
.tl-dot {
  position: absolute; left: -26px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.tl-dot.done { background: var(--p-700); border-color: var(--p-700); }
.tl-dot.done svg { width: 9px; height: 9px; color: #fff; }
.tl-time  { font-size: .75rem; color: var(--text-3); }
.tl-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.tl-meta  { font-size: .8125rem; color: var(--text-2); }

/* ============================================================ MODAL */
.modal-bg {
  position: fixed; inset: 0; background: rgba(10,2,24,.55);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity var(--t);
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 500px;
  transform: translateY(20px) scale(.98); transition: transform var(--t);
}
.modal-bg.open .modal { transform: none; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 1rem; font-weight: 700; }
.modal-close { padding: 4px; border-radius: var(--radius-xs); color: var(--text-3); transition: all var(--t); }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================ EMPTY STATE */
.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 24px; text-align: center;
}
.empty-ico {
  width: 64px; height: 64px; background: var(--bg); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--text-3);
}
.empty-ico svg { width: 28px; height: 28px; }
.empty h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.empty p  { font-size: .875rem; color: var(--text-3); max-width: 280px; }

/* ============================================================ TOAST */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: slideUp .25s ease; max-width: 300px;
  color: #fff;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success { background: #065F46; }
.toast-error   { background: #991B1B; }
.toast-info    { background: var(--p-800); }

/* ============================================================ LOGIN PAGE */
.login-wrap {
  min-height: 100vh; display: flex;
}

.login-left {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 48px;
  background: linear-gradient(145deg, var(--p-950) 0%, var(--p-800) 100%);
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute;
  width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(155,77,202,.14) 0%, transparent 70%);
  top: -150px; right: -150px;
}
.login-left::after {
  content: ''; position: absolute;
  width: 450px; height: 450px; border-radius: 50%;
  background: radial-gradient(circle, rgba(61,15,107,.2) 0%, transparent 70%);
  bottom: -80px; left: -80px;
}
.login-left-content { position: relative; z-index: 1; text-align: center; max-width: 380px; }
.login-logo { height: 44px; margin: 0 auto 28px; }
.login-h1 { font-size: 1.875rem; font-weight: 800; color: #fff; margin-bottom: 10px; letter-spacing: -.03em; }
.login-desc { font-size: .9375rem; color: rgba(255,255,255,.5); line-height: 1.7; }
.login-feats { margin-top: 40px; display: flex; flex-direction: column; gap: 18px; text-align: left; }
.login-feat { display: flex; align-items: center; gap: 14px; }
.login-feat-ico {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--p-300);
}
.login-feat-ico svg { width: 20px; height: 20px; }
.login-feat-txt { font-size: .875rem; color: rgba(255,255,255,.65); font-weight: 500; }

.login-right {
  width: 440px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center;
  padding: 48px; background: var(--surface);
}
.login-form-box { width: 100%; }
.login-form-box h2 { font-size: 1.375rem; font-weight: 800; margin-bottom: 4px; }
.login-form-sub { font-size: .875rem; color: var(--text-3); margin-bottom: 28px; }

/* ============================================================ SIGN PAGE (cliente, mobile-first) */
.sign-page { min-height: 100vh; display: flex; flex-direction: column; background: #F9F8FF; }

.sign-nav {
  background: var(--p-900); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.sign-nav-logo { height: 28px; }
.sign-secure {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.07); padding: 5px 12px; border-radius: var(--radius-full);
}
.sign-secure svg { width: 13px; height: 13px; color: var(--green); }

/* Steps */
.sign-steps {
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; overflow-x: auto; padding: 0 8px;
}
.sign-step {
  flex: 1; min-width: 72px; display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; position: relative; cursor: default;
  color: var(--text-3); font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  transition: color var(--t);
}
.sign-step::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2.5px;
  background: transparent; transition: background var(--t);
}
.sign-step.active { color: var(--p-700); }
.sign-step.active::after { background: var(--p-700); }
.sign-step.done { color: var(--green); }
.sign-step.done::after { background: var(--green); }

.step-n {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid currentColor; display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; margin-bottom: 5px;
  transition: all var(--t);
}
.sign-step.active .step-n { background: var(--p-700); border-color: var(--p-700); color: #fff; }
.sign-step.done  .step-n  { background: var(--green); border-color: var(--green); color: #fff; font-size: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

.sign-body { flex: 1; padding: 18px 16px; max-width: 620px; margin: 0 auto; width: 100%; }

.sign-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.sign-card-title { font-size: .9375rem; font-weight: 700; margin-bottom: 3px; }
.sign-card-sub   { font-size: .8125rem; color: var(--text-3); margin-bottom: 18px; }

/* Document viewer */
.doc-viewer {
  border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: #525659; height: 380px;
}
.doc-viewer iframe { width: 100%; height: 100%; border: none; }

/* Canvas assinatura */
.canvas-wrap {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  overflow: hidden; background: #FAFAFE; position: relative;
  transition: border-color var(--t);
}
.canvas-wrap:focus-within, .canvas-wrap.drawing { border-color: var(--p-400); border-style: solid; }
.canvas-wrap canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }

.canvas-hint {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-3); font-size: .8125rem; gap: 8px;
  pointer-events: none; transition: opacity var(--t);
}
.canvas-hint svg { width: 28px; height: 28px; }
.canvas-wrap.drawing .canvas-hint { opacity: 0; }

/* Camera */
.camera-box {
  border-radius: var(--radius); overflow: hidden; background: #111;
  position: relative; aspect-ratio: 4/3; max-height: 300px;
}
.camera-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.camera-frame {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.camera-oval {
  width: 150px; height: 190px;
  border: 3px solid rgba(255,255,255,.7);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.32);
}
.snap-btn {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: 58px; height: 58px; border-radius: 50%;
  background: #fff; border: 4px solid rgba(255,255,255,.35);
  box-shadow: 0 3px 16px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t);
}
.snap-btn:hover { transform: translateX(-50%) scale(1.06); }
.snap-btn svg { width: 24px; height: 24px; color: var(--p-700); }

.selfie-prev { border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 4/3; max-height: 300px; }
.selfie-prev img { width: 100%; height: 100%; object-fit: cover; }
.retake-btn { position: absolute; bottom: 10px; right: 10px; }

/* Location pill */
.location-pill {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; background: var(--green-bg);
  border: 1px solid rgba(16,185,129,.2); border-radius: var(--radius);
}
.location-pill-ico {
  width: 38px; height: 38px; background: rgba(16,185,129,.12);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: var(--green); flex-shrink: 0;
}
.location-pill-ico svg { width: 19px; height: 19px; }
.location-pill-txt { font-size: .8125rem; font-weight: 600; color: #065F46; }
.location-pill-coords { font-size: .75rem; color: #10B981; margin-top: 1px; }

/* Checkbox custom */
.check-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check-row input[type=checkbox] { display: none; }
.check-box {
  width: 20px; height: 20px; border: 2px solid var(--border-strong); border-radius: 5px;
  flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center;
  transition: all var(--t); background: var(--surface);
}
.check-row input:checked + .check-box {
  background: var(--p-700); border-color: var(--p-700);
}
.check-row input:checked + .check-box::after {
  content: '';
  width: 11px; height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  display: block;
}
.check-txt { font-size: .875rem; color: var(--text-2); line-height: 1.5; }
.check-txt a { color: var(--p-600); text-decoration: underline; }

/* Sign sticky footer */
.sign-footer {
  position: sticky; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--border); padding: 14px 16px;
  box-shadow: 0 -4px 16px rgba(61,15,107,.08);
}

/* ============================================================ SUCCESS PAGE */
.success-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(160deg, var(--p-50) 0%, #fff 55%);
}
.success-ico {
  width: 80px; height: 80px; background: var(--green-bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; animation: pop .5s cubic-bezier(.175,.885,.32,1.275);
}
.success-ico svg { width: 38px; height: 38px; color: var(--green); }
.success-box { max-width: 440px; width: 100%; text-align: center; }
.success-box h1 { font-size: 1.625rem; margin-bottom: 10px; }
.success-box p  { font-size: .9375rem; color: var(--text-2); margin-bottom: 24px; }

.audit-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; text-align: left;
  margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.audit-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.audit-row:last-child { border: none; padding-bottom: 0; }
.audit-label { font-size: .75rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0; width: 80px; margin-top: 1px; }
.audit-val   { font-size: .875rem; color: var(--text); font-weight: 500; }

/* ============================================================ UTILS */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.flex-1       { flex: 1; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }
.gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }  .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.w-full    { width: 100%; }
.text-center { text-align: center; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider   { height: 1px; background: var(--border); margin: 20px 0; }
.hidden    { display: none !important; }

/* ============================================================ ANIMATIONS */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pop     { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }

.anim-fade { animation: fadeIn .3s ease; }

/* ============================================================ RESPONSIVE */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .login-left { display: none; }
  .login-right { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  h1 { font-size: 1.375rem; }
  .page-header { flex-direction: column; }
}
