/* --- reset --- */
* {
    padding: 0;
    margin: 0;
    outline: none;
}

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

a {
    text-decoration: none;
}

img, button::-moz-focus-inner {
    border: none
}

button {
    border: none;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer
}

button:focus {
    outline: none;
    border: none;
}

input, textarea, button, select, a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation
}

span {
    display: inline-block;
}

div, section {
    position: relative;
    display: block;
    box-sizing: border-box;
}

img {
    image-rendering: auto;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

input[type=search] {
    -webkit-appearance: none
}

ul, li {
    list-style: none;
}

/* Safari */
@-webkit-keyframes spin {
    0% {
        -webkit-transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        -webkit-transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

:root {
    --color-primary: #1b718a;
    --color-secondary: #04243b;
    --color-accent: #ffb100;
    --color-success: #51c805;
    --color-error: #a32828;
    --btn-height: 48px;
}

html,
body {
    font-family: 'Noto Serif HK', serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
}

body.blocked {
    overflow: hidden !important;
}

body.blocked::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(33, 33, 33);
    opacity: 0.46;
}

.disable-pointer {
    pointer-events: none !important;
}

.hide {
    display: none !important;
}

.sign-block {
    position: relative;
    flex: 1;
    width: 100%;
    border: 1px solid rgba(91, 91, 91, 0.1);
    border-radius: 5px;
}

.sign-block>canvas {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

.success-holder,
.disabled-holder {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    background-color: #ffffff;
}

/* --------- Button CSS --------- */
.btn-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-wrapper>button {
    margin: 1em;
    background-color: #1b718a;
    border: 1px solid #1b718a;
    color: #ffffff;
}

.btn-wrapper>button#sig-clearBtn {
    background-color: #919191;
    border-color: #919191;
}

.btn-pri {
    position: relative;
    width: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 1rem;
    padding: 0.5em 1.5em;

    cursor: pointer;
}

.btn-pri>span {
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.btn-pri[data-status="loading"] {
    pointer-events: none;
}

.btn-pri[data-status="loading"]>span {
    visibility: hidden;
}

.btn-pri::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    display: none;
}

.btn-pri::after {
    border-radius: 100%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top: 2px solid #ffffff !important;
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
}

.btn-pri[data-status="loading"]::after {
    display: block;
}

/* --------- Site Alert Css --------- */
.site-alert {
    z-index: 100;
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%) scale(0);
    /* Safari & Chrome */
    -moz-transform: translate(-50%, -50%) scale(0);
    /* Firefox */
    -ms-transform: translate(-50%, -50%) scale(0);
    /* Internet Explorer */
    -o-transform: translate(-50%, -50%) scale(0);
    transform: translate(-50%, -50%) scale(0);
    width: 500px;
    max-width: 90%;
    max-width: calc(100% - 40px);
    background-color: #ffffff;
    box-shadow: 0px 0px 5px -5px rgba(0, 0, 0, 0.2) !important;
    border-radius: 5px;
    -webkit-transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    display: block;
}

.site-alert.show {
    -webkit-transform: translate(-50%, -50%) scale(1);
    /* Safari & Chrome */
    -moz-transform: translate(-50%, -50%) scale(1);
    /* Firefox */
    -ms-transform: translate(-50%, -50%) scale(1);
    /* Internet Explorer */
    -o-transform: translate(-50%, -50%) scale(1);
    transform: translate(-50%, -50%) scale(1);
}

.site-alert>* {
    z-index: 2;
    position: relative;
}

.site-alert .msg-header {
    background-color: var(--color-primary);
    padding: 1em 1.25em;
    width: 100%;
    color: #ffffff;
    font-size: 1em;
    font-weight: 900;
    display: block;
    border-radius: 5px 5px 0 0;
}

.site-alert[data-status="success"] .msg-header {
    background-color: var(--color-success);
}

.site-alert[data-status="warning"] .msg-header {
    background-color: var(--color-accent);
}

.site-alert[data-status="error"] .msg-header {
    background-color: var(--color-error);
}

.site-alert .msg-content {
    padding: 1.25em;
    width: 100%;
    font-size: .875em;
    color: #0B0B0B;
    display: block;
    background: #ffffff;
    border-radius: 0 0 5px 5px;
    font-weight: 400;
}

.site-alert .btn-close {
    width: 25px;
    height: 25px;
    position: absolute;
    top: 1em;
    right: 1em;
    z-index: 5;
    cursor: pointer;
    background: no-repeat;
    border: none;
}

.site-alert .btn-close::before,
.site-alert .btn-close::after {
    content: '';
    width: 70%;
    height: 3px;
    background-color: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 50px;
    pointer-events: none;
}

.site-alert .btn-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* --------- Form Css --------- */
input[data-hidden="true"] {
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.input-row {
    display: flex;
    width: 100%;
}

.input-row>.input-col:not(:last-of-type) {
    margin-right: 1.5em;
}

.input-col {
    width: 100%;
    margin-bottom: 1.25em;
}

.label {
    color: #313131;
    display: block;
    margin-bottom: 5px;
    font-size: .875rem;
    font-weight: 400;
}

/* ----- Input Error ----- */
.input-des {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.input-des * {
    font-size: .75rem;
    font-weight: 400;
}

.input-des .input-error {
    color: #DE0303;
    display: none;
}

.input-des .input-error.show {
    display: block;
}

/* ----- Normal Input ----- */
.custom-input {
    width: 100%;
    padding: 5px 10px;
    position: relative;
}

.custom-input input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 1rem;
    width: 100%;
    position: relative;
    color: #000000;
    z-index: 2;
}

.custom-input input {
    height: 40px;
}

.custom-input .custom-input__field {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid #c7cbd8;
    background: transparent;
    pointer-events: none;
    top: 0;
    left: 0;
    border-radius: 5px;
}

.custom-input input:focus~.custom-input__field,
.custom-input input:hover~.custom-input__field,
.custom-input input.has-value~.custom-input__field {
    border-color: #000000;
}

.custom-input input.error~.custom-input__field {
    border-color: var(--color-error) !important;
}

.custom-input input:disabled~.custom-input__field {
    border-color: #C7CBD8;
    background-color: #F5F5F5;
}

/* -------- Datepicker Input CSS ------- */
.custom-input-datepicker {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-width: 400px;
    z-index: 3;
    background-color: #ffffff;
    border: 1px solid #000000;
    display: block;
    -webkit-transform: scale(0);
    /* Safari & Chrome */
    -moz-transform: scale(0);
    /* Firefox */
    -ms-transform: scale(0);
    /* Internet Explorer */
    -o-transform: scale(0);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    border-top-color: transparent;
}

.custom-input.picker-active .custom-input-datepicker {
    -webkit-transform: scale(1);
    /* Safari & Chrome */
    -moz-transform: scale(1);
    /* Firefox */
    -ms-transform: scale(1);
    /* Internet Explorer */
    -o-transform: scale(1);
    transform: scale(1);
}

.custom-input.picker-active .custom-input__field {
    border-color: #000000;
}

/* -------- Select CSS ------- */
.custom-select {
    display: block;
    position: relative;
    width: 100%;
}

.custom-select select {
    width: 0;
    height: 0;
    visibility: hidden;
    pointer-events: none;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute;
    top: 0;
    left: 0;
}

.custom-select__field {
    padding: 5px 25px 5px 10px;
    width: 100%;
    /* 跟返其他input調整 */
    height: 50px;

    border: 1px solid #c7cbd8;
    background: #ffffff;
    cursor: pointer;
    color: #bcbcbc;
    font-size: 1rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 5px;
}

.custom-select__field>span {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    width: 100%;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

.custom-select:hover .custom-select__field,
.custom-select.active .custom-select__field,
.custom-select select.has-value~.custom-select__field {
    border-color: #000000;
}

.custom-select select.error~.custom-select__field {
    border-color: var(--color-error) !important;
}

.custom-select select.has-value~.custom-select__field {
    color: #000000;
}

.custom-select.active .custom-select__field::after,
.custom-select:hover .custom-select__field::after,
.custom-select select.has-value~.custom-select__field::after {
    border-right-color: #000000;
    border-bottom-color: #000000;
}

.custom-select__field::after {
    content: "";
    border-bottom: 2px solid #c7cbd8;
    border-right: 2px solid #c7cbd8;
    height: 8px;
    width: 8px;

    position: absolute;
    display: block;
    pointer-events: none;
    top: 50%;
    right: 10px;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease-in-out;
}

.custom-select.active .custom-select__field::after {
    transform: translateY(-50%) rotate(225deg);
}

.custom-select select.hide-option~.custom-select__field::after {
    display: none !important;
}

.custom-select__options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: auto;
    background-color: #ffffff;
    border: 1px solid #000000;
    z-index: 3;
    list-style: none;
    display: block;
    -webkit-transform: scale(0);
    /* Safari & Chrome */
    -moz-transform: scale(0);
    /* Firefox */
    -ms-transform: scale(0);
    /* Internet Explorer */
    -o-transform: scale(0);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    border-top-color: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 30vh;
}

.custom-select.option-top .custom-select__options {
    top: unset;
    bottom: 100%;
    border-top-color: #000000;
    border-bottom-color: transparent;
    transform-origin: bottom;
}

.custom-select.active .custom-select__options {
    -webkit-transform: scale(1);
    /* Safari & Chrome */
    -moz-transform: scale(1);
    /* Firefox */
    -ms-transform: scale(1);
    /* Internet Explorer */
    -o-transform: scale(1);
    transform: scale(1);
}

.custom-select__options>* {
    width: 100%;
    position: relative;
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: #000000;
    padding: 5px 10px;
    cursor: pointer;
    background-color: #ffffff;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.custom-select__options>*:hover,
.custom-select__options>*.selected {
    background-color: var(--color-accent);
    color: #000000;
}

.custom-select__options>*.selected {
    pointer-events: none;
}

input[type="checkbox"]:disabled~label,
input[type="radio"]:disabled~label {
    pointer-events: none;
    color: #d3d3d3;
}

  /*----- Square Checkbox CSS -----*/
  .square-checkbox input[type="checkbox"],
  .square-checkbox input[type="radio"] {
    width: 0;
    height: 0;
    visibility: hidden;
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute;
    top: 0;
    left: 0;
  }

  .square-checkbox {
    width: 100%;
    margin-top: 15px;
    display: block;
  }

  .square-checkbox > label {
    display: flex;
    align-items: flex-start;
    line-height: 1.5;
    font-size: 1rem;
    font-weight: 400;
    position: relative;
  }

  .square-checkbox > label::before {
    content: "";
    position: relative;
    display: block;
    width: 1em;
    height: 1em;
    min-width: 1em;
    background-color: transparent;
    border: 2px solid #000000;
    margin-right: 10px;
    cursor: pointer;
    margin-top: .4em;
  }

  .square-checkbox > input[type="checkbox"]:disabled~label::before,
  .square-checkbox > input[type="radio"]:disabled~label::before {
    border-color: #d3d3d3;
  }

  .square-checkbox > input[type="checkbox"]:checked ~ label::before,
  .square-checkbox > input[type="radio"]:checked ~ label::before {
    background-color: #000000;
  }

  .square-checkbox > label::after {
    content: "\2713";
    position: absolute;
    top: .6em;
    left: 0.1em;
    font-size: .75em;
    width: 1em;
    height: 1em;
    line-height: 1;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #ffffff;
    pointer-events: none;
  }

  .square-checkbox > input[type="checkbox"]:checked ~ label::after,
  .square-checkbox > input[type="radio"]:checked ~ label::after {
    display: flex;
  }

  .square-checkbox > input[type="checkbox"].error ~ label::before,
  .square-checkbox > input[type="radio"].error ~ label::before {
    border-color: #de0303;
  }