/* REGAL HRMS: Precision Drafting login */

html,
body {
    min-height: 100%;
}

body {
    overflow-x: hidden;
    overflow-y: auto !important;
    background-color: #eeefec;
    background-image:
        linear-gradient(rgba(11,11,12,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11,11,12,.04) 1px, transparent 1px);
    background-size: 24px 24px;
}

body::after {
    content: "";
    position: fixed;
    inset: 16px;
    z-index: 0;
    pointer-events: none;
    border: 1px solid rgba(11,11,12,.12);
}

.bg-shape,
.small-box {
    position: fixed;
    z-index: 0;
    pointer-events: none;
}

.bg-shape {
    border: 1px solid rgba(11,11,12,.12);
    border-radius: 50%;
}

.shape1 { width: 430px; height: 430px; top: -290px; left: -160px; }
.shape2 { width: 275px; height: 275px; top: -170px; left: -82px; }
.shape3 { width: 390px; height: 390px; right: -220px; bottom: -250px; }
.shape4 { width: 245px; height: 245px; right: -116px; bottom: -142px; }

.small-box {
    width: 13px;
    height: 13px;
    border: 1px solid rgba(11,11,12,.32);
}

.box1 { top: 12%; right: 7%; }
.box2 { bottom: 10%; left: 6%; }

.small-box::before,
.small-box::after {
    content: "";
    position: absolute;
    background: rgba(11,11,12,.32);
}

.small-box::before { top: 5px; left: -6px; width: 23px; height: 1px; }
.small-box::after { top: -6px; left: 5px; width: 1px; height: 23px; }

.login-wrapper {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    padding: clamp(30px, 4vw, 66px) clamp(18px, 5vw, 76px);
    place-items: center;
}

.login-wrapper > div {
    width: min(1120px, 100%);
}

.login-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #fff;
    border: 1px solid #aeb0ad;
    border-radius: 0;
    box-shadow: 0 38px 90px -48px rgba(0,0,0,.68);
}

.login-card::before,
.login-card::after {
    content: "";
    position: absolute;
    z-index: 4;
    pointer-events: none;
}

.login-card::before {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    border: 1px solid rgba(11,11,12,.075);
}

.login-card::after {
    top: 0;
    left: 0;
    width: 72px;
    height: 3px;
    background: #0b0b0c;
}

.login-card .row.g-0 {
    min-height: min(680px, calc(100vh - 150px));
}

.left-panel {
    position: relative;
    z-index: 5;
    display: flex;
    height: 100%;
    padding: clamp(44px, 6vw, 84px) clamp(34px, 5vw, 70px);
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: clamp(44px, 7vh, 72px);
}

.login-brand-logo {
    display: block;
    width: 92px;
    height: 60px;
    overflow: hidden;
}

.login-brand-meta {
    padding: 7px 0 7px 16px;
    color: #7b7d81;
    border-left: 1px solid #c8c9c6;
    font-family: Consolas, monospace;
    font-size: .57rem;
    letter-spacing: .1em;
}

.login-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #6f7277;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.login-kicker::before {
    content: "01";
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    color: #fff;
    background: #0b0b0c;
    font-family: Consolas, monospace;
    font-size: .55rem;
}

