/* =========================================================
   NOVAPAY LOGIN PAGE
   Mobile-first
   No page scrolling
   NovaPay blue theme
========================================================= */


/* =========================================================
   RESET
========================================================= */

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


html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}


body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #f8fbff 0%,
            #f3f7fd 100%
        );

    color: #111827;

    font-family:
        "Poppins",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    text-rendering: optimizeLegibility;
}


button,
input {
    font: inherit;
}


button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}


button {
    border: 0;
}


a {
    color: inherit;
}


/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    width: 100%;
    max-width: 520px;

    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;

    margin: 0 auto;

    padding:
        max(24px, env(safe-area-inset-top))
        20px
        max(20px, env(safe-area-inset-bottom));

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

    overflow: hidden;
}


/* =========================================================
   NOVAPAY LOGO
========================================================= */

.login-logo {
    display: block;

    margin: 0 auto 24px;

    color: #2563eb;

    font-size: clamp(30px, 8vw, 38px);
    line-height: 1;

    font-weight: 800;

    letter-spacing: -1.8px;

    text-decoration: none;

    white-space: nowrap;
}


.login-logo span {
    color: #0f172a;
}


/* =========================================================
   LOGIN HEADER
========================================================= */

.login-header {
    width: 100%;

    margin: 0 0 20px;

    text-align: left;
}


.login-header h1 {
    margin: 0;

    color: #111827;

    font-size: clamp(27px, 7.5vw, 34px);
    line-height: 1.12;

    font-weight: 800;

    letter-spacing: -1.1px;
}


.login-header p {
    margin: 8px 0 0;

    color: #64748b;

    font-size: 15px;
    line-height: 1.4;

    font-weight: 400;
}


/* =========================================================
   LOGIN CARD
========================================================= */

.login-card {
    width: 100%;

    padding: 27px 22px 23px;

    background: rgba(255, 255, 255, 0.98);

    border:
        1px solid rgba(226, 232, 240, 0.95);

    border-radius: 22px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.08),
        0 3px 12px rgba(37, 99, 235, 0.035);
}


/* =========================================================
   LOGIN FORM
========================================================= */

#loginForm {
    width: 100%;
}


/* =========================================================
   INPUT GROUP
========================================================= */

.input-group {
    width: 100%;

    margin: 0 0 17px;
}


.input-group label {
    display: block;

    margin: 0 0 7px 1px;

    color: #334155;

    font-size: 13px;
    line-height: 1.25;

    font-weight: 600;
}


/* =========================================================
   INPUTS
========================================================= */

.input-group input,
#email,
#password {
    display: block;

    width: 100%;
    height: 52px;

    margin: 0;

    padding:
        0 15px;

    border:
        1px solid #d8e0eb;

    border-radius: 13px;

    outline: none;

    background: #f9fbfd;

    color: #111827;

    font-size: 14px;
    line-height: 1;

    font-weight: 400;

    box-shadow: none;

    appearance: none;
    -webkit-appearance: none;

    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}


.input-group input:hover,
#email:hover,
#password:hover {
    border-color: #c5d0df;
}


.input-group input:focus,
#email:focus,
#password:focus {
    border-color: #2563eb;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


.input-group input::placeholder,
#email::placeholder,
#password::placeholder {
    color: #94a3b8;

    opacity: 1;
}


/* =========================================================
   PASSWORD WRAPPER
========================================================= */

.password-wrapper {
    position: relative;

    width: 100%;
}


.password-wrapper #password {
    padding-right: 70px;
}


/* =========================================================
   PASSWORD SHOW/HIDE
========================================================= */

.password-toggle {
    position: absolute;

    top: 50%;
    right: 9px;

    width: 48px;
    min-height: 34px;

    padding: 6px 7px;

    transform: translateY(-50%);

    border-radius: 8px;

    background: transparent;

    color: #2563eb;

    font-size: 11px;
    line-height: 1;

    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}


.password-toggle:hover {
    background: #eff6ff;
}


.password-toggle:active {
    transform:
        translateY(-50%)
        scale(0.96);
}


/* =========================================================
   OPTIONS ROW
========================================================= */

.login-options {
    width: 100%;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin: 1px 0 21px;
}


/* =========================================================
   REMEMBER ME
========================================================= */

.remember-me {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    margin: 0;

    color: #475569;

    font-size: 12px;
    line-height: 1.3;

    font-weight: 400;

    cursor: pointer;

    white-space: nowrap;
}


.remember-me input {
    width: 17px;
    height: 17px;

    margin: 0;

    flex: 0 0 17px;

    accent-color: #2563eb;

    cursor: pointer;
}


.remember-me span {
    display: inline-block;
}


/* =========================================================
   FORGOT PASSWORD
========================================================= */

