@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600&display=swap');

/* ── Hero Demo Animation ── */

#heroDemoStage {
  position: relative;
  background: #f0f2f5;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.demo-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 270px;
  background: #eef0f3;
  transform-origin: top left;
  overflow: hidden;
}

.demo-vp {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 270px;
  transform-origin: top left;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* ── Field Palette ── */
.demo-palette {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 134px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.demo-pal-hdr {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  height: 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f1f3f5;
  background: #fafafa;
}

.demo-row {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  color: #343a40;
  border-left: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.demo-row.hovered {
  background: #f3f0ff;
  border-left-color: #6f42c1;
  padding-left: 8px;
}

.demo-row .dri {
  font-size: 12px;
  width: 16px;
  text-align: center;
  color: #6f42c1;
  flex-shrink: 0;
}

/* ── Document ── */
.demo-doc {
  position: absolute;
  top: 10px;
  left: 154px;
  width: 308px;
  height: 216px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.11);
  padding: 14px;
  overflow: hidden;
}

.demo-doc-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #212529;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 10px;
}

.dl {
  height: 6px;
  background: #dee2e6;
  border-radius: 2px;
  margin-bottom: 7px;
}
.dl.w90 { width: 90%; }
.dl.w75 { width: 75%; }
.dl.w85 { width: 85%; }
.dl.w60 { width: 60%; }
.dl.w80 { width: 80%; }
.dl.w65 { width: 65%; }

/* ── Placed Fields ── */
.demo-field {
  position: absolute;
  width: 150px;
  height: 28px;
  border: 2px solid #3b82f6;
  background: rgba(59, 130, 246, 0.07);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 5px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  color: #3b82f6;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.15s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.demo-field.popped {
  opacity: 1;
  transform: scale(1);
}

.demo-field .dfi {
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Drag Ghost ── */
.demo-ghost {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  background: white;
  border: 1.5px solid #3b82f6;
  border-radius: 4px;
  padding: 3px 8px 3px 6px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #3b82f6;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  z-index: 20;
  transition: opacity 0.18s ease;
  top: 0;
  left: 0;
}

.demo-ghost.visible {
  opacity: 0.92;
}

.demo-ghost .dgi {
  font-size: 12px;
}

/* ── Cursor ── */
.demo-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 20px;
  pointer-events: none;
  z-index: 30;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.35));
  transition: transform 0.55s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.3s ease;
}

.demo-cursor.clicking {
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.35)) brightness(0.85);
}

/* ── Assign Row ── */
.demo-assign-row {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-assign-btn {
  background: #6f42c1;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 13px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: default;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.demo-assign-btn.hovered {
  background: #5a32a3;
}

.demo-assign-btn.sending {
  background: #5a32a3;
  transform: scale(0.97);
}

/* ── Toast ── */
.demo-toast {
  position: absolute;
  top: 14px;
  right: 14px;
  background: white;
  border-left: 3px solid #28c840;
  border-radius: 4px;
  padding: 5px 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  color: #1a2027;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 40;
  white-space: nowrap;
  pointer-events: none;
}

.demo-toast.in {
  opacity: 1;
  transform: translateX(0);
}

/* ── Fade Overlay ── */
.demo-fade {
  position: absolute;
  inset: 0;
  background: #eef0f3;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
  z-index: 50;
}

.demo-fade.in {
  opacity: 1;
}

/* ── Scene container ── */
#demoScene {
  position: absolute;
  inset: 0;
}

/* ── Scene 2: Email Client ── */
.s2-email-client {
  position: absolute;
  inset: 0;
  display: flex;
  font-family: 'IBM Plex Sans', sans-serif;
}

.s2-sidebar {
  width: 82px;
  background: #1e2128;
  flex-shrink: 0;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
}

.s2-compose {
  font-size: 9px;
  color: #adb5bd;
  padding: 6px 10px 10px;
  border-bottom: 1px solid #2d3339;
  margin-bottom: 6px;
  white-space: nowrap;
}

.s2-sidebar-item {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  font-size: 10px;
  color: #8a929e;
  border-left: 2px solid transparent;
  cursor: default;
}

.s2-sidebar-item.active {
  background: #2d3339;
  color: white;
  border-left-color: #6f42c1;
}

