body.task-login {
    background:
        radial-gradient(
            circle at top left,
            rgba(22, 133, 91, .11),
            transparent 36%
        ),
        linear-gradient(
            145deg,
            #f7fafc 0%,
            #eef4f8 100%
        );
}

body.task-login #layout-content {
    background: transparent;
}

body.task-login .logo {
    margin-bottom: 1rem;
}

body.task-login .logo img {
    width: min(300px, 82vw);
    max-height: 88px;
    object-fit: contain;
}

body.task-login .box-inner {
    border-radius: 18px;
    border: 1px solid rgba(15, 39, 71, .08);

    box-shadow:
        0 18px 50px rgba(15, 39, 71, .12),
        0 2px 8px rgba(15, 39, 71, .08);
}

.hkt-security-panel {
    margin: 1rem 0 .75rem;
    padding: .9rem;

    border-radius: 12px;
    border: 1px solid #dcebe5;

    background: #f7faf9;
}

.hkt-security-title {
    margin-bottom: .2rem;

    color: #0f2747;

    font-size: .95rem;
    font-weight: 700;
}

.hkt-security-copy {
    margin-bottom: .75rem;

    color: #536579;

    font-size: .82rem;
}

.hkt-hcaptcha {
    display: flex;
    justify-content: center;

    min-height: 78px;
}

.hkt-hcaptcha-legal {
    margin-top: .45rem;

    text-align: center;

    color: #708093;

    font-size: .72rem;
}

.hkt-hcaptcha-legal a {
    color: #176d51;
    text-decoration: underline;
}

body.task-login button.mainaction {
    background: #0f2747;
    border-color: #0f2747;
}

body.task-login button.mainaction:hover,
body.task-login button.mainaction:focus {
    background: #16855b;
    border-color: #16855b;
}

/* HKT-TWOFACTOR-POLISH-START */

/*
 * HKT styling for the third-party TOTP settings page.
 * No plugin authentication logic is changed here.
 */

body:has([id="2FA_secret"]) #layout-content {
    padding: 1.25rem 1.5rem 2rem;
}

body:has([id="2FA_secret"]) #layout-content > h2,
body:has([id="2FA_secret"]) #layout-content > h1 {
    color: #0f2747;
    font-weight: 700;
    letter-spacing: -.02em;
}

body:has([id="2FA_secret"])
table:has([id="2FA_secret"]) {
    width: 100%;
    max-width: 980px;

    margin-top: .8rem;

    border: 1px solid #dfe7ec;
    border-radius: 14px;

    border-collapse: separate;
    border-spacing: 0;

    overflow: hidden;

    background: #ffffff;

    box-shadow:
        0 8px 28px rgba(15, 39, 71, .06);
}

body:has([id="2FA_secret"])
table:has([id="2FA_secret"]) td {
    padding: .9rem 1rem;

    border-bottom:
        1px solid #edf1f4;

    vertical-align: middle;
}

body:has([id="2FA_secret"])
table:has([id="2FA_secret"]) tr:last-child td {
    border-bottom: 0;
}

body:has([id="2FA_secret"])
table:has([id="2FA_secret"]) td.title {
    width: 180px;

    color: #405268;

    font-weight: 700;
}

body:has([id="2FA_secret"])
[id="2FA_activate"] {
    width: 19px;
    height: 19px;

    accent-color: #16855b;

    cursor: pointer;
}

body:has([id="2FA_secret"])
[id="2FA_secret"] {
    width: min(520px, 95%);
    min-height: 42px;

    padding: .55rem .75rem;

    border: 1px solid #cbd7df;
    border-radius: 8px;

    background: #ffffff;
    color: #1f3142;
}

body:has([id="2FA_secret"])
input[name="2FA_recovery_codes[]"] {
    width: 145px;
    min-height: 40px;

    margin: .2rem .35rem .2rem 0;
    padding: .5rem .65rem;

    border: 1px solid #cbd7df;
    border-radius: 8px;

    background: #ffffff;
    color: #1f3142;
}

body:has([id="2FA_secret"])
[id="2FA_code_to_check"] {
    width: 150px;
    min-height: 42px;

    padding: .5rem .7rem;

    border: 1px solid #cbd7df;
    border-radius: 8px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;

    font-size: 1.05rem;
    letter-spacing: .14em;
    text-align: center;
}

body:has([id="2FA_secret"])
input.button.mainaction {
    min-height: 40px;

    padding: .5rem .85rem;

    border: 1px solid #0f2747;
    border-radius: 8px;

    background: #0f2747;
    color: #ffffff;

    font-weight: 600;

    transition:
        background .15s ease,
        border-color .15s ease;
}

body:has([id="2FA_secret"])
input.button.mainaction:hover,
body:has([id="2FA_secret"])
input.button.mainaction:focus {
    border-color: #16855b;
    background: #16855b;
}

body:has([id="2FA_secret"])
input.button.mainaction:disabled {
    border-color: #aebbc4;
    background: #aebbc4;

    cursor: not-allowed;
    opacity: .68;
}

body:has([id="2FA_secret"])
a {
    color: #16855b;
}

