/* HSE Login v8 — full page, unified calm blue */
:root {
    --login-blue-900: #1e4a6e;
    --login-blue-700: #356996;
    --login-blue-500: #5b8ec4;
    --login-blue-300: #a8c8e8;
    --login-blue-100: #e3eef8;
    --login-blue-50: #f3f8fc;
    --login-surface: rgba(255, 255, 255, 0.72);
    --login-surface-solid: #ffffff;
    --login-text: #1e3a52;
    --login-muted: #5f7d96;
    --login-faint: #8fa8bd;
    --login-border: rgba(91, 142, 196, 0.18);
    --login-radius: 14px;
    --login-font: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

html:has(.hse-login-page),
html:has(.hse-login-page) body {
    height: 100%;
    margin: 0;
}

.hse-login-page {
    min-height: 100dvh;
    margin: 0;
    font-family: var(--login-font);
    font-size: 14px;
    color: var(--login-text);
    background: var(--login-blue-50);
    -webkit-font-smoothing: antialiased;
}

.hse-login-page * {
    box-sizing: border-box;
}

/* Full-page unified canvas */
.hse-login-layout {
    position: relative;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(168, 200, 232, 0.35), transparent 55%),
        radial-gradient(ellipse 70% 55% at 85% 75%, rgba(195, 218, 240, 0.4), transparent 50%),
        linear-gradient(118deg, #dceaf6 0%, #eaf2f9 38%, #f4f9fd 62%, #eef5fb 100%);
    overflow: hidden;
}

.hse-login-layout::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(91, 142, 196, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 142, 196, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, black 20%, transparent 78%);
    pointer-events: none;
}

/* ── Left: information ── */
.hse-login-hero {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(2rem, 6vw, 5rem);
    background: transparent;
}

.hse-login-hero-inner {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: clamp(0.5rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 3vh, 2rem);
}

.hse-login-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--login-border);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--login-blue-700);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hse-login-hero-badge span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--login-blue-500);
}

.hse-login-hero h1 {
    margin: 0.7rem 0 0.6rem;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--login-blue-900);
}

.hse-login-hero-lead {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--login-muted);
    max-width: 38ch;
}

.hse-login-features {
    display: grid;
    gap: 0.55rem;
}

.hse-login-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border-radius: var(--login-radius);
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.hse-login-feature.is-active {
    background: rgba(255, 255, 255, 0.58);
    border-color: var(--login-border);
    box-shadow: 0 4px 20px rgba(53, 105, 150, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hse-login-feature-icon {
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--login-border);
    color: var(--login-blue-500);
}

.hse-login-feature.is-active .hse-login-feature-icon {
    background: var(--login-blue-100);
    border-color: rgba(91, 142, 196, 0.35);
    color: var(--login-blue-700);
}

.hse-login-feature-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.hse-login-feature strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--login-blue-900);
    margin-bottom: 0.12rem;
}

.hse-login-feature span {
    display: block;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--login-muted);
}

.hse-login-hero-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.65rem;
}

.hse-login-hero-meta p {
    margin: 0;
    font-size: 0.6875rem;
    color: var(--login-faint);
}

.hse-login-dots {
    display: flex;
    gap: 0.35rem;
}

.hse-login-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(91, 142, 196, 0.28);
    cursor: pointer;
    transition: width 0.25s, background 0.25s;
}

.hse-login-dot.is-active {
    width: 18px;
    background: var(--login-blue-500);
}

/* ── Right: login form (same canvas) ── */
.hse-login-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4rem);
    background: transparent;
}

.hse-login-panel {
    width: 100%;
    max-width: 400px;
}

.hse-login-brand {
    text-align: center;
    margin-bottom: 1.35rem;
}

.hse-login-brand img {
    width: auto;
    max-width: min(170px, 75%);
    max-height: 54px;
    object-fit: contain;
    margin: 0 auto 0.8rem;
    display: block;
}