.s2-si-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.s2-main {
  flex: 1;
  background: white;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.s2-search {
  height: 30px;
  margin: 8px 8px 0;
  background: #f1f3f4;
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 9.5px;
  color: #9aa0a6;
  flex-shrink: 0;
}

.s2-email-list {
  flex: 1;
  overflow: hidden;
  margin-top: 6px;
}

.s2-email-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f3f5;
  cursor: default;
  transition: background 0.12s;
}

.s2-email-row.hovered {
  background: #f0f4ff;
}

.s2-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4285f4;
  flex-shrink: 0;
}

.s2-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6f42c1;
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.s2-email-info {
  flex: 1;
  min-width: 0;
}

.s2-email-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.s2-email-sender {
  font-size: 10.5px;
  font-weight: 700;
  color: #1a1d21;
}

.s2-email-time {
  font-size: 9px;
  color: #80868b;
  flex-shrink: 0;
}

.s2-email-subject {
  font-size: 10px;
  font-weight: 600;
  color: #1a1d21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s2-email-preview {
  font-size: 9.5px;
  color: #80868b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s2-ghost-row {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f3f5;
}

.s2-gr-line {
  height: 6px;
  background: #e8eaed;
  border-radius: 2px;
}

/* ── Email detail (slides in from right) ── */
.s2-email-detail {
  position: absolute;
  inset: 0;
  background: white;
  padding: 10px 12px;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow: hidden;
}

.s2-email-detail.visible {
  transform: translateX(0);
}

.s2-detail-back {
  font-size: 9.5px;
  color: #4285f4;
  margin-bottom: 6px;
}

.s2-detail-subject {
  font-size: 11.5px;
  font-weight: 700;
  color: #1a1d21;
  margin-bottom: 3px;
}

.s2-detail-from {
  font-size: 9px;
  color: #80868b;
  margin-bottom: 6px;
}

.s2-detail-sep {
  height: 1px;
  background: #f1f3f5;
  margin-bottom: 8px;
}

.s2-body-line {
  height: 6px;
  background: #e8eaed;
  border-radius: 2px;
  margin-bottom: 6px;
}

.s2-cta-box {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
}

.s2-cta-title {
  font-size: 10px;
  font-weight: 700;
  color: #1a1d21;
  margin-bottom: 6px;
}

.s2-cta-line {
  height: 5px;
  background: #e8eaed;
  border-radius: 2px;
  margin-bottom: 5px;
}

.s2-cta-btn-row {
  margin-top: 9px;
  display: flex;
}

.s2-cta-btn {
  background: #6f42c1;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 13px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  cursor: default;
  transition: background 0.15s;
  white-space: nowrap;
}

.s2-cta-btn.hovered {
  background: #5a32a3;
}

/* ── Scene 2: Signing Document ── */
.s2-signing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.s2-signing.visible {
  opacity: 1;
}

.s2-sign-hdr {
  height: 24px;
  background: #1a1d21;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  flex-shrink: 0;
}

.s2-hdr-logo {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: white;
}

.s2-hdr-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 9px;
  color: #adb5bd;
}

.s2-hdr-url {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: #6c757d;
}

.s2-doc-area {
  flex: 1;
  background: #f4f5f7;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  overflow: hidden;
}

.s2-paper {
  width: 280px;
  background: white;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  padding: 14px;
}

.s2-paper-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #212529;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 9px;
}

.s2-field-box {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 26px;
  border: 2px solid #4a90d9;
  background: rgba(74, 144, 217, 0.07);
  border-radius: 4px;
  padding: 0 8px;
  margin-top: 8px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #4a90d9;
  cursor: default;
}

.s2-field-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.s2-field-box.active {
  animation: s2Pulse 1.2s ease-in-out infinite;
}

.s2-field-box.done {
  border-color: #2d9d5a;
  background: rgba(45, 157, 90, 0.07);
  color: #2d9d5a;
  animation: none;
}

@keyframes s2Pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 144, 217, 0.45); }
  50%       { box-shadow: 0 0 0 4px rgba(74, 144, 217, 0); }
}

.s2-sign-footer {
  height: 28px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  flex-shrink: 0;
}

.s2-finish-btn {
  background: #c8cdd4;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 4px 11px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  cursor: default;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.s2-finish-btn.enabled {
  background: #2d9d5a;
}