body:has([id="2FA_secret"])
a:hover {
    color: #0f6f4e;
}

html.dark-mode
body:has([id="2FA_secret"])
#layout-content > h2,

html.dark-mode
body:has([id="2FA_secret"])
#layout-content > h1 {
    color: #e7eef2;
}

html.dark-mode
body:has([id="2FA_secret"])
table:has([id="2FA_secret"]) {
    border-color: #3a474d;

    background: #273135;

    box-shadow: none;
}

html.dark-mode
body:has([id="2FA_secret"])
table:has([id="2FA_secret"]) td {
    border-bottom-color: #39464b;
}

html.dark-mode
body:has([id="2FA_secret"])
table:has([id="2FA_secret"]) td.title {
    color: #d2dce1;
}

html.dark-mode
body:has([id="2FA_secret"])
[id="2FA_secret"],

html.dark-mode
body:has([id="2FA_secret"])
input[name="2FA_recovery_codes[]"],

html.dark-mode
body:has([id="2FA_secret"])
[id="2FA_code_to_check"] {
    border-color: #4a5960;

    background: #1f282c;
    color: #edf3f5;
}

/* HKT-TWOFACTOR-POLISH-END */

/* HKT-2FA-MODAL-START */

.hkt-2fa-modal-overlay {
    position: fixed;
    z-index: 10000;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(8, 22, 39, .70);

    backdrop-filter: blur(3px);
}

.hkt-2fa-modal {
    width: 100%;
    max-width: 440px;

    padding: 30px;

    border: 1px solid rgba(15, 39, 71, .10);
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 28px 80px rgba(4, 16, 29, .30);

    text-align: center;
}

.hkt-2fa-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;

    margin: 0 auto 18px;

    border-radius: 50%;

    background: #e5f5ee;
    color: #16855b;

    font-size: 27px;
    font-weight: 700;
}

.hkt-2fa-modal h2 {
    margin: 0 0 10px;

    color: #0f2747;

    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
}

.hkt-2fa-modal p {
    margin: 0 auto 24px;

    max-width: 350px;

    color: #536579;

    font-size: 14px;
    line-height: 1.6;
}

.hkt-2fa-modal-button {
    min-width: 150px;
    min-height: 44px;

    padding: 10px 22px;

    border: 0;
    border-radius: 9px;

    background: #0f2747;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .15s ease,
        transform .15s ease;
}

.hkt-2fa-modal-button:hover,
.hkt-2fa-modal-button:focus {
    background: #16855b;

    outline: none;

    transform: translateY(-1px);
}

html.dark-mode .hkt-2fa-modal {
    border-color: #405058;

    background: #273135;
}

html.dark-mode .hkt-2fa-modal h2 {
    color: #edf3f5;
}

html.dark-mode .hkt-2fa-modal p {
    color: #c1ccd1;
}

html.dark-mode .hkt-2fa-modal-icon {
    background: rgba(22, 133, 91, .20);
    color: #63c69c;
}

/* HKT-2FA-MODAL-END */

/* HKT-GUIDED-2FA-START */

.hkt-2fa-intro-card {
    max-width: 760px;

    margin: 18px 12px 0;
    padding: 34px;

    border: 1px solid #3d4d55;
    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            rgba(22, 133, 91, .10),
            rgba(15, 39, 71, .08)
        );

    box-shadow:
        0 16px 44px rgba(0, 0, 0, .12);
}

.hkt-2fa-intro-badge {
    margin-bottom: 12px;

    color: #55c796;

    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .16em;
}

.hkt-2fa-intro-card h2 {
    margin: 0 0 12px;

    color: #f1f5f7;

    font-size: 25px;
    line-height: 1.25;
    font-weight: 700;
}

.hkt-2fa-intro-lead {
    max-width: 620px;

    margin: 0;

    color: #c4cfd5;

    font-size: 14px;
    line-height: 1.65;
}

.hkt-2fa-time {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 18px;

    color: #aebbc3;

    font-size: 13px;
}

.hkt-2fa-time-icon {
    color: #55c796;

    font-size: 17px;
}

.hkt-2fa-requirements {
    display: grid;
    gap: 10px;

    margin: 22px 0 26px;
}

.hkt-2fa-requirement {
    display: flex;
    align-items: center;
    gap: 11px;

    color: #d2dbe0;

    font-size: 13px;
}

.hkt-2fa-requirement-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 26px;

    width: 26px;
    height: 26px;

    border-radius: 50%;

    background: rgba(22, 133, 91, .22);
    color: #76d6ad;

    font-size: 12px;
    font-weight: 800;
}

.hkt-2fa-primary-action {
    min-height: 44px;

    padding: 10px 20px;

    border: 1px solid #16855b;
    border-radius: 9px;

    background: #16855b;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease,
        opacity .15s ease;
}

.hkt-2fa-primary-action:hover,
.hkt-2fa-primary-action:focus {
    border-color: #1a9b69;
    background: #1a9b69;

    outline: none;

    transform: translateY(-1px);
}

.hkt-2fa-primary-action:disabled {
    border-color: #526169;
    background: #526169;

    cursor: not-allowed;

    opacity: .55;

    transform: none;
}

