/* =========================================================
   GRUNDLAYOUT
========================================================= */

#gwp-pdf-sign-app {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    font-family: Roboto Condensed, Arial, Helvetica, sans-serif;
    color: #526f9e;
}

#gwp-pdf-sign-app *,
#gwp-pdf-sign-app *::before,
#gwp-pdf-sign-app *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   Workflow
   --------------------------------------------------------- */

.gwp-workflow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0 auto 0px;
}

.gwp-workflow-step {
    position: relative;
    background: #dbe3ff;
    border-radius: 18px;
    padding: 25px 20px;
    text-align: center;
}

.gwp-workflow-number {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #39cc00;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
}

.gwp-workflow-step h3 {
    margin: 0 0 8px;
    color: #383b42;
    font-size: 20px;
}

.gwp-workflow-step p {
    margin: 0;
    color: #383b42;
    font-size: 16px;
    line-height: 1.5;
}



/* =========================================================
   BUTTONS
========================================================= */

.gwp-pdf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.gwp-help-under-pdf {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 15px;
}

.gwp-help-under-pdf .gwp-btn-help {
    background: #39cc00;
    color: #fff;
    border-color: #39cc00;
    min-width: 85px;
}

.gwp-help-under-pdf .gwp-btn-help:hover:not(:disabled) {
    background: #2fb000;
    border-color: #2fb000;
}

.gwp-btn {
    appearance: none;
    border: 0px solid #dbe3ff;
    background: #fff;
    color: #383b42;
    padding: 10px 10px;
    border-radius: 250px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease,
        opacity .15s ease;
}

.gwp-btn:hover:not(:disabled) {
    border-color: #39cc00;
}

.gwp-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.gwp-btn-primary {
    background: #39cc00;
    color: #fff;
    border-color: #39cc00;
}

.gwp-btn-primary:hover:not(:disabled) {
    background: #2fb000;
    border-color: #2fb000;
}

.gwp-btn-danger {
    color: #c62828;
}

.gwp-btn-download {
    background: #383b42;
    color: #fff;
    border-color: #383b42;
}

.gwp-btn-download:hover:not(:disabled) {
    background: #22242a;
}


/* =========================================================
   STATUS
========================================================= */

.gwp-pdf-status {
    padding: 4px 30px;
    border-radius: 250px;
    background: #f8d0ff;
    margin-bottom: 15px;
    font-size: 23px;
    color: #ff008f;
    font-weight: 700;
    text-align: center;
}

.gwp-pdf-status.success {
    background: #d4ffc5;
    color: #39cc00;
}

.gwp-pdf-status.error {
    background: #f8d0ff;
    color: #ff008f;
}


/* =========================================================
   DOWNLOAD FALLBACK
========================================================= */

.gwp-download-fallback {

}

.gwp-download-fallback a {
    color: #526f9e;
    font-weight: 700;
    text-decoration: underline;
}


/* =========================================================
   PDF NAVIGATION
========================================================= */

.gwp-pdf-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.gwp-page-btn {
    width: 60px;
    height: 42px;
    padding: 0;
    border: 1px solid #39cc00;
    background: #39cc00;
    color: #fff;
    border-radius: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.gwp-page-btn:hover:not(:disabled) {
    background: #2fb000;
    border-color: #2fb000;
}

.gwp-page-btn:disabled {
    opacity: .99;
    cursor: not-allowed;
}

#gwp-page-info {
    min-width: 100px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}


/* =========================================================
   PDF VIEWER
========================================================= */

.gwp-pdf-stage {
    position: relative;
    width: 100%;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background: #dbe3ff;
    border-radius: 15px;
    overflow: auto;
}

.gwp-pdf-stage.gwp-upload-active {
    cursor: pointer;
}

.gwp-pdf-stage.gwp-drag-over {
    background: #c9d5f5;
    outline: 3px dashed #39cc00;
    outline-offset: -8px;
}

.gwp-pdf-stage.gwp-upload-active:hover {
    background: #d3dcf7;
}


.gwp-pdf-page {
    position: relative;
    display: none;
    flex: 0 0 auto;
    background: #fff;
    box-shadow: 0 3px 15px rgba(0,0,0,.0);
}

#gwp-pdf-canvas {
    display: block;
    max-width: none;
}


/* =========================================================
   SIGNATURE LAYER
========================================================= */

.gwp-signature-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gwp-signature {
    position: absolute;
    display: block;
    border: 2px solid transparent;
    cursor: move;
    pointer-events: auto;
    user-select: none;
    touch-action: none;
}

.gwp-signature.selected {
    border-color: #39cc00;
    border-radius: 15px;
}

.gwp-signature img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.gwp-signature-delete {
    position: absolute;
    top: -13px;
    right: -13px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #383b42;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    line-height: 15px;
    text-align: center;
    cursor: pointer;
    display: none;
    z-index: 10;
}

.gwp-signature.selected .gwp-signature-delete {
    display: block;
}

.gwp-signature-resize {
    position: absolute;
    right: -9px;
    bottom: -9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #39cc00;
    border: 3px solid #fff;
    cursor: nwse-resize;
    display: none;
    z-index: 11;
    touch-action: none;
}

.gwp-signature.selected .gwp-signature-resize {
    display: block;
}


/* =========================================================
   PLACEHOLDER
========================================================= */

.gwp-pdf-placeholder {
    display: flex;
    min-height: 460px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #526f9e;
    text-align: center;
}

