/**
 * Login — Hostinger-style auth (Hushmand ERP)
 * Centered card, soft lavender canvas, purple primary actions
 */

:root {
    --h-purple: #673de6;
    --h-purple-dark: #5025d1;
    --h-purple-deep: #2f1c6a;
    --h-purple-soft: #f4f5ff;
    --h-purple-muted: #d5dfff;
    --h-purple-tint: #ebe4ff;
    --h-text: #1d1e20;
    --h-text-secondary: #727586;
    --h-border: #dadce0;
    --h-white: #ffffff;
    --h-danger: #fc5185;
    --h-danger-bg: #fff0f5;
    --h-radius: 12px;
    --h-radius-btn: 8px;
    --h-font: "DM Sans", system-ui, -apple-system, sans-serif;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html,body{height:100%;}

body.login-page-h {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--h-font);
    background: var(--h-purple-soft);
    color: var(--h-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Soft ambient blobs — Hostinger-like atmosphere */
.lh-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.lh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: blobDrift 14s ease-in-out infinite alternate;
}

.lh-blob--1 {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -80px;
    background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

.lh-blob--2 {
    width: 360px;
    height: 360px;
    bottom: -100px;
    left: -60px;
    background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
    animation-delay: -4s;
    animation-duration: 18s;
}

.lh-blob--3 {
    width: 280px;
    height: 280px;
    top: 40%;
    left: 45%;
    background: radial-gradient(circle, #ddd6fe 0%, transparent 70%);
    opacity: 0.4;
    animation-delay: -8s;
    animation-duration: 16s;
}

@keyframes blobDrift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(24px, -20px) scale(1.08); }
}

/* Top bar — brand wordmark + language */
.lh-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 40px 0;
}

.lh-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.lh-brand__logo {
    height: 36px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.lh-topbar__translate {
    margin-inline-start: auto;
}

.lh-card__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.lh-card__mark {
    height: 52px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

/* Centered stage */
.lh-main {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 32px;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
}

.lh-card {
    width: 100%;
    max-width: 440px;
    padding: 40px 40px 36px;
    background: var(--h-white);
    border-radius: 16px;
    box-shadow:
        0 2px 4px rgba(47, 28, 106, 0.04),
        0 12px 40px rgba(47, 28, 106, 0.08);
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lh-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--h-purple-deep);
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.2;
}

.lh-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--h-text-secondary);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

.lh-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--h-radius);
    background: var(--h-danger-bg);
    border: 1px solid #ffd0e0;
    font-size: 13px;
    font-weight: 500;
    color: #c9184a;
    line-height: 1.4;
}

.lh-alert .fa {
    margin-top: 2px;
    color: var(--h-danger);
}

.lh-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lh-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lh-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--h-text);
}

.lh-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.lh-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    color: var(--h-text);
    background: var(--h-white);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}

.lh-input::placeholder {
    color: #b0b3c0;
}

.lh-input:hover {
    border-color: #b8bccc;
}

.lh-input:focus {
    border-color: var(--h-purple);
    box-shadow: 0 0 0 3px rgba(103, 61, 230, 0.18);
}

.lh-input--pw {
    padding-right: 48px;
}

.lh-eye {
    position: absolute;
    right: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: #8b8fa3;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.15s, background 0.15s;
}

.lh-eye:hover {
    color: var(--h-purple);
    background: var(--h-purple-soft);
}

.lh-eye:focus-visible {
    outline: 2px solid var(--h-purple);
    outline-offset: 2px;
}

.lh-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -4px;
}

.lh-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--h-text-secondary);
    cursor: pointer;
    user-select: none;
}

.lh-cb {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lh-cb-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--h-border);
    background: var(--h-white);
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}

.lh-cb-box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.12s ease;
}

.lh-cb:checked ~ .lh-cb-box {
    background: var(--h-purple);
    border-color: var(--h-purple);
}

.lh-cb:checked ~ .lh-cb-box::after {
    transform: rotate(45deg) scale(1);
}

.lh-cb:focus-visible ~ .lh-cb-box {
    outline: 2px solid var(--h-purple);
    outline-offset: 2px;
}

.lh-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--h-purple);
    text-decoration: none;
    transition: color 0.15s;
}

.lh-link:hover {
    color: var(--h-purple-dark);
    text-decoration: underline;
}

.lh-link--strong {
    font-weight: 700;
}

