/* =========================================================
   GUARDIAN SIGN OFF
   FULL UI CSS
   JS / LOGIC TIDAK DIUBAH
========================================================= */

:root {
    --guardian-blue: #005baa;
    --guardian-blue-dark: #003f7d;
    --guardian-blue-light: #eaf4ff;

    --guardian-green: #00a86b;
    --guardian-green-dark: #008f5b;

    --text: #172033;
    --text-soft: #4b5b70;
    --muted: #7b8796;

    --background: #f3f6fa;
    --card: #ffffff;

    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    --radius: 18px;

    --shadow:
        0 20px 50px rgba(15, 35, 60, 0.12);
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}


/* =========================================================
   BODY
========================================================= */

body {
    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    display: flex;

    justify-content: center;
    align-items: center;

    min-height: 100vh;

    margin: 0;

    padding: 24px;

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(0, 91, 170, 0.08),
            transparent 32%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(0, 168, 107, 0.06),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #f7f9fc 0%,
            #eef3f8 100%
        );

    color: var(--text);

    -webkit-font-smoothing: antialiased;
}


/* =========================================================
   MAIN CONTAINER
========================================================= */

.container {
    width: 100%;

    max-width: 650px;

    background: var(--card);

    border-radius: var(--radius);

    overflow: hidden;

    border: 1px solid rgba(0, 0, 0, 0.04);

    box-shadow: var(--shadow);
}


/* =========================================================
   HEADER
========================================================= */

.header {
    position: relative;

    padding: 28px 30px 27px;

    background:
        linear-gradient(
            135deg,
            var(--guardian-blue-dark) 0%,
            var(--guardian-blue) 100%
        );

    color: #ffffff;

    overflow: hidden;
}


/* Decorative circles */

.header::before {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    right: -100px;
    top: -120px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.07);
}


.header::after {
    content: "";

    position: absolute;

    width: 120px;
    height: 120px;

    right: 80px;
    bottom: -85px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.045);
}


/* =========================================================
   BRAND
========================================================= */

.brand {
    position: relative;

    z-index: 2;

    display: flex;

    align-items: center;

    gap: 12px;
}


.brand-mark {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #f77103;

    color: var(--guardian-blue);

    font-size: 22px;

    font-weight: 800;

    box-shadow:
        0 7px 18px rgba(0, 0, 0, 0.16);
}


.brand-name {
    font-size: 16px;

    font-weight: 800;

    letter-spacing: 1.6px;

    line-height: 1.2;
}


.brand-subtitle {
    margin-top: 3px;

    font-size: 11px;

    line-height: 1.2;

    opacity: 0.72;

    letter-spacing: 0.4px;
}


/* =========================================================
   HEADER TITLE
========================================================= */

.header-title {
    position: relative;

    z-index: 2;

    margin-top: 24px;

    font-size: 22px;

    line-height: 1.25;

    font-weight: 700;

    letter-spacing: 0.1px;
}


.header-description {
    position: relative;

    z-index: 2;

    margin-top: 6px;

    font-size: 13px;

    opacity: 0.72;

    letter-spacing: 0.2px;
}


/* =========================================================
   SECTION
========================================================= */

.section {
    padding: 24px 30px 0;
}


.section-title {
    display: flex;

    align-items: center;

    gap: 9px;

    margin-bottom: 15px;

    font-size: 14px;

    font-weight: 700;

    line-height: 1.2;

    color: #26364d;
}


.section-icon {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: rgba(0, 91, 170, 0.09);

    color: var(--guardian-blue);

    font-size: 14px;

    font-weight: 700;
}


/* =========================================================
   DOCUMENT INFORMATION
========================================================= */

.info {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;

    padding: 16px;

    margin-bottom: 4px;

    border: 1px solid var(--border);

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #fbfcfe,
            #f7f9fc
        );
}


.info-item {
    display: flex;

    flex-direction: column;

    gap: 5px;

    min-width: 0;

    padding: 2px 4px;
}


.info-label {
    font-size: 10px;

    line-height: 1.2;

    font-weight: 700;

    color: var(--muted);

    letter-spacing: 0.9px;
}


.info-value {
    font-size: 15px;

    line-height: 1.3;

    font-weight: 600;

    color: var(--text);

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
   SIGNATURE SECTION
========================================================= */

.signature-section {
    padding-top: 26px;
}


/* =========================================================
   SIGNATURE INSTRUCTION
========================================================= */

.signature-instruction {
    display: flex;

    align-items: flex-start;

    gap: 11px;

    margin-bottom: 14px;

    padding: 13px 14px;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #f1f8ff,
            #f5faff
        );

    border: 1px solid #dcecfb;

    color: #38516b;
}


