/*
 * Brownfly IMS — Login motion & visual polish
 * Scoped to the sign-in / failed-login screen so application pages and BES print
 * layouts keep their existing styling. Motion is deliberately calm and optional.
 */
.login-page {
    isolation: isolate;
    overflow: hidden;
    /* Fixed brand gradient: Brownfly pink, Akinito yellow, BFC-Single green. */
    background: linear-gradient(
        125deg,
        #FFCCFF 0%,
        #F3D0E9 27%,
        #FFFF00 52%,
        #E7EFA5 73%,
        #A8D08D 100%
    );
    background-size: 240% 240%;
    animation: loginBackgroundDrift 24s ease-in-out infinite alternate;
}

.login-page::before,
.login-page::after {
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.login-page::before {
    width: clamp(300px, 42vw, 560px);
    height: clamp(300px, 42vw, 560px);
    top: -18%;
    left: -10%;
    background: radial-gradient(circle at 34% 35%, rgba(255,255,255,.19), rgba(255,255,255,.035) 54%, transparent 72%);
    border: 1px solid rgba(255,255,255,.08);
    animation: loginOrbFloatOne 20s ease-in-out infinite alternate;
}

.login-page::after {
    width: clamp(360px, 48vw, 650px);
    height: clamp(360px, 48vw, 650px);
    bottom: -24%;
    right: -13%;
    background: radial-gradient(circle at 62% 40%, rgba(var(--accent-rgb, 243, 169, 199), .20), rgba(255,255,255,.035) 55%, transparent 73%);
    border: 1px solid rgba(255,255,255,.07);
    animation: loginOrbFloatTwo 26s ease-in-out infinite alternate;
}

.login-page .login-card {
    width: min(100%, 480px);
    max-width: 480px;
    padding: clamp(25px, 4vw, 42px);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 26px;
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
    backdrop-filter: blur(22px) saturate(125%);
    box-shadow:
        0 34px 90px rgba(11, 28, 14, .28),
        0 8px 24px rgba(11, 28, 14, .10),
        inset 0 1px 0 rgba(255,255,255,.95);
    transform-origin: 50% 70%;
    animation: loginCardArrive .82s cubic-bezier(.16, 1, .3, 1) both;
}

.login-page .login-logo {
    align-items: center;
    gap: clamp(10px, 2.5vw, 18px);
    margin-bottom: 24px;
    animation: loginContentArrive .68s .10s cubic-bezier(.16, 1, .3, 1) both;
}

.login-page .login-logo img {
    width: min(45%, 172px);
    max-height: 86px;
    object-fit: contain;
    filter: drop-shadow(0 5px 8px rgba(30, 55, 27, .07));
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

.login-page .login-logo img:hover {
    transform: translateY(-3px) scale(1.025);
    filter: drop-shadow(0 9px 12px rgba(30, 55, 27, .14));
}

.login-page .login-title {
    margin-bottom: 26px;
    animation: loginContentArrive .72s .18s cubic-bezier(.16, 1, .3, 1) both;
}

.login-page .login-title h1 {
    margin: 0;
    font-size: clamp(22px, 2.6vw, 29px);
    line-height: 1.24;
    letter-spacing: -.035em;
    text-wrap: balance;
    color: var(--primary, #a92f68);
}

.login-page .login-title p {
    font-size: 13px;
    line-height: 1.6;
}

.login-page #loginForm .form-group {
    animation: loginContentArrive .66s cubic-bezier(.16, 1, .3, 1) both;
}

.login-page #loginForm .form-group:nth-child(1) { animation-delay: .24s; }
.login-page #loginForm .form-group:nth-child(2) { animation-delay: .31s; }

.login-page .form-group label {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .005em;
    color: #354734;
}

.login-page .input-group input {
    min-height: 52px;
    padding: 13px 58px 13px 16px;
    border: 1px solid #d8e2d3;
    border-radius: 13px;
    background: rgba(255,255,255,.92);
    color: #263526;
    box-shadow: inset 0 1px 2px rgba(25, 40, 25, .025);
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease, transform .22s ease;
}

.login-page .input-group input::placeholder {
    color: #98a094;
    opacity: 1;
}

.login-page .input-group input:hover {
    border-color: #b6c9ad;
}

.login-page .input-group input:focus {
    border-color: var(--secondary, #d64d8b);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--secondary-rgb, 77,124,47), .12), 0 5px 14px rgba(30, 55, 27, .045);
    transform: translateY(-1px);
}

.login-page .login-password-toggle {
    right: 7px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f7f0;
}

.login-page .login-btn {
    position: relative;
    min-height: 52px;
    margin-top: 3px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 13px;
    background: linear-gradient(105deg, var(--primary, #a92f68), var(--secondary, #d64d8b), var(--accent, #f3a9c7), var(--primary, #a92f68));
    background-size: 260% 260%;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .015em;
    box-shadow: 0 9px 22px rgba(var(--primary-rgb, 46,74,46), .20), inset 0 1px 0 rgba(255,255,255,.14);
    animation: loginContentArrive .68s .39s cubic-bezier(.16, 1, .3, 1) both, loginButtonGlow 9s ease-in-out .8s infinite;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.login-page .login-btn::after {
    content: "→";
    display: inline-block;
    margin-left: 2px;
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
    transition: transform .22s ease;
}

.login-page .login-btn:hover {
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 14px 28px rgba(var(--primary-rgb, 46,74,46), .25), inset 0 1px 0 rgba(255,255,255,.18);
}

.login-page .login-btn:hover::after { transform: translateX(4px); }
.login-page .login-btn:active { transform: translateY(0) scale(.99); }
.login-page .login-btn:focus-visible { outline: 3px solid rgba(var(--secondary-rgb, 77,124,47), .3); outline-offset: 3px; }

.login-page .login-accessibility-note {
    margin-top: 17px;
    font-size: 11px;
    letter-spacing: .025em;
    animation: loginContentArrive .64s .45s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes loginBackgroundDrift {
    0% { background-position: 0% 40%; }
    50% { background-position: 75% 60%; }
    100% { background-position: 100% 45%; }
}

@keyframes loginOrbFloatOne {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(6vw, 5vh, 0) scale(1.08); }
}

@keyframes loginOrbFloatTwo {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-5vw, -4vh, 0) scale(1.06); }
}

@keyframes loginCardArrive {
    from { opacity: 0; transform: translate3d(0, 24px, 0) scale(.975); filter: blur(5px); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

@keyframes loginContentArrive {
    from { opacity: 0; transform: translate3d(0, 13px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes loginButtonGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (max-width: 520px) {
    .login-page { padding: 20px 14px; }
    .login-page .login-card { border-radius: 21px; padding: 25px 19px; }
    .login-page .login-logo { margin-bottom: 19px; }
    .login-page .login-logo img { max-height: 72px; }
    .login-page .login-title { margin-bottom: 22px; }
    .login-page .login-title h1 { font-size: clamp(20px, 6vw, 25px); }
    .login-page .login-title p { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-page,
    .login-page::before,
    .login-page::after,
    .login-page .login-card,
    .login-page .login-logo,
    .login-page .login-title,
    .login-page #loginForm .form-group,
    .login-page .login-btn,
    .login-page .login-accessibility-note {
        animation: none !important;
    }
    .login-page .login-card { opacity: 1; transform: none; filter: none; }
    .login-page .login-logo,
    .login-page .login-title,
    .login-page #loginForm .form-group,
    .login-page .login-btn,
    .login-page .login-accessibility-note { opacity: 1; transform: none; }
    .login-page .login-logo img,
    .login-page .login-btn,
    .login-page .login-btn::after,
    .login-page .input-group input { transition: none !important; }
}


/* 29 Oct 2026 — Login always uses the corporate green theme. Company-specific
   Pink/Yellow/Green palettes remain unchanged throughout the authenticated IMS. */
body.login-page {
    --primary: #245c35;
    --secondary: #438b4c;
    --accent: #b9d983;
    --bg: #f3f9f0;
    --card: #ffffff;
    --text: #244b2b;
    --soft: #e8f3e3;
    --soft-border: #cddfc5;
    --heading: #23492a;
    --muted: #637661;
    --primary-rgb: 36, 92, 53;
    --secondary-rgb: 67, 139, 76;
    --accent-rgb: 185, 217, 131;
    background: linear-gradient(125deg, #FFCCFF 0%, #F3D0E9 27%, #FFFF00 52%, #E7EFA5 73%, #A8D08D 100%);
    background-size: 240% 240%;
}
body.login-page .login-title h1 { color: #245c35; }
body.login-page .login-btn {
    background: linear-gradient(105deg, #245c35, #438b4c, #2f743b, #245c35);
    background-size: 260% 260%;
    color: #fff;
}
body.login-page .input-group input:focus {
    border-color: #438b4c;
    box-shadow: 0 0 0 4px rgba(67, 139, 76, .16), 0 5px 14px rgba(30, 55, 27, .045);
}
body.login-page .login-logo img {
    display: block;
    width: min(420px, calc(100% + 36px));
    max-width: none;
    max-height: 90px;
    height: auto;
    object-fit: contain;
}
@media (max-width: 520px) {
    body.login-page .login-logo img {
        width: min(420px, calc(100vw - 34px));
        max-width: calc(100vw - 34px);
        max-height: 76px;
    }
}