.hkt-2fa-step-row > td {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

.hkt-step-number {
    margin-bottom: 4px;

    color: #55c796;

    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hkt-step-title {
    color: #eef4f6;

    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
}

.hkt-step-copy {
    max-width: 340px;

    margin-top: 4px;

    color: #aebbc3;

    font-size: 12px;
    line-height: 1.5;
}

.hkt-2fa-verify-step {
    max-width: 520px;

    margin-top: 22px;
    margin-bottom: 10px;

    padding-top: 20px;

    border-top: 1px solid #3d4a50;
}

#2FA_code_to_check {
    width: 145px !important;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace !important;

    font-size: 16px !important;
    letter-spacing: .14em;

    text-align: center;
}

.hkt-2fa-finish-area {
    max-width: 520px;

    margin-top: 24px;
    padding: 20px;

    border: 1px solid #3c4b52;
    border-radius: 12px;

    background: rgba(15, 39, 71, .10);
}

.hkt-2fa-finish-area.is-ready {
    border-color: rgba(22, 133, 91, .65);

    background: rgba(22, 133, 91, .08);
}

.hkt-2fa-finish-area .hkt-2fa-primary-action {
    margin-top: 14px;
}

.hkt-2fa-status-card {
    display: flex;
    align-items: center;
    gap: 14px;

    max-width: 760px;

    margin: 18px 12px 22px;
    padding: 20px 22px;

    border: 1px solid rgba(22, 133, 91, .55);
    border-radius: 13px;

    background: rgba(22, 133, 91, .08);
}

.hkt-2fa-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 40px;

    width: 40px;
    height: 40px;

    border-radius: 50%;

    background: rgba(22, 133, 91, .22);
    color: #67d3a6;

    font-size: 20px;
    font-weight: 800;
}

.hkt-2fa-status-title {
    color: #eef5f2;

    font-size: 14px;
    font-weight: 700;
}

.hkt-2fa-status-copy {
    margin-top: 3px;

    color: #aebcc2;

    font-size: 12px;
    line-height: 1.5;
}

/* Light mode */

html:not(.dark-mode) .hkt-2fa-intro-card {
    border-color: #d7e3df;

    background:
        linear-gradient(
            145deg,
            #f3faf7,
            #f7fafc
        );

    box-shadow:
        0 16px 42px rgba(15, 39, 71, .08);
}

html:not(.dark-mode) .hkt-2fa-intro-card h2,
html:not(.dark-mode) .hkt-step-title,
html:not(.dark-mode) .hkt-2fa-status-title {
    color: #0f2747;
}

html:not(.dark-mode) .hkt-2fa-intro-lead,
html:not(.dark-mode) .hkt-2fa-requirement,
html:not(.dark-mode) .hkt-step-copy,
html:not(.dark-mode) .hkt-2fa-status-copy {
    color: #526579;
}

html:not(.dark-mode) .hkt-2fa-time {
    color: #617487;
}

html:not(.dark-mode) .hkt-2fa-verify-step {
    border-top-color: #e1e8ec;
}

html:not(.dark-mode) .hkt-2fa-finish-area {
    border-color: #dce5e9;

    background: #f8fafb;
}

/* HKT-GUIDED-2FA-END */

/* HKT-2FA-VERIFY-STATE-START */

.hkt-2fa-verify-status {
    display: none;
    max-width: 460px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.hkt-2fa-verify-status.is-working,
.hkt-2fa-verify-status.is-success,
.hkt-2fa-verify-status.is-error {
    display: block;
}

.hkt-2fa-verify-status.is-working {
    border-color: rgba(130, 145, 155, .45);
    background: rgba(130, 145, 155, .10);
}

.hkt-2fa-verify-status.is-success {
    border-color: rgba(38, 167, 113, .55);
    background: rgba(38, 167, 113, .10);
    color: #76d9ad;
}

.hkt-2fa-verify-status.is-error {
    border-color: rgba(219, 82, 82, .55);
    background: rgba(219, 82, 82, .10);
    color: #f0a2a2;
}

#2FA_check_code.is-verified {
    cursor: default;
    opacity: 1;
}

#2FA_code_to_check.is-verified {
    border-color: rgba(38, 167, 113, .70);
}

#hkt-2fa-verify-step.is-verified
.hkt-step-number {
    color: #76d9ad;
}

/* HKT-2FA-VERIFY-STATE-END */

/* HKT-RECOVERY-HARDENING-START */

.hkt-recovery-codes-protected {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    line-height: 1.45;
}

.hkt-recovery-codes-protected span {
    opacity: .78;
}

.hkt-recovery-code-new {
    width: 170px;
    margin: 4px 8px 4px 0;
    font-family: monospace;
    letter-spacing: .08em;
}

.hkt-recovery-codes-save-note {
    display: none;
    max-width: 520px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
}

.hkt-recovery-codes-save-note.is-ready {
    display: block;
    border: 1px solid rgba(38, 167, 113, .55);
    background: rgba(38, 167, 113, .10);
}

/* HKT-RECOVERY-HARDENING-END */
