/**
 * xSign CSS - Stiluri pentru Semnături Digitale
 */

/* Container principal */
.xsign-container {
    max-width: 100%;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Wrapper pentru secțiunile pad + preview */
.xsign-wrapper {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Secțiune pad și secțiune preview */
.xsign-pad-section,
.xsign-preview-section {
    flex: 1;
    min-width: 398px;
    max-width: 450px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Titlu secțiuni */
.xsign-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
}

/* Wrapper pentru canvas */
.xsign-canvas-wrapper {
    position: relative;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

/* Canvas */
.xsign-canvas {
    display: block;
    width: 398px;
    height: 198px;
    cursor: crosshair;
    touch-action: none;
}

/* Linie ghid pentru semnare */
.xsign-guide-line {
    position: absolute;
    bottom: 50px;
    left: 20px;
    right: 20px;
    height: 1px;
    border-bottom: 2px dashed #d1d5db;
    pointer-events: none;
}

/* Controale butoane */
.xsign-controls {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* Stiluri butoane */
.xsign-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xsign-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.xsign-btn:active {
    transform: translateY(0);
}

.xsign-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Buton Clear - roșu */
.xsign-btn-clear {
    background: #ef4444;
    color: #ffffff;
}

.xsign-btn-clear:hover {
    background: #dc2626;
}

/* Buton Save - verde */
.xsign-btn-save {
    background: #10b981;
    color: #ffffff;
}

.xsign-btn-save:hover {
    background: #059669;
}

/* Animație loading pentru buton */
.xsign-btn-loading {
    position: relative;
    color: transparent;
}

.xsign-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: xsign-spin 0.6s linear infinite;
}

@keyframes xsign-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mesaje de status */
.xsign-status {
    display: none;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

.xsign-status-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.xsign-status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.xsign-status-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Wrapper pentru imaginea preview */
.xsign-preview-wrapper {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-bottom: 10px;
}

/* Imaginea semnăturii salvate */
.xsign-preview-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Info preview */
.xsign-preview-info {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    margin-top: 8px;
}

/* Clasă pentru ascundere */
.xsign-hidden {
    display: none !important;
}

/* Mesaj eroare */
.xsign-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* Responsive - ecrane mici */
@media (max-width: 768px) {
    .xsign-wrapper {
        flex-direction: column;
    }
    
    .xsign-pad-section,
    .xsign-preview-section {
        min-width: 100%;
        max-width: 100%;
    }
    
    .xsign-canvas {
        width: 100%;
        height: auto;
        max-width: 398px;
    }
    
    .xsign-controls {
        flex-direction: column;
    }
    
    .xsign-btn {
        width: 100%;
    }
}



/* ============================================
   SECȚIUNE APLICARE SEMNĂTURĂ CU XSIGN
   ============================================ */

.xsign-apply-section {
    max-width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.xsign-apply-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.xsign-apply-button-wrapper {
    text-align: center;
    margin-bottom: 15px;
}

.xsign-btn-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.xsign-btn-apply:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.xsign-btn-apply:active:not(:disabled) {
    transform: translateY(-1px);
}

.xsign-btn-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.xsign-apply-icon {
    font-size: 24px;
}

.xsign-apply-info {
    color: #ffffff;
    font-size: 13px;
    margin-top: 10px;
    opacity: 0.9;
}

/* Container semnătură aplicată */
.xsign-applied-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.xsign-applied-wrapper {
    background: #f9fafb;
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-bottom: 15px;
}

.xsign-applied-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.xsign-applied-info {
    text-align: center;
    color: #10b981;
    font-size: 14px;
    font-weight: 600;
}

.xsign-applied-info small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}


/* ============================================
   SEMNĂTURĂ SCRISĂ CU FONT (Dancing Script)
   Adaugă tot acest cod la SFÂRȘITUL fișierului xsign.css
   ============================================ */

/* Container principal semnătură scrisă */
.ds-signature {
    display: inline-block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    text-align: left;
}

/* Label "xSigned by:" */
.ds-label {
    font-size: 11px;
    font-weight: 500;
    color: #333;
    margin-bottom: -3px;
    padding-left: 18px;
}

/* Container pentru SVG + nume */
.ds-body {
    position: relative;
    display: inline-block;
}

/* SVG decorativ - se suprapune pe body */
.ds-body svg {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    pointer-events: none;
}

/* Numele scris cu font handwriting */
.ds-name {
    font-family: 'Dancing Script', cursive;
    font-size: 28px;
    color: #111;
    line-height: 1.25;
    padding: 16px 20px 16px 16px;
    white-space: pre-line;
    position: relative;
    z-index: 1;
}

/* Cod securitate sub semnătură */
.ds-code {
    font-size: 10px;
    color: #555;
    margin-top: 2px;
    padding-left: 18px;
    letter-spacing: 0.01em;
}