.gwp-pdf-placeholder strong,
.gwp-pdf-placeholder span {
    display: block;
}

.gwp-placeholder-icon {
    width: 70px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #526f9e;
    border-radius: 8px;
    font-weight: 800;
    color: #526f9e;
    background: #ffffff4f
}


/* =========================================================
   HILFE / WILLKOMMEN
========================================================= */

.gwp-help-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: none;
}

.gwp-help-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gwp-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.78);
}

.gwp-help-dialog {
    position: relative;
    font-family: Arial, Helvetica, sans-serif;
    width: min(680px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
    background: #222;
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.gwp-help-content {
    padding: 34px 34px 30px;
}

.gwp-help-content h2 {
    margin: 0 0 18px;
    font-size: 30px;
    text-align: center;
    line-height: 1.2;
    color: #fff;
}

.gwp-help-content p {
    margin: 0 0 18px;
    color: #e6e6e6;
    font-size: 17px;
    line-height: 1.45;
}

.gwp-help-content ol {
    margin: 0 0 18px;
    padding-left: 28px;
    color: #fff;
    font-size: 17px;
    line-height: 1.5;
}

.gwp-help-content li {
    margin-bottom: 9px;
    padding-left: 3px;
}

.gwp-help-tip {
    margin-top: 18px !important;
}

.gwp-help-close {
    min-width: 110px;
    height: 42px;
    margin: 0 auto;
    padding: 0 18px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.gwp-help-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 22px;
}

.gwp-help-actions .gwp-btn {
    min-width: 110px;
}

.gwp-btn-help {
    color: #526f9e;
}

/* =========================================================
   MODAL
========================================================= */

.gwp-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}

.gwp-modal.open {
    display: block;
}

.gwp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}

.gwp-modal-dialog {
    position: relative;
    width: min(760px, calc(100% - 30px));
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,.25);
    overflow: hidden;
}

.gwp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 22px;
    border-bottom: 1px solid #eee;
}

.gwp-modal-header h3 {
    margin: 0 0 5px;
    font-size: 22px;
}

.gwp-modal-header p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

.gwp-modal-close {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #555;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}


/* =========================================================
   SIGNATURE CANVAS
========================================================= */

.gwp-signature-wrapper {
    margin: 20px;
    border: 2px dashed #cfcfcf;
    border-radius: 8px;
    background:
        linear-gradient(
            to bottom,
            transparent calc(100% - 70px),
            #e6e6e6 calc(100% - 70px),
            #e6e6e6 calc(100% - 69px),
            transparent calc(100% - 69px)
        );
    overflow: hidden;
}

#gwp-signature-canvas {
    display: block;
    width: 100%;
    height: 280px;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
}


/* =========================================================
   SIGNATURE ACTIONS
========================================================= */

.gwp-signature-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 15px 20px 20px;
    border-top: 1px solid #eee;
}

.gwp-signature-actions-right {
    display: flex;
    gap: 10px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .gwp-workflow {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 45px;
    }

    .gwp-workflow-step {
        padding: 20px 18px;
    }

    .gwp-workflow-number {
        width: 42px;
        height: 42px;
        font-size: 19px;
    }

    .gwp-workflow-step h3 {
        font-size: 19px;
    }
    
    
    .gwp-pdf-toolbar {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 9px;
    }

    .gwp-pdf-toolbar .gwp-btn,
    .gwp-pdf-toolbar label {
        width: 70%;
        min-height: 38px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 16px;
        line-height: 1.0;
        font-weight: 600;
    }

    .gwp-pdf-status {
        padding: 10px 18px;
        font-size: 18px;
        line-height: 1.35;
        text-align: center;
        border-radius: 20px;
    }

    .gwp-download-fallback {

    }

    .gwp-download-fallback a {
        text-align: center;
    }

    .gwp-pdf-navigation {
        gap: 12px;
    }

    .gwp-page-btn {
        width: 65px;
        height: 35px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
        line-height: 1;
    }

    #gwp-page-info {
        min-width: 85px;
        font-size: 15px;
    }

    .gwp-pdf-stage {
        min-height: 420px;
        padding: 10px;
    }

    .gwp-help-under-pdf {
        justify-content: center;
        margin-top: 10px;
        margin-bottom: 15px;
    }

    .gwp-help-under-pdf .gwp-btn-help {
        width: 60%;
        min-width: 0;
    }
    
    .gwp-help-modal.open {
        align-items: flex-start;
        padding: 12px;
    }

    .gwp-help-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }

    .gwp-help-content {
        padding: 28px 20px 22px;
    }

    .gwp-help-content h2 {
        margin: 0 0 18px;
        font-size: 26px;
        line-height: 1.2;
        text-align: center;
    }

    .gwp-help-content p,
    .gwp-help-content ol {
        font-size: 16px;
        line-height: 1.45;
    }

    .gwp-help-content ol {
        padding-left: 23px;
    }

    .gwp-help-actions {
        justify-content: center;
    }

    .gwp-help-actions .gwp-btn {
        min-width: 130px;
    }

    .gwp-help-close {
        min-width: 120px;
        height: 42px;
        font-size: 15px;
        margin: 0 auto;
    }

    .gwp-modal-dialog {
        margin: 2vh auto;
    }

    #gwp-signature-canvas {
        height: 230px;
    }

    .gwp-signature-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .gwp-signature-actions-right {
        width: 100%;
    }

    .gwp-signature-actions-right .gwp-btn {
        flex: 1;
    }
}
