/**
 * HRMIS auth pages — login, forgot password, verify code, OTP
 * Visual match to design mockup; assets in assets/img/login/
 */

:root {
    --login-text: #ffffff;
    --login-text-muted: rgba(255, 255, 255, 0.82);
    --login-title-accent: #BAEBDD;
    --login-title-underline: #5FAD97;
    --login-input-bg: #FFFFFF59;
    --login-forgot: #64CC9F;
    --login-btn-bg: linear-gradient(180deg, #55C595 0%, #1F7F58 100%);
    --login-form-width: 370px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.login-page-body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

.login-page {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ── Left panel ── */
.login-panel--brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 2.5rem 3rem;
    color: var(--login-text);
    position: relative;
    z-index: 1;
    min-width: 0;
    height: 100vh;
    background-image: url('../img/login/left2.png');
    background-size: cover;
    background-position: center left;
    background-repeat: no-repeat;
    font-family: 'Roboto', sans-serif;
}

.login-panel--brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(5, 30, 20, 0.55);
    z-index: 0;
    pointer-events: none;
}

.login-panel--brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

.login-panel--brand__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.login-panel--brand__header {
    flex-shrink: 0;
    margin-bottom: 2.5rem;
    padding: 0;
    background: transparent;
}

.login-panel--brand__header-link {
    display: block;
    line-height: 0;
}

.login-panel--brand__header-logo {
    height: 52px;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: left top;
    filter: none;
}

.login-panel--brand__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    min-height: 0;
}

.login-panel--brand__eyebrow {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 400;
    color: var(--login-text);
    line-height: 1.35;
}

.login-panel--brand__title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--login-title-accent);
    line-height: 1.35;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--login-title-underline);
}

.login-panel--brand__tagline {
    margin: 14px 0 0;
    max-width: 340px;
    font-size: 13px;
    font-weight: 400;
    color: var(--login-text);
    line-height: 1.6;
}

.login-panel--brand__footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 0;
}

.login-panel--brand__footer-logo {
    height: 48px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    filter: none;
    opacity: 1;
}

.login-panel--brand__powered-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-panel--brand__powered-by,
.login-panel--brand__powered-name {
    margin: 0;
    font-size: 16px;
    color: var(--login-text);
}

.login-panel--brand__powered-by {
    font-weight: 400;
}

.login-panel--brand__powered-name {
    font-weight: 700;
}

/* ── Right panel ── */
.login-panel--form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
    min-width: 0;
    height: 100vh;
    background-image: url('../img/login/right.svg');
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
}

.login-panel--form::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(5, 30, 20, 0.2);
    z-index: 0;
    pointer-events: none;
}

.login-panel--form::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

.login-panel--form__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--login-form-width);
    margin: 0 auto;
}

/* ── Form card ── */
.login-form__header {
    margin-bottom: 2rem;
    text-align: center;
}

.login-form__title {
    margin: 0 0 6px;
    font-size: 38px;
    font-weight: 700;
    color: var(--login-text);
    line-height: 1.15;
}

.login-form__subtitle {
    margin: 0 auto;
    max-width: 100%;
    font-size: 13px;
    font-weight: 400;
    color: var(--login-text);
    line-height: 1.4;
}

.login-form__subtitle strong {
    color: var(--login-text);
    font-weight: 600;
}

.login-form .alert,
.login-panel--form .alert {
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-panel--form .alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(248, 180, 180, 0.5);
    color: #fff;
}

.login-panel--form .alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(160, 230, 180, 0.45);
    color: #fff;
}

.login-form__required {
    color: #ffc9c9;
}

.login-form__field {
    margin-bottom: 1.1rem;
}

.login-form__label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--login-text);
}

.login-form__control-wrap {
    display: flex;
    align-items: center;
    background: var(--login-input-bg);
    border: none;
    border-radius: 6px;
    padding: 0 12px;
}

.login-form__control-wrap:focus-within {
    background: var(--login-input-bg);
    outline: none;
}

.login-form__control {
    flex: 1;
    width: 100%;
    height: auto;
    padding: 11px 8px 11px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--login-text);
    background: transparent !important;
    border: none;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    caret-color: var(--login-text);
}

