/* ============================================================
   css/pages/login.css
   login — page-specific styles. Load after style.css.
   ============================================================ */

/* =======================================
   LOGIN PAGE
======================================= */
body.login {
    min-height: 100vh;

    padding-top: 70px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background: #0a1a33;
}


/* login box */
.login-box {
    width: 360px;
    padding: 35px;

    border-radius: 12px;

    background: #102a4c;
    border: 1px solid #1e4b7a;

    box-shadow: 0 0 25px rgba(0, 150, 255, 0.25);
    text-align: center;
}

/* inputs */
body.login input {
    width: 92%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #2b5c8a;
    border-radius: 6px;
    background: #0b1f3a;
    color: white;
}

body.login input::placeholder {
    color: #a8c7e6;
}

/* inputs with icon */
.input-group {
    display: flex;
    align-items: stretch;
    position: relative;
    width: 100%;
    margin: 10px 0;
    box-sizing: border-box;
    border: 1px solid #2b5c8a;
    border-radius: 6px;
    background: #0b1f3a;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25);
}

.input-icon {
    width: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #163a66;
    color: #9ecbff;
    font-size: 16px;
    border-right: 1px solid #2b5c8a;
    transition: background 0.2s, color 0.2s;
}

.input-group:focus-within .input-icon {
    background: #1f6feb;
    color: #fff;
}

body.login .input-group input {
    flex: 1;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 12px 14px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: white;
    outline: none;
    box-sizing: border-box;
}

body.login .password-wrapper input {
    padding-right: 40px; /* room for the eye icon */
}

/* stop Chrome autofill from turning the field white/yellow */
body.login .input-group input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px #0b1f3a inset;
    -webkit-text-fill-color: #fff;
}

/* button */
body.login button {
    width: 96%;
    padding: 12px;
    margin-top: 15px;
    background: #1f6feb;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}

body.login button:hover {
    background: #4aa3ff;
}

/* =======================================
   LOGIN POPUP MODAL
======================================= */
.login-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.login-popup-overlay.show {
    display: flex;
}

.login-popup-box {
    background: #102a4c;
    border: 1px solid #1e4b7a;
    border-radius: 12px;
    box-sizing: border-box;
    padding: 24px;
    width: min(90vw, 380px);
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.35);
    border-top: 4px solid #1f6feb;
    animation: popupIn 0.15s ease-out;
}

@keyframes popupIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.login-popup-icon {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.login-popup-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.login-popup-title span {
    color: #1f6feb;
}

.login-popup-message {
    font-size: 14px;
    color: #9ecbff;
    margin-bottom: 20px;
    line-height: 1.4;
}

.login-popup-btn {
    width: 100%;
    background: #1f6feb;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}

.login-popup-btn:hover {
    background: #4aa3ff;
}

/* message */
#msg {
    margin-top: 10px;
    font-size: 13px;
}

/*  pnp logo image */
.badge-img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    margin: 0 auto 15px auto;
    display: block;

    filter: drop-shadow(0 0 15px rgba(0, 150, 255, 0.7));
}

.forgot-password {
    color: #9ecbff;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    margin-top: 16px;
}

.forgot-password:hover {
    color: #4aa3ff;
    text-decoration: underline;
}


/* Hide Edge's native reveal/clear buttons (we have our own toggle) */
#password::-ms-reveal,
#password::-ms-clear {
    display: none;
}

#togglePassword {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ecbff;
    font-size: 15px;
    opacity: 0.8;
    transition: 0.2s;
}

#togglePassword:hover {
    opacity: 1;
    color: #4aa3ff;
}

body.login {
    padding: 24px 16px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Ambient shifting glow behind everything */
.page-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    filter: brightness(0.35); /* darkens it so the card stays readable */
}

@keyframes loginGlow {
    from { transform: translateY(0);  opacity: 1; }
    to   { transform: translateY(5%); opacity: 0.8; }
}

/* Card: same size as before, but shrinks to fit narrow phones */
.login-box {
    width: min(430px, 100%);
    box-sizing: border-box;
    animation: loginCardIn 460ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Card pops in with a bright border flash that settles */
@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: scale(0.4);
        border-color: #1f6feb;
        box-shadow: 0 0 48px rgba(0, 150, 255, 0.55);
    }
    to {
        opacity: 1;
        transform: scale(1);
        border-color: #1e4b7a;
        box-shadow: 0 0 25px rgba(0, 150, 255, 0.25);
    }
}

/* Staggered pop-in: title → subtitle → email → password → button */
.login-pop {
    animation: loginPop 260ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.login-pop-1 { animation-delay: 390ms; }

.login-pop-2 { animation-delay: 495ms; }

.login-pop-3 { animation-delay: 625ms; }

.login-pop-4 { animation-delay: 730ms; }

.login-pop-5 { animation-delay: 860ms; animation-duration: 310ms; }

@keyframes loginPop {
    from { opacity: 0; transform: scale(0); }
    to   { opacity: 1; transform: scale(1); }
}

/* Shake on failed login */
.login-box.is-shaking {
    animation: loginShake 500ms ease-in-out;
}

@keyframes loginShake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-12px); }
    40%  { transform: translateX(10px); }
    60%  { transform: translateX(-8px); }
    80%  { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

/* Button: press-in scale + loading spinner */
#loginBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    transition: background 0.3s, transform 0.1s;
}

#loginBtn:active:not(:disabled) {
    transform: scale(0.96);
}

#loginBtn:disabled {
    cursor: not-allowed;
}

#loginBtn .login-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
}

#loginBtn.is-loading .login-btn-label   { display: none; }

#loginBtn.is-loading .login-btn-spinner { display: inline-block; }

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

/* Popup: small accent bar on top + bouncy scale-in (like the app dialog) */
.login-popup-box {
    border-top: 1px solid #1e4b7a;
    padding: 24px 32px;
    animation: loginPopupIn 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-popup-box::before {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    margin: 0 auto 16px;
    background: #1f6feb;
}

@keyframes loginPopupIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* Respect "reduce motion" system setting */
@media (prefers-reduced-motion: reduce) {
    body.login::before,
    .login-box,
    .login-pop,
    .login-popup-box,
    .login-box.is-shaking {
        animation: none !important;
    }
}
