/*
 * OptiFlow Login
 * Split-screen corporate layout
 * Frappe / ERPNext v16
 */

html,
body[data-path="login"] {
    min-height: 100%;
}

body[data-path="login"] {
    margin: 0;
    background: #061522;
    color: #f5f8fb;
    overflow-x: hidden;
}


/* ============================================================
   ROOT
   ============================================================ */

body[data-path="login"] #page-login {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #061522;
}


/* ============================================================
   LEFT VISUAL PANEL
   ============================================================ */

body[data-path="login"] #page-login::before {
    content: "";
    position: fixed;
    z-index: 0;

    top: 18px;
    bottom: 18px;
    left: 18px;

    width: calc(50vw - 28px);

    border-radius: 22px;

    background:
        linear-gradient(
            180deg,
            rgba(4, 20, 38, 0.12) 0%,
            rgba(4, 20, 38, 0.22) 45%,
            rgba(4, 20, 38, 0.82) 100%
        ),
        url("/assets/b2b_ops/images/brand/optiflow-login-visual.svg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.28);

    pointer-events: none;
}


/*
 * Full OptiFlow logo over visual panel.
 * Here the white wordmark works correctly because the panel is dark.
 */
body[data-path="login"] #page-login::after {
    content: "";
    position: fixed;
    z-index: 2;

    top: 52px;
    left: 52px;

    width: 164px;
    height: 54px;

    background:
        url("/assets/b2b_ops/images/brand/optiflow-logo.png")
        left center / contain no-repeat;

    pointer-events: none;
}


/* ============================================================
   LEFT PANEL MESSAGE
   ============================================================ */

body[data-path="login"] .page-content-wrapper::after {
    content:
        "Claritate operațională.\A"
        "Procese mai rapide.\A"
        "Creștere controlată.";

    white-space: pre-line;

    position: fixed;
    z-index: 2;

    left: 58px;
    bottom: 64px;

    max-width: 430px;

    color: #ffffff;

    font-size: clamp(25px, 2vw, 34px);
    line-height: 1.16;
    font-weight: 650;
    letter-spacing: -0.035em;

    text-shadow:
        0 2px 20px rgba(0, 0, 0, 0.22);

    pointer-events: none;
}


/* ============================================================
   RIGHT PANEL
   ============================================================ */

body[data-path="login"] .page-content-wrapper {
    position: relative;
    z-index: 1;

    min-height: 100vh;

    background: transparent;
}


body[data-path="login"] main.container {
    width: 50%;
    max-width: none;

    min-height: 100vh;

    margin: 0 0 0 50%;
    padding:
        64px
        clamp(50px, 7vw, 120px);

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

    background:
        radial-gradient(
            circle at 95% 5%,
            rgba(0, 184, 240, 0.08),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            #071724 0%,
            #091c2b 52%,
            #061522 100%
        );
}


body[data-path="login"] .page_content {
    width: 100%;
    max-width: 520px;

    margin: 0;
    padding: 0;
}


body[data-path="login"] .page_content > div {
    width: 100%;
}


body[data-path="login"] section {
    padding: 0 !important;
}


/* ============================================================
   REMOVE ORIGINAL CARD LOOK
   ============================================================ */

body[data-path="login"] .login-content.page-card {
    width: 100% !important;
    max-width: 520px !important;

    margin: 0 auto !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;

    box-shadow: none !important;
}


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

body[data-path="login"] .page-card-head {
    display: block !important;

    margin: 0 0 38px !important;
    padding: 0 !important;

    text-align: left !important;
}


body[data-path="login"] .page-card-head .app-logo,
body[data-path="login"] .app-logo {
    display: block;

    width: 48px !important;
    height: 48px !important;
    max-height: 48px !important;

    margin:
        0
        0
        28px
        0 !important;

    padding: 9px;

    object-fit: contain;

    border:
        1px solid
        rgba(0, 184, 240, 0.20);

    border-radius: 14px;

    background:
        rgba(0, 184, 240, 0.08);

    box-shadow:
        0 10px 32px
        rgba(0, 184, 240, 0.08);
}


body[data-path="login"] .page-card-head-text {
    text-align: left !important;
}


