/* Login page: intentionally isolated from dashboard form and card rules. */
:root {
    --ht-login-primary: #2563eb;
    --ht-login-primary-hover: #1d4ed8;
    --ht-login-text: #172033;
    --ht-login-muted: #667085;
    --ht-login-border: #aeb8c7;
    --ht-login-surface: #ffffff;
    --ht-login-page: #f3f6fa;
    --ht-login-input: #ffffff;
    --ht-login-error: #dc2626;
    --ht-login-focus: 0 0 0 4px rgba(37, 99, 235, 0.17);
}

body.dark-only.ht-login-page-body {
    --ht-login-primary: #60a5fa;
    --ht-login-primary-hover: #93c5fd;
    --ht-login-text: #f8fafc;
    --ht-login-muted: #a9b4c5;
    --ht-login-border: #526077;
    --ht-login-surface: #111827;
    --ht-login-page: #08101f;
    --ht-login-input: #172033;
    --ht-login-focus: 0 0 0 4px rgba(96, 165, 250, 0.22);
}

html,
body.ht-login-page-body,
.ht-login-page-wrapper {
    min-height: 100%;
}

body.ht-login-page-body {
    margin: 0;
    color: var(--ht-login-text);
    background:
        radial-gradient(circle at 12% 8%, rgba(14, 165, 198, 0.12), transparent 30rem),
        radial-gradient(circle at 90% 92%, rgba(37, 99, 235, 0.1), transparent 34rem),
        var(--ht-login-page);
}

.ht-login-page-body .loader-wrapper,
.ht-login-page-body .tap-top {
    display: none !important;
}

.ht-login-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 3vw, 2.5rem);
}

.ht-login-card {
    width: min(100%, 68rem);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.25rem;
    background: var(--ht-login-surface);
    box-shadow: 0 1.5rem 4.5rem rgba(15, 23, 42, 0.13), 0 0.25rem 1rem rgba(15, 23, 42, 0.06);
}

.ht-login-toolbar {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.ht-login-utility-button,
.ht-login-language {
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    color: var(--ht-login-muted);
    background: transparent;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ht-login-utility-button {
    padding: 0;
    cursor: pointer;
}

.ht-login-utility-button svg,
.ht-login-language svg {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
}

.ht-login-language {
    gap: 0.55rem;
    padding: 0.625rem 0.875rem;
    border-color: var(--ht-login-border);
    color: var(--ht-login-primary);
    font-size: max(0.8125rem, 12px);
    font-weight: 650;
}

@media (hover: hover) and (pointer: fine) {
    .ht-login-utility-button:hover,
    .ht-login-language:hover {
        color: var(--ht-login-primary);
        border-color: rgba(37, 99, 235, 0.38);
        background: rgba(37, 99, 235, 0.07);
    }
}

.ht-login-utility-button:focus-visible,
.ht-login-language:focus-visible,
.ht-login-password-toggle:focus-visible,
.ht-login-submit:focus-visible {
    outline: 2px solid var(--ht-login-primary);
    outline-offset: 2px;
    box-shadow: var(--ht-login-focus);
}

.ht-login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(26rem, 0.97fr);
    min-height: 34rem;
}

.ht-login-visual {
    position: relative;
    min-width: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 3rem;
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.06), rgba(14, 165, 198, 0.13)),
        #f7fbff;
}

body.dark-only .ht-login-visual {
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 198, 0.12)),
        #0d1728;
}

.ht-login-visual::before,
.ht-login-visual::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(37, 99, 235, 0.13);
    border-radius: 50%;
}

.ht-login-visual::before {
    width: 25rem;
    height: 25rem;
}

.ht-login-visual::after {
    width: 34rem;
    height: 34rem;
}

.ht-login-visual-glow {
    position: absolute;
    width: 17rem;
    height: 17rem;
    border-radius: 50%;
    background: rgba(14, 165, 198, 0.16);
    filter: blur(3rem);
}

.ht-login-visual img {
    position: relative;
    z-index: 1;
    width: min(100%, 27rem);
    max-height: 26rem;
    object-fit: contain;
}

.ht-login-visual img.ht-login-visual-logo {
    width: min(72%, 19rem);
}

.ht-login-panel {
    width: 100%;
    align-self: center;
    padding: clamp(2rem, 5vw, 4rem);
}

.ht-login-brand {
    width: fit-content;
    display: block;
    margin: 0 0 2rem;
}

.ht-login-brand img,
.ht-login-page-body img.loginPageLogo {
    display: block;
    width: auto;
    max-width: min(100%, 14rem);
    height: auto !important;
    max-height: 5.5rem !important;
    margin: 0 !important;
    object-fit: contain;
}

.ht-login-heading {
    margin-bottom: 1.75rem;
}

.ht-login-heading h1 {
    margin: 0;
    color: var(--ht-login-text);
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 750;
    line-height: 1.2;
}

.ht-login-form {
    display: grid;
    gap: 1rem;
}

.ht-login-field {
    min-width: 0;
}