.instruction-icon {
    width: 23px;
    height: 23px;

    flex: 0 0 23px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-top: 1px;

    border-radius: 50%;

    background: var(--guardian-blue);

    color: #ffffff;

    font-size: 12px;

    font-weight: 700;
}


.signature-instruction strong {
    display: block;

    margin-bottom: 3px;

    font-size: 12px;

    line-height: 1.4;

    color: #27415c;
}


.signature-instruction p {
    margin: 0;

    font-size: 11px;

    line-height: 1.55;

    color: #647b91;
}


/* =========================================================
   CANVAS WRAPPER
========================================================= */

.canvas-wrapper {
    position: relative;

    padding: 5px;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #dce4ed,
            #eef2f6
        );

    box-shadow:
        0 4px 12px rgba(15, 35, 60, 0.04);
}


/* =========================================================
   SIGNATURE CANVAS
========================================================= */

#signatureCanvas {
    display: block;

    width: 100%;

    height: 250px;

    box-sizing: border-box;

    border: 2px dashed #aeb9c7;

    border-radius: 10px;

    background: #ffffff;

    cursor: crosshair;

    touch-action: none;

    -webkit-user-select: none;
    user-select: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


#signatureCanvas:hover {
    border-color: var(--guardian-blue);

    box-shadow:
        inset 0 0 0 1px rgba(0, 91, 170, 0.08);
}


/* =========================================================
   CANVAS LABEL
========================================================= */

.canvas-label {
    position: absolute;

    right: 15px;
    bottom: 13px;

    pointer-events: none;

    user-select: none;

    font-size: 9px;

    line-height: 1;

    font-weight: 700;

    letter-spacing: 1.2px;

    color: #c1cad4;
}


/* =========================================================
   BUTTON GROUP
========================================================= */

.button-group {
    display: flex;

    gap: 12px;

    padding: 25px 30px 20px;
}


/* =========================================================
   BUTTON BASE
========================================================= */

button {
    flex: 1;

    min-height: 49px;

    padding: 12px 18px;

    border: none;

    border-radius: 11px;

    font-family: inherit;

    font-size: 13px;

    font-weight: 700;

    line-height: 1;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease,
        opacity 0.15s ease;
}


button:active {
    transform: translateY(1px);
}


.button-icon {
    margin-right: 6px;

    font-size: 15px;

    vertical-align: -1px;
}


/* =========================================================
   CLEAR BUTTON
========================================================= */

#clearBtn {
    background: #f1f3f5;

    color: #4b5563;

    border: 1px solid #e0e4e8;

    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.03);
}


#clearBtn:hover {
    background: #e7eaee;

    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.07);
}


/* =========================================================
   SUBMIT BUTTON
========================================================= */

#submitBtn {
    background:
        linear-gradient(
            135deg,
            var(--guardian-green),
            var(--guardian-green-dark)
        );

    color: #ffffff;

    box-shadow:
        0 7px 17px rgba(0, 168, 107, 0.22);
}


#submitBtn:hover {
    background:
        linear-gradient(
            135deg,
            #00b574,
            #009b63
        );

    box-shadow:
        0 9px 21px rgba(0, 168, 107, 0.28);
}


#submitBtn:disabled {
    box-shadow: none;

    cursor: not-allowed;
}


/* =========================================================
   FOOTER
========================================================= */

.footer {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding: 13px 30px;

    border-top: 1px solid #edf0f3;

    background: #fafbfc;

    color: #9aa4af;

    font-size: 9px;

    line-height: 1.3;

    letter-spacing: 0.3px;
}


/* =========================================================
   SUCCESS SCREEN
========================================================= */

.container > div[style*="text-align:center"] {
    box-sizing: border-box;

    width: 100%;

    min-height: 300px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;
}


/* Success title */

.container > div[style*="text-align:center"] h2 {
    margin-top: 0;

    margin-bottom: 10px;

    font-size: 25px;

    font-weight: 700;

    letter-spacing: 0.2px;

    color: var(--guardian-green-dark);
}


/* Success paragraph */

.container > div[style*="text-align:center"] p {
    font-size: 13px;

    line-height: 1.6;

    color: var(--text-soft);
}


/* =========================================================
   SUCCESS ICON
========================================================= */

.container > div[style*="text-align:center"] > div {
    font-size: 50px;

    margin-top: 20px;
}


/* =========================================================
   COUNTDOWN
========================================================= */