body[data-path="login"] .page-card-head h4 {
    margin: 0 0 10px;

    color: #ffffff;

    font-size: clamp(30px, 2.5vw, 40px);
    line-height: 1.1;

    font-weight: 700;

    letter-spacing: -0.04em;
}


body[data-path="login"] .page-card-subtitle {
    max-width: 430px;

    margin: 0;

    color: #91a3b2 !important;

    font-size: 15px;
    line-height: 1.6;
}


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

body[data-path="login"] .page-card-body {
    padding: 0 !important;
}


body[data-path="login"] .form-group {
    margin-bottom: 22px;
}


body[data-path="login"] .form-label {
    margin-bottom: 8px;

    color: #dce6ee !important;

    font-size: 13px;
    font-weight: 550;

    letter-spacing: 0.01em;
}


body[data-path="login"] .form-control {
    min-height: 50px;

    padding:
        12px
        46px
        12px
        44px;

    color: #ffffff !important;

    border:
        1px solid
        rgba(255, 255, 255, 0.12) !important;

    border-radius: 10px !important;

    background:
        rgba(255, 255, 255, 0.065) !important;

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.025);

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


body[data-path="login"] .form-control::placeholder {
    color: #677b8b !important;
}


body[data-path="login"] .form-control:hover {
    border-color:
        rgba(255, 255, 255, 0.20) !important;
}


body[data-path="login"] .form-control:focus {
    border-color: #00b8f0 !important;

    background:
        rgba(255, 255, 255, 0.085) !important;

    box-shadow:
        0 0 0 3px
        rgba(0, 184, 240, 0.12) !important;
}


/* Input icons */

body[data-path="login"] .field-icon {
    color: #8195a4 !important;
}


body[data-path="login"] .toggle-password {
    color: #8195a4 !important;
}


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

body[data-path="login"] .forgot-password-message {
    margin-top: 10px;
    text-align: right;
}


body[data-path="login"] a {
    color: #38c8f5 !important;

    transition:
        color 0.15s ease,
        opacity 0.15s ease;
}


body[data-path="login"] a:hover {
    color: #78dcfa !important;
    text-decoration: none;
}


/* ============================================================
   ACTION BUTTONS
   ============================================================ */

body[data-path="login"] .page-card-actions {
    margin-top: 30px;
    padding: 0 !important;
}