.lh-btn {
    width: 100%;
    height: 48px;
    margin-top: 6px;
    border: none;
    border-radius: var(--h-radius-btn);
    background: var(--h-purple);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(103, 61, 230, 0.35);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.lh-btn:hover {
    background: var(--h-purple-dark);
    box-shadow: 0 6px 20px rgba(103, 61, 230, 0.42);
    transform: translateY(-1px);
}

.lh-btn:active {
    transform: translateY(0);
    background: #4520b8;
}

.lh-btn:focus-visible {
    outline: 2px solid var(--h-purple);
    outline-offset: 3px;
}

.lh-btn--secondary {
    background: var(--h-white);
    color: var(--h-purple-deep);
    border: 1px solid var(--h-purple-muted);
    box-shadow: none;
}

.lh-btn--secondary:hover {
    background: var(--h-purple-soft);
    border-color: var(--h-purple);
    box-shadow: none;
}

.lh-passkey-block {
    margin-bottom: 8px;
}

.lh-btn--passkey {
    width: 100%;
}

.lh-passkey-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--h-text-secondary);
    font-size: 13px;
}

.lh-passkey-divider::before,
.lh-passkey-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--h-border);
}

.lh-passkey-divider span {
    white-space: nowrap;
}

.lh-alert[hidden] {
    display: none !important;
}

.lh-btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.lh-btn.is-loading .lh-btn__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-inline-end: 8px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -3px;
    animation: lhSpin 0.7s linear infinite;
}

.lh-btn__spinner {
    display: none;
}

.lh-btn--secondary.is-loading .lh-btn__spinner {
    border-color: rgba(47, 28, 106, 0.25);
    border-top-color: var(--h-purple-deep);
}

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

.lh-help {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--h-text-secondary);
}

.lh-help .lh-link {
    margin-left: 4px;
}

.lh-translate {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.lh-footer {
    position: relative;
    z-index: 2;
    padding: 0 20px 28px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--h-text-secondary);
}

/* Mobile */
@media (max-width: 640px) {
    .lh-topbar {
        padding: 16px 16px 0;
        justify-content: flex-end;
    }

    .lh-main {
        padding: 28px 16px 24px;
        min-height: auto;
        align-items: flex-start;
    }

    .lh-card {
        padding: 32px 22px 28px;
        border-radius: 14px;
        box-shadow:
            0 2px 4px rgba(47, 28, 106, 0.03),
            0 8px 28px rgba(47, 28, 106, 0.07);
    }

    .lh-title {
        font-size: 24px;
    }

    .lh-input {
        height: 52px;
        font-size: 16px;
    }

    .lh-btn {
        height: 52px;
        font-size: 16px;
    }

    .lh-btn:hover {
        transform: none;
    }

    .lh-btn:active {
        transform: scale(0.98);
        opacity: 0.95;
    }

    .lh-blob--1,
    .lh-blob--2 {
        opacity: 0.35;
    }

    .lh-blob--3 {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lh-blob,
    .lh-card {
        animation: none;
    }
}

/* RTL */
html[dir="rtl"] body.login-page-h {
    --h-font: "Bahij Helvetica Neue", Tahoma, "Segoe UI", sans-serif;
    font-family: var(--h-font) !important;
    font-synthesis: none;
}

html[dir="rtl"] .lh-title,
html[dir="rtl"] .lh-subtitle,
html[dir="rtl"] .lh-label,
html[dir="rtl"] .lh-input,
html[dir="rtl"] .lh-btn,
html[dir="rtl"] .lh-help,
html[dir="rtl"] .lh-footer {
    font-family: var(--h-font);
    font-synthesis: none;
}

html[dir="rtl"] .lh-input--pw {
    padding-right: 14px;
    padding-left: 48px;
}

html[dir="rtl"] .lh-eye {
    right: auto;
    left: 6px;
}

html[dir="rtl"] .lh-help .lh-link {
    margin-left: 0;
    margin-right: 4px;
}

html[dir="rtl"] .lh-field,
html[dir="rtl"] .lh-row,
html[dir="rtl"] .lh-title,
html[dir="rtl"] .lh-subtitle,
html[dir="rtl"] .lh-help {
    text-align: right;
}

html[dir="rtl"] .lh-title,
html[dir="rtl"] .lh-subtitle,
html[dir="rtl"] .lh-help {
    text-align: center;
}