.s2-finish-btn.hovered {
  background: #26875a;
}

.s2-finish-btn.sending {
  background: #26875a;
  transform: scale(0.97);
}

.s2-finish-btn.done {
  background: #2d9d5a;
  transform: scale(1);
}

/* ── Scene 2: Signing Pad ── */
.s2-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 35;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 36px;
}

.s2-overlay.visible {
  opacity: 1;
}

.s2-pad {
  width: 248px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.s2-pad.visible {
  opacity: 1;
  transform: translateY(0);
}

.s2-pad-hdr {
  height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f3f5;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #1a2027;
}

.s2-pad-close {
  font-size: 14px;
  color: #adb5bd;
  line-height: 1;
}

.s2-sig-area {
  height: 80px;
  padding: 0 6px;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.s2-sig-area svg {
  display: block;
}

#s2SigPath {
  clip-path: inset(0 100% 0 0);
}


.s2-sig-baseline {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  height: 1px;
  background: #dee2e6;
}

.s2-sig-done-svg {
  height: 18px;
  width: auto;
  display: block;
}

.s2-pad-footer {
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
}

.s2-apply-btn {
  background: #6f42c1;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: default;
  transition: background 0.15s;
  white-space: nowrap;
}

.s2-apply-btn.hovered {
  background: #5a32a3;
}

/* ── Scene 3: Sender Dashboard ── */
.s3-app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  font-family: 'IBM Plex Sans', sans-serif;
}

.s3-app-hdr {
  height: 28px;
  background: #212529;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.s3-logo {
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.s3-hdr-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6f42c1;
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s3-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.s3-sidebar {
  width: 70px;
  background: #212529;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  flex-shrink: 0;
}

.s3-sb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  color: #8a929e;
  gap: 2px;
  cursor: default;
  border-left: 2px solid transparent;
}

.s3-sb-item.active {
  color: white;
  border-left-color: #6f42c1;
}

.s3-sb-icon { font-size: 13px; }
.s3-sb-label { font-size: 7.5px; }

.s3-main {
  flex: 1;
  padding: 12px;
  overflow: hidden;
}

.s3-breadcrumb {
  font-size: 9px;
  color: #6c757d;
  margin-bottom: 10px;
}

.s3-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
}

.s3-card-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

.s3-pkg-name {
  font-size: 12px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 2px;
}

.s3-pkg-meta {
  font-size: 8.5px;
  color: #6c757d;
}

.s3-badge {
  font-size: 8.5px;
  font-weight: 600;
  background: #d1e7dd;
  color: #0f5132;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.s3-divider {
  height: 1px;
  background: #f1f3f5;
  margin: 8px 0;
}

.s3-timeline {
  position: relative;
  padding-bottom: 6px;
}

.s3-tl-track {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  height: 3px;
  background: #dee2e6;
  border-radius: 2px;
}

.s3-tl-fill {
  height: 100%;
  background: #2d9d5a;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.s3-tl-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.s3-tl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.s3-tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dee2e6;
  border: 2px solid #f8f9fa;
  transition: background 0.4s ease;
  flex-shrink: 0;
}

.s3-tl-step.done .s3-tl-dot {
  background: #2d9d5a;
}

.s3-tl-label {
  font-size: 7.5px;
  color: #6c757d;
  white-space: nowrap;
}

.s3-tl-step.done .s3-tl-label {
  color: #2d9d5a;
  font-weight: 600;
}

.s3-cert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f3f5;
}

.s3-cert-hash {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: #6c757d;
}

.s3-cert-ts {
  font-size: 8px;
  color: #adb5bd;
}

/* ── Scene 4: CTA Billboard ── */
.s4-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  font-family: 'IBM Plex Sans', sans-serif;
}

.s4-logo {
  font-size: 11px;
  font-weight: 700;
  color: #6f42c1;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.s4-headline {
  font-size: 20px;
  font-weight: 600;
  color: #212529;
  text-align: center;
  line-height: 1.2;
}

.s4-sub {
  font-size: 10px;
  color: #6c757d;
  text-align: center;
}

.s4-btn {
  margin-top: 6px;
  display: inline-block;
  background: #6f42c1;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.s4-btn:hover {
  background: #5a32a3;
  color: white;
}