body[data-path="login"] .page-card-actions .btn {
    min-height: 50px;

    border-radius: 10px !important;

    font-size: 14px;
    font-weight: 650;

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


/* Main login action */

body[data-path="login"]
.page-card-actions
.btn-login:not(.btn-login-option) {

    color: #03131f !important;

    border-color: #26c8f5 !important;

    background:
        linear-gradient(
            135deg,
            #25cdf7,
            #00aee8
        ) !important;

    box-shadow:
        0 12px 32px
        rgba(0, 184, 240, 0.18);
}


body[data-path="login"]
.page-card-actions
.btn-login:not(.btn-login-option):hover {

    transform: translateY(-1px);

    border-color: #52d6f8 !important;

    background:
        linear-gradient(
            135deg,
            #50d8fa,
            #13bcec
        ) !important;

    box-shadow:
        0 15px 38px
        rgba(0, 184, 240, 0.26);
}


/* Forgot-password submit button */

body[data-path="login"]
.page-card-actions
.btn-primary {

    color: #03131f !important;

    border-color: #26c8f5 !important;

    background: #25c9f5 !important;
}


/* Secondary login method */

body[data-path="login"]
.page-card-actions
.btn-login-option {

    margin-top: 12px;

    color: #d9e5ed !important;

    border:
        1px solid
        rgba(255, 255, 255, 0.14) !important;

    background:
        rgba(255, 255, 255, 0.045) !important;
}


body[data-path="login"]
.page-card-actions
.btn-login-option:hover {

    border-color:
        rgba(255, 255, 255, 0.24) !important;

    background:
        rgba(255, 255, 255, 0.085) !important;
}


/* ============================================================
   MESSAGES / ERRORS
   ============================================================ */

body[data-path="login"] .login-error-banner {
    border:
        1px solid
        rgba(255, 100, 100, 0.22);

    border-radius: 9px;

    background:
        rgba(255, 82, 82, 0.09);

    color: #ffb8b8;
}


body[data-path="login"] .login-success-banner {
    border:
        1px solid
        rgba(0, 184, 240, 0.20);

    border-radius: 9px;

    background:
        rgba(0, 184, 240, 0.08);

    color: #bfefff;
}


body[data-path="login"] .field-error {
    color: #ff9d9d !important;
}


/* ============================================================
   SIGN UP / SECONDARY TEXT
   ============================================================ */

body[data-path="login"] .sign-up-message,
body[data-path="login"] .text-muted {
    color: #7f94a4 !important;
}


/* ============================================================
   FOOTER
   ============================================================ */

body[data-path="login"] footer,
body[data-path="login"] .web-footer,
body[data-path="login"] .page-footer {
    display: none !important;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {

    body[data-path="login"] #page-login::before,
    body[data-path="login"] #page-login::after,
    body[data-path="login"] .page-content-wrapper::after {
        display: none;
    }


    body[data-path="login"] main.container {
        width: 100%;

        min-height: 100vh;

        margin-left: 0;

        padding:
            48px
            clamp(24px, 8vw, 64px);

        background:
            radial-gradient(
                circle at 100% 0%,
                rgba(0, 184, 240, 0.10),
                transparent 35%
            ),
            #071724;
    }


    body[data-path="login"] .page_content {
        max-width: 440px;
        margin: 0 auto;
    }


    body[data-path="login"] .login-content.page-card {
        max-width: 440px !important;
    }
}


@media (max-width: 480px) {

    body[data-path="login"] main.container {
        padding: 34px 22px;
    }


    body[data-path="login"] .page-card-head h4 {
        font-size: 30px;
    }


    body[data-path="login"] .page-card-head {
        margin-bottom: 30px !important;
    }
}


/* ============================================================
   OptiFlow cover correction
   Use ONE standalone visual only.
   ============================================================ */

body[data-path="login"] #page-login::before {
    background:
        linear-gradient(
            180deg,
            rgba(3, 14, 25, 0.06) 0%,
            rgba(3, 14, 25, 0.12) 48%,
            rgba(3, 14, 25, 0.72) 100%
        ),
        url("/assets/b2b_ops/images/brand/optiflow-login-visual.svg")
        center center / cover no-repeat;

    background-color: #071724;
}


/* ============================================================
   OptiFlow vector panel
   ============================================================ */

body[data-path="login"] #page-login::before {
    background:
        linear-gradient(
            180deg,
            rgba(2, 13, 25, 0.02) 0%,
            rgba(2, 13, 25, 0.08) 52%,
            rgba(2, 13, 25, 0.52) 100%
        ),
        url("/assets/b2b_ops/images/brand/optiflow-login-visual.svg")
        center center / cover no-repeat;

    background-color: #041426;
}


/*
 * Keep logo visually isolated from the vector composition.
 */
body[data-path="login"] #page-login::after {
    top: 52px;
    left: 58px;

    width: 180px;
    height: 54px;

    filter:
        drop-shadow(
            0 8px 20px
            rgba(0, 0, 0, 0.18)
        );
}


/*
 * Stronger lower gradient behind the slogan.
 */
body[data-path="login"] .page-content-wrapper::before {
    content: "";

    position: fixed;
    z-index: 1;

    left: 18px;
    bottom: 18px;

    width: calc(50vw - 28px);
    height: 360px;

    border-radius:
        0
        0
        22px
        22px;

    background:
        linear-gradient(
            180deg,
            transparent 0%,
            rgba(2, 12, 22, 0.18) 20%,
            rgba(2, 12, 22, 0.82) 100%
        );

    pointer-events: none;
}


/*
 * Brand statement.
 */
body[data-path="login"] .page-content-wrapper::after {
    left: 64px;
    bottom: 72px;

    max-width: 470px;

    color: #ffffff;

    font-size:
        clamp(
            28px,
            2.15vw,
            38px
        );

    line-height: 1.13;

    font-weight: 680;

    letter-spacing: -0.04em;

    text-shadow:
        0 4px 24px
        rgba(0, 0, 0, 0.26);
}


@media (max-width: 900px) {

    body[data-path="login"]
    .page-content-wrapper::before {
        display: none;
    }

}
