/* ==============================
   RESET
============================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html,
body {
    width: 100%;
    min-height: 100%;
}


body {
    font-family: "Nunito", sans-serif;
    background: #f7f8fa;
    color: #000000;
    -webkit-font-smoothing: antialiased;
}


/* ==============================
   LOGIN PAGE
============================== */

.crm-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}


/* ==============================
   DECORATIVE BACKGROUND
============================== */

.crm-login-page::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    background: #06AB4E;
    border-radius: 50%;
    top: -250px;
    left: -180px;
    opacity: 0.08;
}


.crm-login-page::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    background: #3B3456;
    border-radius: 50%;
    bottom: -320px;
    right: -220px;
    opacity: 0.07;
}


/* ==============================
   LOGIN CONTAINER
============================== */

.crm-login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
}


/* ==============================
   LOGO
============================== */

.crm-login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}


.crm-login-logo img {
    width: 210px;
    max-width: 100%;
    height: auto;
    display: inline-block;
}


/* ==============================
   LOGIN CARD
============================== */

.crm-login-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 42px 40px;
    box-shadow: 0 18px 55px rgba(59, 52, 86, 0.12);
    border: 1px solid rgba(59, 52, 86, 0.08);
}


/* ==============================
   HEADING
============================== */

.crm-login-heading {
    text-align: center;
    margin-bottom: 32px;
}


.crm-login-heading h1 {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    color: #3B3456;
    margin-bottom: 8px;
}


.crm-login-heading p {
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    color: #666666;
}


/* ==============================
   GENERAL FORM ERROR (login failed)
============================== */

.crm-form-errors {
    margin-bottom: 22px;
}


.crm-form-error {
    padding: 12px 14px;
    border: 1px solid #f5c2c0;
    border-radius: 9px;
    background: #fdf1f0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: #b42318;
}


/* ==============================
   FORM
============================== */

.crm-form-group {
    margin-bottom: 21px;
}


.crm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
}


.crm-form-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid #dedee3;
    border-radius: 9px;
    background: #ffffff;
    font-family: "Nunito", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #000000;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.crm-form-input::placeholder {
    color: #999999;
    font-weight: 500;
}


.crm-form-input:focus {
    border-color: #06AB4E;
    box-shadow: 0 0 0 3px rgba(6, 171, 78, 0.10);
}


/* Keep browser autofill white instead of light blue */
.crm-form-input:-webkit-autofill,
.crm-form-input:-webkit-autofill:hover,
.crm-form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #000000;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    transition: background-color 9999s ease-in-out 0s;
}


/* Field validation error */

.crm-form-input.crm-input-error {
    border-color: #dc2626;
}


.crm-form-input.crm-input-error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}


.crm-field-error {
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #dc2626;
}


/* ==============================
   PASSWORD FIELD + SHOW/HIDE
============================== */

.crm-password-wrapper {
    position: relative;
    width: 100%;
}


.crm-password-wrapper .crm-form-input {
    padding-right: 50px;
}


.crm-password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #666666;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}


.crm-password-toggle:hover {
    background: rgba(59, 52, 86, 0.08);
}


.crm-password-toggle:focus-visible {
    outline: 2px solid #06AB4E;
    outline-offset: 1px;
}


/* ==============================
   FORGOT PASSWORD
============================== */

.crm-login-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -5px;
    margin-bottom: 24px;
}


.crm-login-options a {
    font-size: 13px;
    font-weight: 700;
    color: #3B3456;
    text-decoration: none;
    transition: color 0.2s ease;
}


.crm-login-options a:hover {
    color: #06AB4E;
}


/* ==============================
   LOGIN BUTTON
============================== */

.crm-login-button {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 9px;
    background: #06AB4E;
    color: #ffffff;
    font-family: "Nunito", sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.crm-login-button:hover {
    background: #058f42;
    box-shadow: 0 8px 20px rgba(6, 171, 78, 0.20);
    transform: translateY(-1px);
}


.crm-login-button:active {
    transform: translateY(0);
}


.crm-login-button:focus-visible {
    outline: 2px solid #3B3456;
    outline-offset: 2px;
}


/* Loading state: show only one label at a time */

.crm-login-button .button-loading {
    display: none;
}


.crm-login-button.is-loading .button-text {
    display: none;
}


.crm-login-button.is-loading .button-loading {
    display: inline;
}


.crm-login-button:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* ==============================
   REGISTER
============================== */

.crm-login-register {
    text-align: center;
    margin-top: 22px;
}


.crm-login-register p {
    font-size: 13px;
    font-weight: 600;
    color: #777777;
}


.crm-login-register a {
    color: #06AB4E;
    font-weight: 800;
    text-decoration: none;
}


.crm-login-register a:hover {
    color: #3B3456;
}


/* ==============================
   FOOTER
============================== */

.crm-login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #888888;
}


.crm-login-footer span {
    color: #3B3456;
    font-weight: 800;
}


/* ==============================
   MOBILE
============================== */

@media (max-width: 520px) {

    .crm-login-page {
        padding: 20px 15px;
    }


    .crm-login-card {
        padding: 32px 24px;
        border-radius: 15px;
    }


    .crm-login-logo img {
        width: 180px;
    }


    .crm-login-heading h1 {
        font-size: 26px;
    }

}