.login-title {
    margin: 0 0 8px;
    color: #0b0b0c;
    font-family: Bahnschrift, "Arial Narrow", sans-serif !important;
    font-size: clamp(2.05rem, 3.3vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1;
}

.login-subtitle {
    max-width: 380px;
    margin: 0 0 36px;
    color: #777a7f;
    font-size: .83rem;
    line-height: 1.6;
}

.left-panel .form-label {
    margin-bottom: 7px;
    color: #4d5055;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.left-panel .form-control {
    min-height: 47px;
    padding: 11px 13px;
    color: #0b0b0c;
    background: #fbfbfa;
    border: 1px solid #bfc0bd;
    border-radius: 2px;
    font-size: .89rem;
}

.left-panel .form-control:focus {
    background: #fff;
    border-color: #0b0b0c;
    box-shadow: 0 0 0 3px rgba(11,11,12,.08);
}

.left-panel .input-group-text {
    min-height: 47px;
    color: #5f6267;
    background: #ececea;
    border: 1px solid #bfc0bd;
    border-left: 0;
    border-radius: 0 2px 2px 0;
}

.forgot-link {
    color: #4d5055;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .035em;
    text-decoration: none;
}

.forgot-link:hover {
    color: #0b0b0c;
    text-decoration: underline;
}

.login-btn {
    position: relative;
    min-height: 48px;
    padding: 11px 18px;
    color: #fff !important;
    background: #0b0b0c !important;
    border: 1px solid #0b0b0c !important;
    border-radius: 2px !important;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .16em;
}

.login-btn::after {
    content: "→";
    position: absolute;
    right: 18px;
    font-size: 1rem;
    transition: transform .16s ease;
}

.login-btn:hover {
    color: #0b0b0c !important;
    background: #fff !important;
    box-shadow: 4px 4px 0 #c4c5c2;
}

.login-btn:hover::after { transform: translateX(3px); }

#OTP { margin-top: 20px; }
#bttnprcd { margin-top: 8px; }

.right-panel {
    position: relative;
    height: 100%;
    min-height: 620px;
    overflow: hidden;
    background-color: #111113;
    background-image:
        linear-gradient(150deg, rgba(8,8,9,.06) 12%, rgba(8,8,9,.36) 68%, rgba(8,8,9,.18) 100%),
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
        url('../img/login-architectural-sheet-v2.png');
    background-position: center, center, center, center;
    background-size: 100% 100%, 32px 32px, 32px 32px, cover;
    background-repeat: no-repeat, repeat, repeat, no-repeat;
    border-left: 1px solid #0b0b0c;
    transition: background-position .8s cubic-bezier(.2,.7,.2,1), filter .8s ease;
}

.right-panel::before,
.right-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.right-panel::before {
    top: 32px;
    left: 32px;
    z-index: 1;
    width: 32px;
    height: 32px;
    opacity: .36;
    background:
        linear-gradient(90deg, transparent 48%, rgba(255,255,255,.46) 49% 51%, transparent 52%),
        linear-gradient(transparent 48%, rgba(255,255,255,.46) 49% 51%, transparent 52%);
    border: 1px solid rgba(255,255,255,.23);
    border-radius: 50%;
    transition: opacity .45s ease, transform .65s cubic-bezier(.2,.7,.2,1);
}

.right-panel::after {
    top: -30%;
    bottom: -30%;
    left: -55%;
    z-index: 2;
    width: 28%;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.065), transparent);
    transform: skewX(-16deg);
    animation: login-studio-light 3.4s cubic-bezier(.2,.7,.2,1) .55s 1 both;
}

.login-card:focus-within .right-panel {
    background-position: center, center, center, 51% 50%;
    filter: brightness(1.035);
}

.login-card:focus-within .right-panel::before {
    opacity: .72;
    transform: rotate(45deg);
}

@keyframes login-studio-light {
    0% { left: -55%; opacity: 0; }
    18% { opacity: .28; }
    68% { opacity: .11; }
    100% { left: 128%; opacity: 0; }
}

.login-footer {
    position: relative;
    z-index: 2;
    margin-top: 17px;
    color: #777a7f;
    font-size: .64rem;
    letter-spacing: .035em;
}