.login-form__control::placeholder {
    color: var(--login-text);
    opacity: 1;
}

.login-form__control:focus {
    background: transparent !important;
    color: var(--login-text);
    border: none;
    box-shadow: none;
}

.login-form__control-wrap .login-form__control:-webkit-autofill,
.login-form__control-wrap .login-form__control:-webkit-autofill:hover,
.login-form__control-wrap .login-form__control:-webkit-autofill:focus,
.login-form__control-wrap .login-form__control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: var(--login-text) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.login-form__control.is-invalid {
    color: #fff;
}

.login-form__control-wrap:has(.is-invalid) {
    box-shadow: 0 0 0 1px #f5a5a5;
}

.login-form__input-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.75;
    pointer-events: none;
}

.login-form__toggle-password {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    flex-shrink: 0;
}

.login-form__toggle-password .login-form__input-icon {
    pointer-events: none;
}

.login-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0.4rem 0 1.5rem;
    flex-wrap: wrap;
}

.login-form__remember {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    color: var(--login-text);
    user-select: none;
}

.login-form__remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    margin: 0;
    border: 2px solid #ffffff;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.login-form__remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 2px;
    top: -1px;
    width: 7px;
    height: 11px;
    border: 2px solid #ffffff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.login-form__forgot {
    font-size: 13px;
    font-weight: 400;
    color: var(--login-forgot);
    text-decoration: none;
    white-space: nowrap;
}

.login-form__forgot:hover {
    color: var(--login-forgot);
    text-decoration: underline;
}

.login-form__back {
    margin: 1.25rem 0 0;
    text-align: center;
}

.login-form__submit,
.login-form__btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--login-text);
    cursor: pointer;
    letter-spacing: 0.5px;
}

.login-form__submit {
    background: var(--login-btn-bg);
    transition: filter 0.2s ease, transform 0.15s ease;
}

.login-form__submit:hover {
    filter: brightness(1.05);
}

.login-form__submit:active {
    transform: translateY(1px);
}

.login-form__submit:disabled,
.login-form__btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.login-form__btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.65);
    margin-top: 0.75rem;
}

.login-form__btn-secondary:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.08);
}

.login-form__error,
.invalid-feedback {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #ffc9c9;
    font-weight: 500;
}

/* OTP inputs */
.login-form__field--otp {
    margin-bottom: 8px;
}

.login-form__otp-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.login-form__otp-input {
    width: 44px;
    height: 50px;
    padding: 0;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 50px;
    color: var(--login-text);
    background: var(--login-input-bg);
    border: none;
    border-radius: 6px;
    outline: none;
}

.login-form__otp-input:focus {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.login-form__otp-input:disabled {
    opacity: 0.5;
}

.login-form__resend,
.login-form__hint {
    margin: 0 0 1.25rem;
    text-align: center;
    font-size: 13px;
    font-weight: 400;
    color: var(--login-text-muted);
}

.login-form__resend a,
.login-form__hint a {
    color: var(--login-forgot);
    text-decoration: none;
}

.login-form__resend a:hover,
.login-form__hint a:hover {
    text-decoration: underline;
}

.login-form__timer {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--login-text-muted);
    text-align: center;
}

.login-form__timer strong,
.login-form__timer #timer {
    color: var(--login-forgot);
    font-weight: 700;
}

.login-form__actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-form__alert-warning {
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.45);
    color: #fff;
}

/* Legacy globe nodes (removed from layout) */
.login-panel--brand__globe,
.login-panel--form__globe {
    display: none !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    html,
    body.login-page-body {
        overflow: auto;
    }

    .login-page {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .login-panel--brand,
    .login-panel--form {
        height: auto;
        min-height: 0;
        flex: 0 0 auto;
    }

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

    .login-panel--brand__title {
        font-size: 20px;
    }

    .login-panel--form {
        padding: 2rem 1.5rem;
        min-height: 420px;
    }

    .login-form__title {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    :root {
        --login-form-width: 100%;
    }
}