.forgot-password,
#forgotPassword {
    display: inline-block;

    margin: 0;

    color: #2563eb;

    font-size: 12px;
    line-height: 1.3;

    font-weight: 600;

    text-decoration: none;

    cursor: pointer;

    white-space: nowrap;
}


.forgot-password:hover,
#forgotPassword:hover {
    text-decoration: underline;
}


/* =========================================================
   LOGIN BUTTON
========================================================= */

#loginBtn,
.login-button,
.primary-button {
    display: block;

    width: 100%;
    min-height: 52px;

    margin: 0;

    padding:
        0 18px;

    border: 0;
    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #2563eb 0%,
            #1d4ed8 100%
        );

    color: #ffffff;

    font-size: 15px;
    line-height: 1;

    font-weight: 700;

    text-align: center;

    cursor: pointer;

    box-shadow:
        0 9px 20px rgba(37, 99, 235, 0.20);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease,
        opacity 0.15s ease;
}


#loginBtn:hover,
.login-button:hover,
.primary-button:hover {
    background:
        linear-gradient(
            135deg,
            #1d4ed8 0%,
            #1e40af 100%
        );

    box-shadow:
        0 11px 24px rgba(37, 99, 235, 0.25);
}


#loginBtn:active,
.login-button:active,
.primary-button:active {
    transform: translateY(1px);

    box-shadow:
        0 6px 14px rgba(37, 99, 235, 0.18);
}


#loginBtn:disabled,
.login-button:disabled,
.primary-button:disabled {
    opacity: 0.60;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* =========================================================
   CREATE ACCOUNT
========================================================= */

.register-link,
.create-account,
.signup-link {
    margin: 18px 0 0;

    color: #64748b;

    text-align: center;

    font-size: 12px;
    line-height: 1.45;

    font-weight: 400;
}


.register-link a,
.create-account a,
.signup-link a {
    color: #2563eb;

    font-weight: 700;

    text-decoration: none;
}


.register-link a:hover,
.create-account a:hover,
.signup-link a:hover {
    text-decoration: underline;
}


/* =========================================================
   CUSTOM MODAL
========================================================= */

#customModal {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(15, 23, 42, 0.50);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}


/* =========================================================
   MODAL CONTENT
========================================================= */

#customModal > div,
.custom-modal-content,
.modal-content {
    width: min(100%, 380px);

    padding: 25px 21px 21px;

    background: #ffffff;

    border:
        1px solid #e5e7eb;

    border-radius: 20px;

    box-shadow:
        0 25px 70px rgba(15, 23, 42, 0.22);

    text-align: center;
}


/* =========================================================
   MODAL TITLE
========================================================= */

#modalTitle {
    margin: 0 0 9px;

    color: #111827;

    font-size: 20px;
    line-height: 1.25;

    font-weight: 800;
}


/* =========================================================
   MODAL MESSAGE
========================================================= */

#modalMessage {
    margin: 0 0 19px;

    color: #64748b;

    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   MODAL BUTTON
========================================================= */

#modalButton {
    display: block;

    width: 100%;
    min-height: 44px;

    padding: 0 15px;

    border-radius: 11px;

    background: #2563eb;

    color: #ffffff;

    font-size: 13px;
    line-height: 1;

    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}


#modalButton:hover {
    background: #1d4ed8;
}


#modalButton:active {
    transform: translateY(1px);
}


/* =========================================================
   GENERIC ERROR
========================================================= */

.error-message,
.login-error,
#errorMessage {
    width: 100%;

    margin: 10px 0;

    padding: 10px 11px;

    border:
        1px solid #fecaca;

    border-radius: 10px;

    background: #fef2f2;

    color: #b91c1c;

    font-size: 11px;
    line-height: 1.4;
}


/* =========================================================
   GENERIC SUCCESS
========================================================= */

.success-message,
.login-success,
#successMessage {
    width: 100%;

    margin: 10px 0;

    padding: 10px 11px;

    border:
        1px solid #bbf7d0;

    border-radius: 10px;

    background: #f0fdf4;

    color: #166534;

    font-size: 11px;
    line-height: 1.4;
}


/* =========================================================
   HIDDEN
========================================================= */

[hidden] {
    display: none !important;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline:
        3px solid rgba(37, 99, 235, 0.25);

    outline-offset: 2px;
}


/* =========================================================
   MOBILE — SMALL WIDTH
========================================================= */

