:root {
    --reference-navy: #092063;
    --reference-button: #485a8a;
    --reference-button-border: #504a70;
    --reference-header: #5ea1d9;
    --reference-header-border: #a6c3dc;
    --reference-link: #092063;
    --primary: #092063;
    --primary-dark: #06194d;
    --primary-light: #257fb7;
    --success: #147a51;
    --warning: #a65d00;
    --danger: #b42318;
    --text-main: #333333;
    --text-muted: #59636d;
    --border: #cccccc;
    --focus: #ffbf47;
    --transition: 160ms ease;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #ffffff;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--text-main);
    background-color: #ffffff;
    background-image: url('../img/login/shc/bg.png');
    background-repeat: no-repeat;
    background-position: center 100px;
    background-size: cover;
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

button,
input,
a {
    letter-spacing: 0;
}

.login-wrapper {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.reference-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    height: 100px;
    border-bottom: 5px solid var(--reference-header-border);
    background-color: var(--reference-header);
    background-image: url('../img/login/shc/header.png');
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: auto 100%;
}

.reference-logo {
    display: block;
    width: 137px;
    max-width: min(42vw, 137px);
    height: 90px;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
}

.test-environment-warning {
    max-width: calc(100% - 157px);
    margin: 0;
    padding: 6px 16px;
    border: 3px solid #d40000;
    color: #d40000;
    background: #ffffff;
    font-size: 40px;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0;
    text-shadow: 2px 2px 2px #bdbdbd;
}

.login-stage {
    width: 100%;
    min-height: calc(100vh - 100px);
    padding: 8px 20px 28px;
}

.security-notice {
    width: min(100%, 1100px);
    margin: 0 auto;
    padding: 0;
    border: 0;
    color: #0000ff;
    background: transparent;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.6;
    text-align: center;
}

.platform-tabs {
    display: grid;
    width: min(100%, 400px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 54px auto 8px;
    border: 1px solid #9caac4;
    background: #ffffff;
}

.platform-tab {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 0;
    color: var(--reference-link);
    background: #ffffff;
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: color var(--transition), background-color var(--transition);
}

.platform-tab + .platform-tab {
    border-left: 1px solid #9caac4;
}

.platform-tab:hover {
    color: #ffffff;
    background: #6173a3;
}

.platform-tab.active,
.platform-tab[aria-current='page'] {
    color: #ffffff;
    background: var(--reference-button);
}

.platform-tab:focus-visible,
.footer-link:focus-visible,
.login-link:focus-visible,
.back-link:focus-visible,
.btn-login:focus-visible,
.btn-outline-light-sm:focus-visible,
.input-action:focus-visible,
.form-input:focus-visible,
.otp-input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.login-card {
    width: min(100%, 360px);
    margin: 0 auto;
    padding: 25px 24px 30px;
    border: 1px solid #bdbdbd;
    border-radius: 3px;
    color: var(--text-main);
    background: #ffffff;
    box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
}

.login-panel {
    display: none;
}

.login-panel.active {
    display: block;
}

.panel-title {
    margin: 0 0 26px;
    color: var(--reference-navy);
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.panel-subtitle {
    margin: -18px 0 20px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    color: #333333;
    font-size: 14px;
    font-weight: 400;
}

.required-star,
.form-label .required-star {
    margin-left: 3px;
    color: #c00000;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 11px;
    color: #00418e;
    font-size: 15px;
    pointer-events: none;
    transform: translateY(-50%);
}

.form-input {
    width: 100%;
    height: 43px;
    padding: 9px 34px 9px 32px;
    border: 1px solid #b2b2b2;
    border-radius: 3px;
    outline: none;
    color: #333333;
    background: #ffffff;
    box-shadow: inset 0 1px 4px rgb(168 168 168 / 60%);
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder {
    color: #8b8b8b;
}

.form-input:focus {
    border-color: rgb(91 90 90 / 70%);
    background: rgb(238 236 240 / 20%);
    box-shadow: inset 0 1px 4px rgb(168 168 168 / 90%);
}

.form-input.no-icon {
    padding-left: 9px;
}

.form-input.has-right {
    padding-right: 38px;
}

.input-action {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 4px;
    min-width: 32px;
    min-height: 32px;
    padding: 4px;
    border: 0;
    color: #c4c4c4;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.input-action:hover {
    color: #00418e;
}

.form-hint {
    margin-top: 4px;
    color: #666666;
    font-size: 12px;
}

.form-check-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-check-label-light {
    color: #555555;
    font-size: 13px;
    cursor: pointer;
}

.form-check-input {
    border-color: #a9a9a9;
    background-color: #ffffff;
}

.form-check-input:checked {
    border-color: var(--reference-navy);
    background-color: var(--reference-navy);
}

.alert-glass {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 9px 10px;
    border: 1px solid;
    border-radius: 3px;
    font-size: 13px;
}

.alert-glass.error {
    border-color: #d79b95;
    color: #7a271a;
    background: #fff3f2;
}

.alert-glass.success {
    border-color: #91c5aa;
    color: #0f5132;
    background: #edf9f3;
}

.alert-glass.info {
    border-color: #9ab6ce;
    color: var(--reference-navy);
    background: #f1f7fc;
}

.alert-small {
    font-size: 12px;
}

.alert-left {
    margin-bottom: 16px;
    text-align: left;
}

.btn-login {
    display: flex;
    width: 100%;
    min-height: 37px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 7px 10px;
    border: 1px solid var(--reference-button-border);
    border-radius: 3px;
    color: #ffffff;
    background: var(--reference-button);
    box-shadow: inset 0 1px rgb(255 255 255 / 40%), 0 2px 1px rgb(0 0 0 / 10%);
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    text-shadow: 0 1px 1px rgb(0 0 0 / 50%);
    cursor: pointer;
    transition: background-color var(--transition);
}

.btn-login:hover {
    background: #3f507d;
}

.btn-login:active {
    background: #00418e;
}

.btn-login:disabled {
    border-color: #8e93a2;
    background: #8e93a2;
    cursor: not-allowed;
}

.btn-outline-light-sm {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #9caac4;
    border-radius: 3px;
    color: var(--reference-link);
    background: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-outline-light-sm:hover {
    color: #ffffff;
    background: var(--reference-button);
}

.otp-group,
.d-flex-phone {
    display: flex;
    gap: 10px;
}

.otp-group input,
.d-flex-phone input:last-child {
    min-width: 0;
    flex: 1;
}

.d-flex-phone input:first-child {
    flex: 0 0 80px;
}

.btn-email-verification {
    display: inline-flex;
    width: 190px;
    min-height: 48px;
    flex: 0 0 190px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--reference-button-border);
    border-radius: 3px;
    color: #ffffff;
    background: var(--reference-button);
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    white-space: normal;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition);
}

.btn-email-verification:hover:not(:disabled) {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.btn-email-verification:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.btn-email-verification:disabled {
    border-color: #4f5d82;
    color: #ffffff;
    background: #5b6788;
    opacity: 1;
    cursor: not-allowed;
}

@media (max-width: 520px) {
    .otp-group {
        flex-direction: column;
    }

    .btn-email-verification {
        width: 100%;
        flex-basis: auto;
    }
}

.login-link,
.footer-link {
    color: var(--reference-link);
    font-size: 13px;
    text-decoration: none;
}

.login-link:hover,
.footer-link:hover {
    color: #257fb7;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 16px 0;
    color: #888888;
    font-size: 12px;
}

.divider::before,
.divider::after {
    flex: 1;
    height: 1px;
    content: '';
    background: #d4d4d4;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 42px));
    justify-content: center;
    gap: 5px;
    margin-bottom: 8px;
}

.otp-input {
    width: 100%;
    height: 46px;
    border: 1px solid #b2b2b2;
    border-radius: 3px;
    outline: none;
    color: var(--reference-navy);
    background: #ffffff;
    box-shadow: inset 0 1px 4px rgb(168 168 168 / 45%);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.otp-input:focus {
    border-color: #00418e;
}

.otp-countdown {
    color: #666666;
    font-size: 12px;
}

.otp-timer,
.text-primary-light {
    color: var(--reference-navy);
}

.strength-bar {
    display: flex;
    gap: 3px;
    margin-top: 6px;
}

.strength-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #d4d4d4;
}

.strength-segment.weak {
    background: var(--danger);
}

.strength-segment.medium {
    background: var(--warning);
}

.strength-segment.strong {
    background: var(--success);
}

.strength-label {
    margin-top: 4px;
    color: #666666;
    font-size: 12px;
}

.icon-circle,
.icon-circle-success {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border: 1px solid #91c5aa;
    border-radius: 50%;
    background: #edf9f3;
}

.icon-check {
    color: var(--success);
    font-size: 27px;
}

.mail-span {
    color: var(--reference-navy);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 16px;
    padding: 0;
    border: 0;
    color: var(--reference-link);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
}

.back-link:hover {
    color: #257fb7;
    text-decoration: underline;
}

.login-footer {
    width: min(100%, 1100px);
    margin: 86px auto 0;
    color: var(--reference-navy);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    text-shadow: 0 1px 1px rgb(255 255 255 / 90%);
}

.login-footer p {
    margin: 0 0 2px;
}

.login-footer .footer-link {
    color: var(--reference-navy);
    text-decoration: underline;
}

.btn-spinner {
    display: none;
}

.btn-loading .btn-text {
    display: none;
}

.btn-loading .btn-spinner {
    display: inline-block;
    width: 17px;
    height: 17px;
    border: 2px solid rgb(255 255 255 / 45%);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.jconfirm .jconfirm-box {
    border-radius: 3px !important;
}

.jconfirm .jconfirm-box .jconfirm-buttons button.btn-primary {
    border: 1px solid var(--reference-button-border) !important;
    color: #ffffff !important;
    background: var(--reference-button) !important;
}

.jconfirm .jconfirm-box .jconfirm-buttons button.btn-light {
    border: 1px solid #cccccc !important;
    color: #333333 !important;
    background: #f7f7f7 !important;
}

/* Shared fallback used by the other account pages that use this stylesheet. */
.brand-header {
    width: min(100%, 420px);
    margin: 50px auto 18px;
    color: var(--reference-navy);
    text-align: center;
}

.brand-logo {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border: 1px solid #9caac4;
    border-radius: 3px;
    color: var(--reference-navy);
    background: #ffffff;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    color: #555555;
    font-size: 13px;
}

@media (max-width: 720px) {
    body {
        background-position: center 82px;
    }

    .reference-header {
        height: 82px;
        gap: 8px;
        border-bottom-width: 4px;
        background-size: auto 82px;
    }

    .reference-logo {
        width: 119px;
        max-width: min(42vw, 119px);
        height: 78px;
    }

    .test-environment-warning {
        max-width: calc(100% - 127px);
        padding: 6px 8px;
        font-size: 24px;
    }

    .login-stage {
        min-height: calc(100vh - 82px);
        padding: 8px 14px 22px;
    }

    .security-notice {
        font-size: 16px;
    }

    .platform-tabs {
        margin-top: 34px;
    }

    .login-footer {
        margin-top: 56px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .test-environment-warning {
        font-size: 20px;
    }

    .reference-logo {
        width: 119px;
        max-width: 42vw;
    }

    .security-notice {
        font-size: 14px;
    }

    .platform-tabs {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }

    .platform-tab + .platform-tab {
        border-top: 1px solid #9caac4;
        border-left: 0;
    }

    .login-card {
        width: min(100%, 340px);
        padding: 23px 18px 27px;
    }

    .panel-title {
        font-size: 20px;
    }

    .otp-inputs {
        gap: 4px;
    }

    .otp-input {
        height: 43px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
