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

:root {
  --bg: #f3f4f8;
  --card: #ffffff;
  --text: #1a1d29;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef0fe;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --border: #e5e7ee;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20,22,40,0.04);
  --shadow-md: 0 4px 16px rgba(20,22,40,0.06), 0 1px 3px rgba(20,22,40,0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Heebo", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

h1 { font-size: 1.4rem; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 26px 0 12px; font-weight: 700; color: var(--text); }
.muted { color: var(--muted); font-size: 0.9rem; }

/* ---------- brand header ---------- */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 16px;
  max-width: 760px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #7c73f0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(79,70,229,0.28);
  flex-shrink: 0;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.76rem; color: var(--muted); margin-top: -2px; }

.trust-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 6px 0 16px;
}
.trust-strip svg { width: 13px; height: 13px; flex-shrink: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 6px; }
input[type=text], input[type=tel], input[type=email], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 9px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
button:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,0.28); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #eef0f4; color: var(--text); }
.btn-secondary:hover { background: #e4e6ee; }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fde3e3; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #20bd5a; }
.btn-block { width: 100%; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.field-row, .spot-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.field-row input[type=text] { flex: 1; }
.chip-remove {
  background: #f3f4f6;
  color: var(--danger);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  padding: 0;
}

.checkline { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 8px 0; }
.checkline input { width: 17px; height: 17px; accent-color: var(--primary); }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-signed { background: var(--success-light); color: #166534; }
.badge-new { background: var(--primary-light); color: var(--primary-dark); margin-inline-start: 6px; }

.req-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.req-item:last-child { border-bottom: none; }
.req-item:hover { background: #f7f7fb; }
.req-item .title { font-weight: 700; }
.req-item .meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(17,18,30,0.6);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 50;
}
.modal {
  background: #fff; border-radius: var(--radius);
  max-width: 720px; width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.signed-doc-viewer { margin-bottom: 6px; }
.signed-doc-frame {
  width: 100%;
  height: 60vh;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.modal-close {
  float: left; background: #f3f4f6; color: var(--muted); font-size: 1.1rem;
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e4e6ee; }

.link-box {
  display: flex; gap: 8px; align-items: center;
  background: #f6f6fb; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
  font-size: 0.85rem; word-break: break-all;
}
.link-box code { flex: 1; color: var(--primary-dark); }

canvas.sigpad {
  width: 100%;
  height: 180px;
  background: #fcfcfe;
  border: 2px dashed #c9cdd6;
  border-radius: 12px;
  touch-action: none;
  display: block;
}
canvas.sigpad.has-drawing { border-style: solid; border-color: var(--primary); background: #fff; }

.sig-block { margin-bottom: 18px; }
.sig-label { font-weight: 600; margin-bottom: 6px; }

.doc-body {
  white-space: pre-wrap;
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.6;
}

.state-center {
  text-align: center;
  padding: 50px 20px;
}
.state-center .icon-circle {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.8rem;
  background: var(--primary-light);
}
.state-center .icon-circle.success { background: var(--success-light); }
.state-center .icon-circle.error { background: var(--danger-light); }

.login-box { max-width: 360px; margin: 40px auto 0; }

.detail-row { margin-bottom: 12px; font-size: 0.92rem; }
.detail-row .label { color: var(--muted); font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 2px; }
.sig-img { max-width: 100%; border: 1px solid var(--border); border-radius: 9px; background: #fff; margin-top: 4px; }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.error-text { color: var(--danger); font-size: 0.88rem; margin-top: 8px; }