.hse-login-brand-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 0.8rem;
    border-radius: 11px;
    background: var(--login-blue-100);
    border: 1px solid rgba(91, 142, 196, 0.28);
    color: var(--login-blue-700);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hse-login-brand h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--login-blue-900);
}

.hse-login-brand p {
    margin: 0.3rem 0 0;
    font-size: 0.8125rem;
    color: var(--login-muted);
}

/* Form block — frosted, no hard “second page” box */
.hse-login-card {
    padding: 1.35rem 1.4rem 1.4rem;
    border-radius: calc(var(--login-radius) + 2px);
    background: var(--login-surface);
    border: 1px solid var(--login-border);
    box-shadow: 0 8px 32px rgba(53, 105, 150, 0.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.hse-login-card-head {
    padding: 0 0 0.15rem;
}

.hse-login-card-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--login-blue-900);
}

.hse-login-card-head p {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--login-muted);
    line-height: 1.5;
}

.hse-login-card-body {
    padding: 1rem 0 0;
}

.hse-login-card-foot {
    padding: 0.85rem 0 0;
    margin-top: 0.15rem;
    border-top: 1px solid var(--login-border);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--login-muted);
}

.hse-login-card-foot a {
    color: var(--login-blue-700);
    font-weight: 600;
    text-decoration: none;
}

.hse-login-card-foot a:hover {
    color: var(--login-blue-900);
    text-decoration: underline;
}

/* Alerts */
.hse-alert {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.hse-alert svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.hse-alert strong {
    display: block;
    font-size: 0.8125rem;
    margin-bottom: 0.1rem;
}

.hse-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.hse-alert--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.hse-alert--info {
    background: rgba(227, 238, 248, 0.65);
    border: 1px solid var(--login-border);
    color: var(--login-muted);
}

.hse-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.hse-user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: rgba(227, 238, 248, 0.55);
    border: 1px solid var(--login-border);
    margin-bottom: 1rem;
}

.hse-user-chip-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--login-blue-100);
    color: var(--login-blue-700);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hse-user-chip-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.hse-user-chip strong {
    display: block;
    font-size: 0.8125rem;
    color: var(--login-blue-900);
}

.hse-user-chip span {
    display: block;
    font-size: 0.75rem;
    color: var(--login-muted);
    margin-top: 0.05rem;
}

.hse-field {
    margin-bottom: 0.9rem;
}

.hse-field:last-of-type {
    margin-bottom: 1.15rem;
}

.hse-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--login-muted);
}

.hse-input-wrap {
    position: relative;
}

.hse-input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--login-faint);
    pointer-events: none;
}

.hse-input,
.hse-select {
    width: 100%;
    padding: 0.7rem 0.85rem 0.7rem 2.45rem;
    border: 1px solid rgba(91, 142, 196, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    font: inherit;
    font-size: 0.875rem;
    color: var(--login-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hse-input--pwd {
    padding-right: 2.45rem;
}

.hse-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.1rem;
    cursor: pointer;
}

.hse-select-arrow {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.9rem;
    height: 0.9rem;
    color: var(--login-faint);
    pointer-events: none;
}

.hse-input:focus,
.hse-select:focus {
    outline: none;
    border-color: var(--login-blue-500);
    box-shadow: 0 0 0 3px rgba(91, 142, 196, 0.2);
    background: #fff;
}

.hse-input::placeholder {
    color: #b0c4d8;
}

.hse-field-hint {
    margin: 0.3rem 0 0;
    font-size: 0.6875rem;
    color: var(--login-faint);
}

.hse-eye-btn {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 0.2rem;
    color: var(--login-faint);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hse-eye-btn:hover {
    color: var(--login-blue-700);
}

.hse-eye-btn svg {
    width: 1rem;
    height: 1rem;
}

.hse-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.74rem 1rem;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.hse-btn svg {
    width: 1rem;
    height: 1rem;
}

.hse-btn--primary,
.hse-btn--accent {
    background: var(--login-blue-700);
    color: #fff;
    box-shadow: 0 6px 20px rgba(53, 105, 150, 0.22);
}

.hse-btn--primary:hover,
.hse-btn--accent:hover {
    background: var(--login-blue-900);
    box-shadow: 0 8px 24px rgba(30, 74, 110, 0.25);
}

.hse-btn:active {
    transform: scale(0.99);
}

.hse-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal */
.hse-login-page .hse-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(30, 58, 82, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s, visibility 0.22s;
}

.hse-login-page .hse-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.hse-modal-dialog {
    width: 100%;
    max-width: 400px;
    background: var(--login-surface-solid);
    border-radius: calc(var(--login-radius) + 2px);
    border: 1px solid var(--login-border);
    box-shadow: 0 16px 48px rgba(53, 105, 150, 0.15);
    overflow: hidden;
    transform: translateY(8px);
    transition: transform 0.25s ease;
}

.hse-login-page .hse-modal.is-open .hse-modal-dialog {
    transform: translateY(0);
}

.hse-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--login-border);
    background: var(--login-blue-50);
}

.hse-modal-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--login-blue-900);
}

