/* =========================================================
   GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f4f6f8;
}

body {
    margin: 0;

    background: #f4f6f8;
    color: #202a33;

    line-height: 1.55;
}


/* =========================================================
   PAGE SHELL
   ========================================================= */

.page-shell {
    width: min(1000px, 94%);

    margin: 0 auto;

    padding: 18px 0 50px;
}


/* =========================================================
   FORMS PORTAL LINK
   KEEP THIS
   ========================================================= */

.portal-link {
    display: inline-block;

    margin: 0 0 10px;

    color: #5f6b75;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;
}

.portal-link:hover {
    color: #1f2933;

    text-decoration: underline;
}


/* =========================================================
   MAIN ABC FORM HEADER
   ========================================================= */

.form-header {
    display: flex;
    align-items: center;

    gap: 14px;

    min-height: 92px;

    padding: 18px 22px;

    background: #1f2933;
    color: #ffffff;

    border-bottom: 5px solid #d9a928;

    border-radius: 10px 10px 0 0;
}


/* ABC GOLD BOX */

.brand-mark {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 54px;
    height: 54px;

    flex: 0 0 54px;

    border-radius: 9px;

    background: #d9a928;
    color: #1f2933;

    font-size: 19px;
    font-weight: 800;
}


/* HEADER TEXT */

.form-header-text h1 {
    margin: 0;

    color: #ffffff;

    font-size: 25px;
    font-weight: 700;

    line-height: 1.2;
}

.form-header-text p {
    margin: 4px 0 0;

    color: #d7dde2;

    font-size: 14px;
}


/* =========================================================
   OFFICIAL PDF NOTICE
   ========================================================= */

.notice-box {
    display: flex;
    flex-direction: column;

    gap: 3px;

    margin: 14px 0;

    padding: 13px 16px;

    background: #fff8dd;

    border: 1px solid #e4cf79;
    border-radius: 8px;

    color: #5d501b;

    font-size: 13px;
    line-height: 1.45;
}

.notice-box strong {
    color: #514515;

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   LANGUAGE PANEL
   ========================================================= */

.language-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin: 0 0 14px;

    padding: 17px 19px;

    background: #ffffff;

    border: 1px solid #dde2e6;
    border-radius: 9px;
}


/* LANGUAGE TEXT */

.language-copy strong {
    display: block;

    margin: 0 0 3px;

    color: #26323c;

    font-size: 14px;
    font-weight: 700;
}

.language-copy p {
    margin: 0;

    color: #66727d;

    font-size: 13px;
}


/* LANGUAGE BUTTONS */

.language-buttons {
    display: flex;

    flex-shrink: 0;

    gap: 8px;
}

.language-button {
    min-width: 96px;

    padding: 9px 15px;

    border: 2px solid #ccd3d8;
    border-radius: 7px;

    background: #ffffff;
    color: #26323c;

    cursor: pointer;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.language-button:hover {
    border-color: #b6bec5;
}

.language-button.active {
    border-color: #d9a928;

    background: #f8efd5;
    color: #1f2933;
}


/* =========================================================
   OFFICIAL DOCUMENT HEADER
   ========================================================= */

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 24px;

    padding: 20px 24px;

    background: #28343e;
    color: #ffffff;

    border-radius: 10px 10px 0 0;
}

.document-header h2 {
    margin: 0;

    color: #ffffff;

    font-size: 22px;
    font-weight: 700;

    line-height: 1.2;
}

.document-header p {
    margin: 4px 0 0;

    color: #d6dde2;

    font-size: 13px;
}


/* REVISION */

.document-revision {
    display: flex;
    flex-direction: column;

    flex-shrink: 0;

    text-align: right;

    color: #dce2e6;

    font-size: 11px;
    line-height: 1.45;
}


/* =========================================================
   AGREEMENT CARD
   ========================================================= */

.agreement-card {
    margin: 0 0 26px;

    padding: 28px;

    background: #ffffff;

    border-left: 1px solid #dde2e6;
    border-right: 1px solid #dde2e6;
    border-bottom: 1px solid #dde2e6;

    border-radius: 0 0 10px 10px;
}


/* AGREEMENT TEXT */

.agreement-language-content {
    font-size: 15px;
}

.agreement-language-content > p:first-child {
    margin-top: 0;
}

.agreement-language-content p {
    color: #303a43;
}

.agreement-language-content h3 {
    margin: 28px 0 11px;

    padding-bottom: 7px;

    border-bottom: 2px solid #e4e8eb;

    color: #26323c;

    font-size: 17px;
    font-weight: 700;
}

.agreement-language-content ul {
    margin-top: 10px;

    padding-left: 23px;
}

.agreement-language-content li {
    margin-bottom: 12px;

    color: #303a43;
}


/* =========================================================
   SPANISH TRANSLATION NOTE
   ========================================================= */

.translation-note {
    margin: 0 0 22px;

    padding: 13px 15px;

    background: #fff8dd;

    border: 1px solid #e4cf79;
    border-radius: 8px;

    color: #5d501b;

    font-size: 14px;
}


/* =========================================================
   COMPLETION SECTION
   ========================================================= */

.completion-section {
    margin-top: 34px;

    padding: 27px;

    background: #f8f9fa;

    border: 1px solid #dce2e6;
    border-radius: 10px;
}


/* COMPLETION HEADING */

.completion-heading {
    margin-bottom: 23px;
}

.completion-heading h2 {
    margin: 0 0 5px;

    color: #26323c;

    font-size: 22px;
}

.completion-heading p {
    margin: 0;

    color: #66727d;

    font-size: 14px;
}