/*
   Penting:
   Countdown berada di dalam <p>.
   Jangan dibuat width/height 58px karena akan
   mengganggu layout teks.
*/

#logoutCountdown {
    display: inline-block;

    min-width: 26px;

    margin: 0 3px;

    padding: 3px 8px;

    border-radius: 7px;

    background: var(--guardian-blue);

    color: #ffffff;

    font-size: 17px;

    font-weight: 800;

    line-height: 1.2;

    text-align: center;

    vertical-align: middle;

    box-shadow:
        0 4px 10px rgba(0, 91, 170, 0.18);

    animation:
        countdownPulse 1s ease-in-out infinite;
}


@keyframes countdownPulse {

    0% {
        transform: scale(1);

        opacity: 1;
    }

    50% {
        transform: scale(1.08);

        opacity: 0.88;
    }

    100% {
        transform: scale(1);

        opacity: 1;
    }

}


/* =========================================================
   LOCKED / FINAL SCREEN
========================================================= */

body > div:not(.container) {
    color: var(--text);
}


body > div:not(.container) h1 {
    font-size: 27px;

    margin-bottom: 12px;
}


body > div:not(.container) p {
    color: var(--text-soft);

    font-size: 13px;

    line-height: 1.6;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    body {
        min-height: 100vh;

        padding: 12px;

        align-items: flex-start;
    }


    .container {
        margin-top: 10px;

        border-radius: 15px;
    }


    .header {
        padding: 23px 20px 24px;
    }


    .brand-mark {
        width: 40px;
        height: 40px;

        flex-basis: 40px;

        font-size: 20px;
    }


    .brand-name {
        font-size: 15px;

        letter-spacing: 1.4px;
    }


    .brand-subtitle {
        font-size: 10px;
    }


    .header-title {
        margin-top: 20px;

        font-size: 19px;
    }


    .header-description {
        font-size: 12px;
    }


    .section {
        padding-left: 20px;

        padding-right: 20px;
    }


    .info {
        grid-template-columns: 1fr;

        gap: 10px;

        padding: 14px;
    }


    .info-item {
        padding: 2px 3px;
    }


    .signature-section {
        padding-top: 23px;
    }


    .signature-instruction {
        padding: 12px;
    }


    #signatureCanvas {
        height: 230px;
    }


    .button-group {
        padding-left: 20px;

        padding-right: 20px;

        gap: 9px;
    }


    button {
        min-height: 47px;

        padding-left: 10px;

        padding-right: 10px;

        font-size: 12px;
    }


    .footer {
        padding-left: 20px;

        padding-right: 20px;

        flex-direction: column;

        justify-content: center;

        text-align: center;

        gap: 4px;
    }


    #logoutCountdown {
        min-width: 24px;

        margin: 0 2px;

        padding: 3px 7px;

        font-size: 16px;
    }


    .container > div[style*="text-align:center"] {
        min-height: 280px;

        padding: 35px 20px !important;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    body {
        padding: 8px;
    }


    .container {
        margin-top: 5px;

        border-radius: 13px;
    }


    .header {
        padding: 20px 17px 21px;
    }


    .brand-mark {
        width: 37px;
        height: 37px;

        flex-basis: 37px;

        font-size: 18px;
    }


    .brand-name {
        font-size: 13px;

        letter-spacing: 1.1px;
    }


    .brand-subtitle {
        font-size: 9px;
    }


    .header-title {
        font-size: 17px;
    }


    .section {
        padding-left: 17px;

        padding-right: 17px;
    }


    #signatureCanvas {
        height: 210px;
    }


    .button-group {
        flex-direction: column;

        padding-left: 17px;

        padding-right: 17px;
    }


    button {
        width: 100%;

        min-height: 46px;
    }


    .footer {
        padding-left: 17px;

        padding-right: 17px;
    }


    .container > div[style*="text-align:center"] {
        min-height: 260px;

        padding: 30px 15px !important;
    }


    #logoutCountdown {
        min-width: 23px;

        font-size: 15px;
    }

}


/* =========================================================
   ACCESS ERROR / EXPIRED PAGE
========================================================= */

body > h1 {
    margin: 0;

    padding: 40px 25px;

    font-size: 24px;

    text-align: center;

    color: var(--text);
}


body > p {
    color: var(--text-soft);

    text-align: center;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

button:focus-visible,
#signatureCanvas:focus-visible {
    outline: 3px solid rgba(0, 91, 170, 0.25);

    outline-offset: 3px;
}


/* =========================================================
   REDUCE MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }

}