.hse-modal-head p {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--login-muted);
}

.hse-modal-close {
    border: 1px solid var(--login-border);
    background: #fff;
    color: var(--login-muted);
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hse-modal-close:hover {
    background: var(--login-blue-100);
    color: var(--login-blue-900);
}

.hse-modal-close svg {
    width: 0.9rem;
    height: 0.9rem;
}

.hse-modal-body {
    padding: 1.15rem 1.25rem;
}

.hse-modal-foot {
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--login-border);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--login-muted);
}

.hse-modal-foot a {
    color: var(--login-blue-700);
    font-weight: 600;
    text-decoration: none;
}

.hse-modal-foot a:hover {
    text-decoration: underline;
}

.hse-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 999px;
    animation: hseLoginSpin 0.7s linear infinite;
}

.hse-hidden {
    display: none !important;
}

@keyframes hseLoginSpin {
    to { transform: rotate(360deg); }
}

@keyframes hseLoginShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

.hse-shake {
    animation: hseLoginShake 0.4s ease-in-out;
}

.hse-demo-pick {
    margin-bottom: 1.25rem;
}

.hse-demo-pick-label {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.hse-demo-pick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.hse-demo-pick-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.hse-demo-pick-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(53, 105, 150, 0.12);
    transform: translateY(-1px);
}

.hse-demo-pick-form {
    margin: 0;
    min-width: 0;
}

.hse-demo-pick-btn.is-loading {
    opacity: 0.75;
    cursor: wait;
    pointer-events: none;
}

.hse-demo-pick-btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border: 2px solid rgba(53, 105, 150, 0.25);
    border-top-color: #356996;
    border-radius: 999px;
    animation: hseLoginSpin 0.7s linear infinite;
}

.hse-demo-pick-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.hse-demo-pick-role {
    font-size: 0.68rem;
    color: #475569;
    line-height: 1.3;
}

.hse-demo-pick-nik {
    font-size: 0.62rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #356996;
    margin-top: 0.15rem;
}

.hse-demo-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 1.1rem;
    color: #94a3b8;
    font-size: 0.72rem;
}

.hse-demo-divider::before,
.hse-demo-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

@media (max-width: 900px) {
    .hse-login-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .hse-login-hero {
        padding: 2rem 1.5rem 1rem;
        align-items: flex-start;
    }

    .hse-login-hero-inner {
        max-width: none;
        margin: 0;
        gap: 1rem;
    }

    .hse-login-hero h1 {
        font-size: 1.45rem;
    }

    .hse-login-features {
        display: none;
    }

    .hse-login-main {
        padding: 0 1.25rem 2rem;
        align-items: flex-start;
    }

    .hse-login-panel {
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hse-login-feature,
    .hse-modal-dialog,
    .hse-btn,
    .hse-shake {
        animation: none !important;
        transition: none !important;
    }
}