.login-footer a {
    color: #303237;
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover { text-decoration: underline; }

.modal-dialog { max-width: 420px; }
.modal-content { border-radius: 2px; }

@media (max-width: 991.98px) {
    .login-card { max-width: 620px; }
    .login-card .row.g-0 { min-height: auto; }
    .right-panel { display: none; }
    .left-panel { min-height: 650px; }
}

/* Keep the complete sign-in form accessible on short desktop screens. */
@media (min-width: 992px) and (max-height: 760px) {
    .login-wrapper {
        min-height: 100vh;
        padding: 14px clamp(22px, 4vw, 58px);
        place-items: start center;
    }

    .login-card .row.g-0 {
        min-height: 540px;
    }

    .left-panel {
        padding: 22px clamp(38px, 4vw, 58px);
    }

    .login-brand {
        margin-bottom: 18px;
    }

    .login-brand-logo {
        width: 76px;
        height: 50px;
    }

    .login-title {
        font-size: clamp(2rem, 2.8vw, 2.75rem);
    }

    .login-subtitle {
        margin-bottom: 18px;
    }

    .left-panel .mb-4 {
        margin-bottom: 1rem !important;
    }

    .left-panel .mb-3 {
        margin-bottom: .75rem !important;
    }

    .left-panel .d-flex.mb-4 {
        margin-bottom: .85rem !important;
    }

    .right-panel {
        min-height: 540px;
    }

    .login-footer {
        margin-top: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .right-panel,
    .right-panel::before {
        transition: none;
    }

    .right-panel::after {
        animation: none;
    }
}

/* Desktop login: keep the complete composition inside one viewport. */
@media (min-width: 992px) {
    html,
    body {
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden !important;
    }

    .login-wrapper {
        width: 100%;
        height: 100vh;
        height: 100svh;
        min-height: 0;
        padding: clamp(12px, 2.35vh, 24px) clamp(24px, 5vw, 76px);
        overflow: hidden;
    }

    .login-wrapper > div {
        display: flex;
        max-height: 100%;
        flex-direction: column;
        justify-content: center;
    }

    .login-card {
        flex: 0 1 auto;
        min-height: 0;
    }

    .login-card .row.g-0 {
        height: min(700px, calc(100svh - 78px));
        min-height: 530px;
        max-height: 700px;
    }

    .left-panel {
        min-height: 0;
        padding: clamp(27px, 4.4vh, 48px) clamp(36px, 4.2vw, 64px);
    }

    .login-brand {
        margin-bottom: clamp(22px, 3.7vh, 38px);
    }

    .login-subtitle {
        margin-bottom: clamp(20px, 3vh, 30px);
    }

    .left-panel .mb-4 {
        margin-bottom: clamp(14px, 2vh, 20px) !important;
    }

    .left-panel .mb-3 {
        margin-bottom: clamp(10px, 1.5vh, 15px) !important;
    }

    .left-panel .d-flex.mb-4 {
        margin-bottom: clamp(13px, 1.9vh, 19px) !important;
    }

    .right-panel {
        min-height: 0;
    }

    .login-footer {
        flex: 0 0 auto;
        margin-top: clamp(20px, 2.5vh, 26px);
        line-height: 1.35;
    }
}

@media (max-width: 575.98px) {
    body::after { inset: 8px; }
    .login-wrapper { padding: 22px 12px; }
    .left-panel { min-height: auto; padding: 48px 25px 42px; }
    .login-brand { margin-bottom: 42px; }
    .login-brand-logo { width: 76px; height: 50px; }
    .login-brand-meta { font-size: .49rem; }
    .login-footer { padding: 0 12px; line-height: 1.6; }
}

/* Calibri typography lock for the standalone login screen. */
html,
body,
body *:not(.bi):not([class^="bi-"]):not([class*=" bi-"]) {
    font-family: Calibri, sans-serif !important;
}

/* Keep password-dialog actions inside short desktop and mobile viewports. */
.modal-content {
    display: flex !important;
    min-height: 0;
    max-height: calc(100dvh - 32px);
    flex-direction: column;
    overflow: hidden !important;
}

.modal-content > from,
.modal-content > form,
.modal-content > .modal-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal-content > .modal-header,
.modal-content > .modal-footer {
    flex: 0 0 auto;
}

.modal-footer {
    position: relative;
    z-index: 5;
    min-height: 72px;
    padding: 14px 24px !important;
    overflow: visible !important;
}

.modal-footer > .btn,
.modal-footer > button,
.modal-footer > input[type="button"],
.modal-footer > input[type="submit"] {
    max-width: 100%;
    margin-block: 0 !important;
}
