/* =====================================================================
   IPDMS 2.0 — Login modal
   Theme: green/orange gradient (matches homePage.jsp hero)
   All class names are prefixed `lm-` to avoid collisions with page CSS.
   ===================================================================== */

.lm-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 36, 20, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: lm-fade-in 200ms ease-out;
    font-family: 'Roboto', 'Open Sans', Arial, sans-serif;
}

.lm-overlay.lm-open {
    display: flex;
}

@keyframes lm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lm-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.lm-card {
    width: 100%;
    max-width: 900px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    animation: lm-slide-up 280ms ease-out;
}

/* -------- Left brand panel -------- */
.lm-left {
    background: linear-gradient(135deg, var(--ipdms-primary-dark, rgb(0, 87, 47)) 0%, var(--ipdms-primary, rgb(0, 104, 56)) 55%, rgb(241, 90, 41) 100%);
    color: #fff;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.lm-left::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    top: -90px;
    right: -90px;
}

.lm-left::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    bottom: -70px;
    left: -60px;
}

.lm-left-logo {
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    display: inline-flex;
    align-self: flex-start;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 1;
}

.lm-left-logo img {
    height: 38px;
    width: auto;
    display: block;
}

.lm-left-content {
    position: relative;
    z-index: 1;
}

.lm-left h2 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    margin: 28px 0 12px 0;
}

.lm-left p {
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
    opacity: 0.95;
}

.lm-left-footer {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.lm-left-footer a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: background 150ms ease, transform 150ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lm-left-footer a:hover {
    background: rgba(255, 255, 255, 0.26);
    transform: translateX(3px);
}

.lm-left-footer a::before {
    content: "›";
    font-weight: 700;
    color: #ffd9c8;
}

/* -------- Right form panel -------- */
.lm-right {
    padding: 44px 40px 32px 40px;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}

.lm-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 8px;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.lm-close:hover {
    background: rgba(241, 90, 41, 0.12);
    color: rgb(241, 90, 41);
    transform: rotate(90deg);
}

.lm-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ipdms-primary, rgb(0, 104, 56));
    margin: 0 0 6px 0;
}

.lm-sub {
    font-size: 13px;
    color: #666;
    margin: 0 0 22px 0;
}

.lm-field {
    margin-bottom: 14px;
}

.lm-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.lm-input {
    width: 100%;
    height: 44px;
    border: 1.5px solid #d8d8d8;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    background: #fafafa;
    color: #222;
    box-sizing: border-box;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
    font-family: inherit;
}

.lm-input:focus {
    outline: none;
    border-color: var(--ipdms-primary, rgb(0, 104, 56));
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--ipdms-primary-rgb, 0, 104, 56), 0.14);
}

.lm-input::placeholder {
    color: #aaa;
}

/* Captcha row */
.lm-captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.lm-captcha-img {
    height: 48px;
    border: 1.5px solid #d8d8d8;
    border-radius: 10px;
    background: #04b3bf;
    padding: 4px 10px;
    flex: 0 0 auto;
    width: 170px;
    object-fit: contain;
    box-sizing: border-box;
}

.lm-captcha-refresh {
    height: 40px;
    width: 40px;
    border-radius: 10px;
    border: 1.5px solid #d8d8d8;
    background: #fff;
    color: var(--ipdms-primary, rgb(0, 104, 56));
    font-size: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, border-color 150ms ease, transform 350ms ease;
    flex: 0 0 auto;
}

.lm-captcha-refresh:hover {
    background: rgba(var(--ipdms-primary-rgb, 0, 104, 56), 0.08);
    border-color: var(--ipdms-primary, rgb(0, 104, 56));
    transform: rotate(180deg);
}

.lm-captcha-refresh:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--ipdms-primary-rgb, 0, 104, 56), 0.14);
}

/* Submit button */
.lm-submit {
    width: 100%;
    height: 46px;
    background: rgb(241, 90, 41);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 6px 14px rgba(241, 90, 41, 0.32);
    transition: background 150ms ease, transform 100ms ease, box-shadow 150ms ease;
    font-family: inherit;
    text-transform: uppercase;
}

.lm-submit:hover {
    background: rgb(217, 76, 31);
    box-shadow: 0 8px 18px rgba(241, 90, 41, 0.42);
}

.lm-submit:active {
    transform: translateY(1px);
}

.lm-submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(241, 90, 41, 0.3), 0 6px 14px rgba(241, 90, 41, 0.32);
}

.lm-bottom-row {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.lm-link {
    color: var(--ipdms-primary, rgb(0, 104, 56));
    text-decoration: none;
    font-weight: 600;
}

.lm-link:hover {
    text-decoration: underline;
    color: rgb(241, 90, 41);
}

.lm-secured {
    font-size: 12px;
    color: #888;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lm-secured::before {
    content: "\1F512";
    font-size: 11px;
}

/* Error box */
.lm-error {
    color: #b3261e;
    background: #fdecea;
    border: 1px solid #f5c2c0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
    line-height: 1.4;
}

.lm-error.lm-show {
    display: block;
    animation: lm-shake 320ms ease;
}

@keyframes lm-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* Mobile */
@media (max-width: 760px) {
    .lm-card {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
    .lm-left {
        padding: 28px 24px 24px 24px;
        text-align: center;
    }
    .lm-left h2 { font-size: 22px; margin: 18px 0 8px 0; }
    .lm-left-logo { align-self: center; }
    .lm-left-footer { align-items: stretch; }
    .lm-left-footer a { justify-content: flex-start; }
    .lm-right { padding: 32px 24px 28px 24px; }
    .lm-title { font-size: 20px; }
}

/* Lock background scrolling when modal is open */
body.lm-no-scroll {
    overflow: hidden;
}