@media (max-width: 390px) {

    .login-page {
        padding-left: 15px;
        padding-right: 15px;
    }


    .login-logo {
        margin-bottom: 20px;

        font-size: 31px;
    }


    .login-header {
        margin-bottom: 17px;
    }


    .login-header h1 {
        font-size: 27px;
    }


    .login-header p {
        margin-top: 6px;

        font-size: 14px;
    }


    .login-card {
        padding:
            22px 17px
            19px;
    }


    .input-group {
        margin-bottom: 14px;
    }


    .input-group label {
        margin-bottom: 6px;

        font-size: 12px;
    }


    .input-group input,
    #email,
    #password {
        height: 49px;

        font-size: 14px;
    }


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


    .remember-me,
    .forgot-password,
    #forgotPassword {
        font-size: 11px;
    }


    #loginBtn,
    .login-button,
    .primary-button {
        min-height: 49px;

        font-size: 14px;
    }


    .register-link {
        margin-top: 16px;

        font-size: 11px;
    }
}


/* =========================================================
   VERY SMALL HEIGHT
   Prevents vertical scrolling on short screens
========================================================= */

@media (max-height: 720px) {

    .login-page {
        padding-top:
            max(10px, env(safe-area-inset-top));

        padding-bottom:
            max(10px, env(safe-area-inset-bottom));
    }


    .login-logo {
        margin-bottom: 14px;

        font-size: 28px;
    }


    .login-header {
        margin-bottom: 13px;
    }


    .login-header h1 {
        font-size: 25px;
    }


    .login-header p {
        margin-top: 4px;

        font-size: 13px;
    }


    .login-card {
        padding:
            19px 17px
            17px;

        border-radius: 19px;
    }


    .input-group {
        margin-bottom: 11px;
    }


    .input-group label {
        margin-bottom: 5px;

        font-size: 11px;
    }


    .input-group input,
    #email,
    #password {
        height: 45px;

        border-radius: 11px;

        font-size: 13px;
    }


    .login-options {
        margin-top: 0;
        margin-bottom: 15px;
    }


    .remember-me,
    .forgot-password,
    #forgotPassword {
        font-size: 10px;
    }


    .remember-me input {
        width: 16px;
        height: 16px;
    }


    #loginBtn,
    .login-button,
    .primary-button {
        min-height: 45px;

        border-radius: 11px;

        font-size: 13px;
    }


    .register-link {
        margin-top: 13px;

        font-size: 10px;
    }
}


/* =========================================================
   VERY SHORT SCREEN
========================================================= */

@media (max-height: 620px) {

    .login-page {
        padding-top: 6px;
        padding-bottom: 6px;
    }


    .login-logo {
        margin-bottom: 9px;

        font-size: 24px;
    }


    .login-header {
        margin-bottom: 9px;
    }


    .login-header h1 {
        font-size: 21px;
    }


    .login-header p {
        display: none;
    }


    .login-card {
        padding:
            14px 14px
            13px;

        border-radius: 16px;
    }


    .input-group {
        margin-bottom: 8px;
    }


    .input-group label {
        margin-bottom: 3px;

        font-size: 9px;
    }


    .input-group input,
    #email,
    #password {
        height: 38px;

        padding-left: 10px;

        border-radius: 9px;

        font-size: 11px;
    }


    .password-wrapper #password {
        padding-right: 58px;
    }


    .password-toggle {
        right: 5px;

        min-height: 27px;

        width: 40px;

        font-size: 9px;
    }


    .login-options {
        margin-bottom: 10px;
    }


    .remember-me,
    .forgot-password,
    #forgotPassword {
        font-size: 8px;
    }


    .remember-me {
        gap: 5px;
    }


    .remember-me input {
        width: 13px;
        height: 13px;

        flex-basis: 13px;
    }


    #loginBtn,
    .login-button,
    .primary-button {
        min-height: 38px;

        border-radius: 9px;

        font-size: 11px;
    }


    .register-link {
        margin-top: 8px;

        font-size: 8px;
    }
}


/* =========================================================
   LANDSCAPE PHONES
========================================================= */

@media (
    max-height: 500px
) and (orientation: landscape) {

    .login-page {
        max-width: 700px;

        padding:
            8px 20px;
    }


    .login-logo {
        margin-bottom: 7px;

        font-size: 23px;
    }


    .login-header {
        margin-bottom: 7px;

        text-align: center;
    }


    .login-header h1 {
        font-size: 20px;
    }


    .login-header p {
        display: none;
    }


    .login-card {
        max-width: 470px;

        padding:
            12px 16px;
    }


    .input-group {
        margin-bottom: 7px;
    }


    .input-group label {
        display: none;
    }


    .input-group input,
    #email,
    #password {
        height: 35px;

        font-size: 11px;
    }


    .login-options {
        margin-bottom: 8px;
    }


    #loginBtn,
    .login-button,
    .primary-button {
        min-height: 35px;

        font-size: 11px;
    }


    .register-link {
        margin-top: 7px;

        font-size: 8px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}