@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');


html {
    font-family: 'Poppins', sans-serif;
}


:root {
    --primary: #53ABDE;
    --secondary: #53DE8180;
    --danger: rgba(237, 35, 35, 0.7);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



body {
    background-color: #f3f4f6;
    min-height: 100vh;
    margin: 0;
    line-height: 1.5;
}

.container {
    /*width: 100%;*/
    /*max-width: 100%;*/
    margin: 0 auto;
    padding: 20px;
}


#signatureModal {
    display: none;
    animation: fadein 300ms;
}

@keyframes fadein {
    from {
        opacity: 0;
    } to {
    opacity: 1;
          }
}

#complete-sec {
    animation: fadein 500ms;
}


#signatureCanvas {
    padding: 1px;
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='21' ry='21' stroke='%23939393FF' stroke-width='2' stroke-dasharray='14' stroke-dashoffset='8' stroke-linecap='square'/%3e%3c/svg%3e");
    border-radius: 20px;
    width: 100%;
}

@media (min-height: 300px) {
    signature-modal {
        height: 100%;
    }
}

@media (min-width: 768px) {
    .container {
        /*width: 90%;*/
        /*max-width: 800px;*/
        padding: 32px 16px;
    }
}

/*.upload-label {*/
/*    background-color: #53ABDE;*/
/*    color: white;*/
/*    padding: 8px 16px;*/
/*    border-radius: 4px;*/
/*    cursor: pointer;*/
/*    display: inline-block;*/
/*    font-size: 14px;*/
/*    transition: background-color 0.2s;*/
/*    margin-bottom: 16px;*/
/*    box-shadow: 0 2px 4px rgba(0,0,0,0.1);*/
/*}*/

/*.upload-label:hover {*/
/*    background-color: #2563eb;*/
/*}*/

#save-btn, #upload-pdf {
    transition: transform 0.2s ease-in-out;
}


.save-btn-sec {
    background-image: linear-gradient(to bottom, #21AC4F00, #000000E5);
}

.circle {
    transition: background-color 1s ease, transform 1s ease;
}


.pdf-viewer {
    background-color: #f3f4f6; /* Light gray background */
    /*padding: 12px;*/
    margin-bottom: 24px;
}

.relative {
    position: relative;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.absolute {
    /*overflow: clip;*/
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.signature-area {
    position: absolute;
    padding: 8px;
    border-radius: 50px;
    cursor: pointer;
    min-width: 100px;
    height: 50px; /* Make sure this matches the value used in JavaScript */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.signature-area img {
    max-width: 150px;
    max-height: 50px;
    object-fit: contain;
}

.edit-button {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    font-size: 14px;
}

.edit-button:hover {
    background: #2563eb;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal[style*="display: flex"] ~ .required-signatures,
.modal[style*="display: flex"] ~ .button-container {
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    padding: 20px;
    position: relative;
    z-index: 101;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    margin: 0;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/*#signatureCanvas {*/
/*    width: 100%;*/
/*    height: 200px;*/
/*    border: 1px solid #ccc;*/
/*    border-radius: 4px;*/
/*    margin-bottom: 20px;*/
/*    touch-action: none;*/
/*}*/

.signature-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.share-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25D366;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
}

.share-button:hover {
    background: #128C7E;
    transform: translateY(-2px);
}


.required-signatures {
    display: none; /* ricordarsi di toglierlo */
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
    z-index: 50;
}

/*canvas {*/
/*    max-width: 100%;*/
/*    height: auto;*/
/*}*/

.button-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 50;
}

.share-button, .download-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, background-color 0.2s;
}

.share-button {
    background: #25D366;
    color: white;
}

.share-button:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.download-button {
    background: #3b82f6;
    color: white;
}

.download-button:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.download-button svg {
    stroke: currentColor;
}

#go-to-next-signature-sec {
    background-image: linear-gradient(to bottom, #00000000, #000000CC);
}

#go-to-next-signature {
    transition: transform 0.2s ease-out;
}

.end-signed-pill {
    background-color: #FFFFFFBF;
}

#correct-sign-span {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.download-complete-sec-content {
    background-image: linear-gradient(to bottom, #21AC4F00, #21AC4FE5);
}

.download-complete-sec-content-error {
    background-image: linear-gradient(to bottom, #21AC4F00, rgba(237, 35, 35, 0.9));
}

.download-complete-sec-box {
    background: linear-gradient(to bottom,
    #FFFFFFA0 0%,  /* Inizio del gradiente */
    #FFFFFFC0 50%, /* Parte trasparente nel mezzo */
    #FFFFFFD0 100% /* Colore finale */
    );
}

.grow-btn-anim {
    transform: scale(1.08);
}

.grow-status-anim {
    transform: scale(1.005);
}

#clearSignature {
    opacity: 0.2;
}

#clearSignature ~ div {
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.animation-signature-buttonToSign-state {
    top: -60%;
    left: -50%;
}

.animation-signature-buttonToSign {
    animation: left-top-anim 500ms forwards;
}

.animation-signature-signedButton-state {
    left: 0;
    top: 0;
}

.animation-signature-signedInnerButton-state {
    background-color: #21AC4F;
}

.animation-signature-signedButton {
    animation: top-left-anim 500ms forwards;
}

.animation-signature-signedInnerButton  {
    animation: top-left-bg-change-anim 500ms forwards;
}

@keyframes left-top-anim {
    from {
        left: 0;
        top: 0;
    }
    to {
        top: -60%;
        left: -50%;
    }
}

@keyframes top-left-anim {
    from {
        top: -60%;
        left: -50%;
    }
    to {
          left: 0;
          top: 0;
      }

}

@keyframes top-left-bg-change-anim {
    from {
        background-color: var(--primary);
    } to {
        background-color: #21AC4F;
          }
}