/* =========================================================
   FORM FIELDS
   ========================================================= */

.field-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 18px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group-wide {
    grid-column: 1 / -1;
}

.field-group label {
    margin-bottom: 6px;

    color: #303a43;

    font-size: 14px;
    font-weight: 700;
}

.field-group input,
.field-group select {
    width: 100%;

    min-height: 47px;

    padding: 9px 11px;

    border: 2px solid #d4dade;
    border-radius: 7px;

    background: #ffffff;
    color: #202a33;

    font-family: inherit;
    font-size: 16px;
}

.field-group input:focus,
.field-group select:focus {
    outline: none;

    border-color: #b58a19;

    box-shadow:
        0 0 0 3px rgba(217, 169, 40, 0.18);
}


/* =========================================================
   ACKNOWLEDGMENT
   ========================================================= */

.agreement-confirmation {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    margin-top: 25px;

    padding: 16px;

    background: #ffffff;

    border: 1px solid #dce1e4;
    border-radius: 8px;

    color: #303a43;

    cursor: pointer;

    font-size: 14px;
    font-weight: 700;
}

.agreement-confirmation input {
    width: 21px;
    height: 21px;

    margin: 1px 0 0;

    flex: 0 0 auto;

    accent-color: #d9a928;
}


/* =========================================================
   SIGNATURE
   ========================================================= */

.signature-section {
    margin-top: 27px;
}

.signature-section h3 {
    margin: 0 0 4px;

    color: #26323c;

    font-size: 17px;
}

.signature-section > p {
    margin: 0 0 10px;

    color: #66727d;

    font-size: 14px;
}


/* SIGNATURE BOX */

.signature-wrapper {
    position: relative;

    width: 100%;
    height: 200px;

    background: #ffffff;

    border: 2px solid #9ea8af;
    border-radius: 8px;

    overflow: hidden;

    touch-action: none;
}

#signatureCanvas {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    cursor: crosshair;

    touch-action: none;
}

.signature-placeholder {
    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    pointer-events: none;

    color: #a2abb2;

    font-size: 18px;
}


/* CLEAR SIGNATURE */

#clearSignatureButton {
    margin-top: 10px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.secondary-button,
.cancel-button,
.primary-button {
    min-height: 43px;

    padding: 10px 16px;

    border-radius: 7px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    text-align: center;

    text-decoration: none;
}


/* CLEAR SIGNATURE */

.secondary-button {
    border: 1px solid #aab3ba;

    background: #ffffff;
    color: #28343e;

    cursor: pointer;
}

.secondary-button:hover {
    background: #f1f3f4;
}


/* CANCEL */

.cancel-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    min-width: 105px;

    border: 1px solid #abb4bb;

    background: #ffffff;
    color: #28343e;
}

.cancel-button:hover {
    background: #f1f3f4;
}


/* CREATE PDF */

.primary-button {
    min-width: 245px;

    border: 2px solid #c39418;

    background: #d9a928;
    color: #1f2933;

    cursor: pointer;
}

.primary-button:hover {
    background: #e1b63a;
}


/* =========================================================
   FORM MESSAGE
   ========================================================= */

.form-message {
    display: none;

    margin-top: 20px;

    padding: 13px 15px;

    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;
}

.form-message:not(:empty) {
    display: block;
}

.form-message.error {
    background: #fdecec;

    border: 1px solid #e4a4a4;

    color: #8c2525;
}

.form-message.success {
    background: #eaf7ed;

    border: 1px solid #9bc9a4;

    color: #236231;
}


/* =========================================================
   FORM ACTIONS
   ========================================================= */

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    gap: 12px;

    margin-top: 27px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.form-footer {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 2px;

    margin-top: 26px;

    padding: 22px 20px;

    background: #1f2933;
    color: #dbe1e5;

    border-radius: 9px;

    text-align: center;
}

.form-footer strong {
    font-size: 13px;
}

.form-footer span {
    color: #aeb7be;

    font-size: 11px;
}


/* =========================================================
   HIDDEN
   ========================================================= */

[hidden] {
    display: none !important;
}

.hidden {
    display: none !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .page-shell {
        width: min(100% - 20px, 1000px);

        padding-top: 12px;
    }


    /* HEADER */

    .form-header {
        min-height: 82px;

        padding: 16px;
    }

    .brand-mark {
        width: 48px;
        height: 48px;

        flex-basis: 48px;

        font-size: 17px;
    }

    .form-header-text h1 {
        font-size: 21px;
    }


    /* LANGUAGE */

    .language-panel {
        flex-direction: column;
        align-items: stretch;

        gap: 13px;
    }

    .language-buttons {
        width: 100%;
    }

    .language-button {
        flex: 1;
    }


    /* DOCUMENT */

    .document-header {
        align-items: flex-start;

        padding: 18px;
    }

    .document-header h2 {
        font-size: 19px;
    }


    /* AGREEMENT */

    .agreement-card {
        padding: 20px;

        font-size: 15px;
    }


    /* COMPLETION */

    .completion-section {
        padding: 20px;
    }


    /* FIELDS */

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field-group-wide {
        grid-column: auto;
    }


    /* SIGNATURE */

    .signature-wrapper {
        height: 185px;
    }


    /* ACTIONS */

    .form-actions {
        flex-direction: column-reverse;

        align-items: stretch;
    }

    .cancel-button,
    .primary-button {
        width: 100%;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 430px) {

    .document-header {
        flex-direction: column;

        gap: 8px;
    }

    .document-revision {
        align-items: flex-start;

        text-align: left;
    }

    .agreement-card {
        padding: 17px;
    }

    .completion-section {
        padding: 17px;
    }

}