.ht-login-control {
    position: relative;
    height: 3.75rem;
    overflow: hidden;
    border: 1.5px solid var(--ht-login-border);
    border-radius: 0.75rem;
    color: var(--ht-login-text);
    background: var(--ht-login-input);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ht-login-control:focus-within {
    border-color: var(--ht-login-primary);
    box-shadow: var(--ht-login-focus);
}

.ht-login-field.has-error .ht-login-control {
    border-color: var(--ht-login-error);
}

.ht-login-field.has-error .ht-login-control:focus-within {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.ht-login-field-icon {
    position: absolute;
    z-index: 2;
    inset-inline-start: 0;
    top: 0;
    width: 3.25rem;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--ht-login-muted);
    pointer-events: none;
}

.ht-login-field-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ht-login-control input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 1.55rem 3.25rem 0.45rem;
    border: 0;
    border-radius: inherit;
    outline: 0;
    color: var(--ht-login-text);
    background: transparent;
    font-size: 0.9375rem;
    font-weight: 550;
    line-height: 1.25;
}

.ht-login-control label {
    position: absolute;
    z-index: 1;
    inset-inline-start: 3.25rem;
    top: 0.55rem;
    margin: 0;
    color: var(--ht-login-muted) !important;
    font-size: max(0.75rem, 12px);
    font-weight: 650;
    line-height: 1;
    pointer-events: none;
}

.ht-login-control label span {
    color: var(--ht-login-error);
}

.ht-login-password-control input {
    padding-inline-end: 3.75rem;
}

.ht-login-password-toggle {
    position: absolute;
    z-index: 3;
    inset-inline-end: 0.25rem;
    top: 50%;
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0.625rem;
    color: var(--ht-login-muted);
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.ht-login-password-toggle svg {
    width: 1.3rem;
    height: 1.3rem;
}

.ht-login-password-toggle .ht-login-eye-hide,
.ht-login-password-toggle.is-visible .ht-login-eye-show {
    display: none;
}

.ht-login-password-toggle.is-visible .ht-login-eye-hide {
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    .ht-login-password-toggle:hover {
        color: var(--ht-login-primary);
        background: rgba(37, 99, 235, 0.08);
    }
}

.ht-login-error {
    margin: 0.5rem 0 0;
    color: var(--ht-login-error);
    font-size: max(0.8125rem, 12px);
    font-weight: 550;
    line-height: 1.35;
}

.ht-login-submit {
    width: 100%;
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--ht-login-primary);
    border-radius: 0.75rem;
    color: #ffffff;
    background: var(--ht-login-primary);
    box-shadow: 0 0.5rem 1.25rem rgba(37, 99, 235, 0.24);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ht-login-submit svg {
    width: 1.2rem;
    height: 1.2rem;
}

@media (hover: hover) and (pointer: fine) {
    .ht-login-submit:hover {
        border-color: var(--ht-login-primary-hover);
        background: var(--ht-login-primary-hover);
        box-shadow: 0 0.65rem 1.5rem rgba(37, 99, 235, 0.29);
    }
}

.ht-login-submit:active {
    box-shadow: 0 0.2rem 0.75rem rgba(37, 99, 235, 0.2);
}

.ht-login-footer {
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--ht-login-muted);
    background: rgba(148, 163, 184, 0.07);
}

.ht-login-footer p {
    margin: 0;
    font-size: max(0.75rem, 12px);
    line-height: 1.45;
}

[dir="rtl"] .ht-login-submit svg {
    transform: scaleX(-1);
}

@media (max-width: 767.98px) {
    .ht-login-shell {
        align-items: start;
        padding: 0.75rem;
    }

    .ht-login-card {
        border-radius: 1rem;
        box-shadow: 0 0.75rem 2.5rem rgba(15, 23, 42, 0.11), 0 2px 0.625rem rgba(15, 23, 42, 0.05);
    }

    .ht-login-toolbar {
        min-height: 4rem;
        padding: 0.625rem 0.875rem;
    }

    .ht-login-layout {
        display: block;
        min-height: 0;
    }

    .ht-login-visual {
        display: none;
    }

    .ht-login-panel {
        padding: 1.75rem 1.5rem 2rem;
    }

    .ht-login-brand {
        margin-bottom: 1.75rem;
    }

    .ht-login-brand img {
        max-width: min(100%, 12.5rem);
        max-height: 4.75rem !important;
    }

    .ht-login-heading {
        margin-bottom: 1.5rem;
    }

    .ht-login-heading h1 {
        font-size: 1.375rem;
    }

    .ht-login-footer {
        min-height: 0;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        padding: 0.875rem 1rem;
        text-align: center;
    }
}

@media (max-width: 359.98px) {
    .ht-login-shell {
        padding: 0.5rem;
    }

    .ht-login-toolbar {
        padding-inline: 0.625rem;
    }

    .ht-login-language {
        padding-inline: 0.7rem;
        font-size: max(0.75rem, 12px);
    }

    .ht-login-panel {
        padding: 1.5rem 1rem 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ht-login-page-body *,
    .ht-login-page-body *::before,
    .ht-login-page-body *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
