/* ========================================
   eSignature — Page Styles
   ======================================== */

/* Hero: pen signing animation */
.esig-hero-anim { padding: 20px 24px; width: 100%; max-width: 420px; }

.esig-doc {
    background: #fff; border-radius: 10px; padding: 24px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex; flex-direction: column; gap: 12px;
}

.esig-doc-line { height: 6px; background: #e8edf5; border-radius: 3px; width: 100%; }
.esig-dl-short { width: 60%; }

.esig-sig-area {
    margin-top: 8px; border-top: 1px dashed #cbd5e1;
    padding-top: 12px; position: relative; height: 60px;
}

.esig-signature { width: 100%; height: 100%; }

.esig-sig-path {
    stroke-dasharray: 400; stroke-dashoffset: 400;
    animation: esigDraw 2.5s 0.5s ease forwards;
}

@keyframes esigDraw { 0% { stroke-dashoffset: 400; } 100% { stroke-dashoffset: 0; } }

.esig-pen {
    position: absolute; bottom: 4px; left: 5%;
    color: #7c3aed; font-size: 1rem;
    animation: esigMove 2.5s 0.5s ease forwards;
}

@keyframes esigMove {
    0% { left: 5%; bottom: 12px; }
    25% { left: 28%; bottom: 28px; }
    50% { left: 50%; bottom: 16px; }
    75% { left: 72%; bottom: 24px; }
    100% { left: 92%; bottom: 18px; }
}

/* ========================================
   Three-Stage Tracking
   ======================================== */
.esig-stages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    position: relative;
}

.esig-stage {
    text-align: center;
    padding: 28px 24px;
    position: relative;
}

.esig-stage-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: color-mix(in srgb, var(--es-c) 12%, white);
    color: var(--es-c);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin: 0 auto 16px;
    position: relative; z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.esig-stage:hover .esig-stage-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--es-c) 25%, transparent);
}

.esig-stage-line {
    position: absolute;
    top: 54px; right: -50%; width: 100%; height: 2px;
    background: linear-gradient(to right, var(--es-c), color-mix(in srgb, var(--es-c) 30%, #e2e8f0));
    z-index: 0;
}

.esig-stage:last-child .esig-stage-line { display: none; }

.esig-stage h4 {
    font-family: var(--font-heading); font-size: 1.05rem;
    font-weight: 700; color: var(--color-text-dark); margin-bottom: 8px;
}

.esig-stage p { font-size: 0.85rem; color: var(--color-text-light); line-height: 1.6; }

/* ========================================
   Placeholder Editor Animation
   ======================================== */
.esig-placeholder-anim {
    padding: 20px; width: 100%;
    display: flex; align-items: center; justify-content: center;
}

.esig-pa-doc {
    background: #fff; border-radius: 10px; padding: 20px 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; gap: 8px;
    width: 100%; max-width: 280px;
}

.esig-pa-line { height: 6px; background: #e8edf5; border-radius: 3px; }
.esig-pa-line.short { width: 55%; }

.esig-pa-ph {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex; align-items: center; gap: 6px;
    animation: esigPhAppear 2s ease-in-out infinite;
}

.esig-ph-sig {
    border: 2px dashed #a78bfa;
    color: #a78bfa;
    background: rgba(167,139,250,0.06);
    animation-delay: 0.3s;
}

.esig-ph-text {
    border: 2px dashed #639BF1;
    color: #639BF1;
    background: rgba(99,155,241,0.06);
    animation-delay: 0.8s;
}

@keyframes esigPhAppear {
    0%, 20% { opacity: 0; transform: scale(0.9); }
    30%, 80% { opacity: 1; transform: scale(1); }
    90%, 100% { opacity: 0; transform: scale(0.9); }
}

/* ========================================
   Send Animation
   ======================================== */
.esig-send-anim {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; padding: 20px; width: 100%; flex-wrap: wrap;
}

.esig-sa-template {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px; background: #fff; border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05); min-width: 70px;
}

.esig-sa-template i { font-size: 1.5rem; color: #ef4444; }
.esig-sa-template span { font-size: 0.6rem; font-weight: 600; color: #64748b; }

.esig-sa-arrow {
    font-size: 1.2rem; color: #a78bfa;
    animation: esigSendPulse 2s ease-in-out infinite;
}

@keyframes esigSendPulse {
    0%, 100% { opacity: 0.3; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(6px); }
}

.esig-sa-recipients { display: flex; flex-direction: column; gap: 6px; }

.esig-sa-r {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #fff; border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    font-size: 0.85rem; color: #64748b;
}

.esig-sa-check {
    width: 18px; height: 18px; border-radius: 50%;
    background: #10b981; color: #fff; font-size: 0.5rem;
    display: flex; align-items: center; justify-content: center;
}

.esig-sa-pending {
    width: 18px; height: 18px; border-radius: 50%;
    background: #f59e0b; color: #fff; font-size: 0.5rem;
    display: flex; align-items: center; justify-content: center;
}

.esig-sar-1 { animation: esigRecipient 0.4s 0.3s ease both; }
.esig-sar-2 { animation: esigRecipient 0.4s 0.6s ease both; }
.esig-sar-3 { animation: esigRecipient 0.4s 0.9s ease both; }

@keyframes esigRecipient {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .esig-stages { grid-template-columns: 1fr; gap: 16px; }
    .esig-stage-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .esig-sig-path, .esig-pen, .esig-pa-ph, .esig-sa-arrow,
    .esig-sar-1, .esig-sar-2, .esig-sar-3 { animation: none !important; opacity: 1; transform: none; }
    .esig-sig-path { stroke-dashoffset: 0; }
}
