/* --- Reset & Base -------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: url("/lm_auth_proxy?LMimage=bg.png") no-repeat center center fixed;
    background-size: cover;
    font-family: "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Ensure the form spans full width so .lm-bar stretches edge-to-edge */
form,
#logonForm {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Mobile Logo (outside banner) ---------------------------------------- */
.lm-mobile-logo {
    display: none;
    background-image: url("/lm_auth_proxy?LMimage=logo.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: auto;
    width: 100%;
    height: 60px;
    margin: 40px auto 20px auto;
}

/* --- Semi-transparent horizontal bar (replicates .content-area) ---------- */
.lm-bar {
    width: 100%;
    background: rgba(63, 54, 67, 0.80);
    /* Padding 60px top/bottom matches NetScaler .content-area */
    padding: 60px 0;
}

/* --- Table layout (replicates .logon-area) ------------------------------- */
/* Full-width table: three cells (logo-spacer | form | spacer).
   Both spacers auto-size equally → form stays centered. */
.lm-bar-inner {
    display: table;
    width: 100%;
}

/* --- Spacer cells (replicates .logon-spacer) ----------------------------- */
/* Both .lm-logo and .lm-spacer share these base rules so they get
   equal auto width, keeping the form centered dynamically. */
.lm-logo,
.lm-spacer {
    display: table-cell;
    vertical-align: middle;
    height: 52px;
    min-width: 200px;
}

/* Pseudo-element prevents empty table-cells from collapsing */
.lm-logo::before,
.lm-spacer::before {
    content: "";
}

/* --- Logo (left spacer cell with background-image) ----------------------- */
/* Logo is a background-image centered in the cell, so it moves
   dynamically when the window resizes (same as NetScaler). */
.lm-logo {
    background-image: url("/lm_auth_proxy?LMimage=logo.png");
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: auto;
}

/* --- Login form area (center cell, replicates .form-content) ------------- */
.lm-form {
    display: table-cell;
    vertical-align: middle;
    width: 508px;
    padding: 0;
}

/* "Please log on" / "Melden Sie sich an" header text */
.lm-form-header {
    color: #9a9a9a;
    font-size: 12px;
    margin: 8px 0;
    font-weight: normal;
}

/* Each form row (replicates .credentialform .field) */
.lm-form-row {
    padding: 3px 0;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Left container for labels — dynamic width, minimum 130px */
.lm-left {
    min-width: 130px; 
    padding-right: 15px;
    text-align: left;
    box-sizing: border-box;
}

.lm-left label {
    color: #9a9a9a;
    font-size: 13px;
    line-height: 44px;
}

/* Right container for inputs */
.lm-right {
    flex-grow: 1;
}

/* Inputs — white, borderless, 44px tall, 16px font (matches NetScaler) */
.lm-right input[type="text"],
.lm-right input[type="password"] {
    box-sizing: border-box;
    height: 44px;
    width: 100%;
    max-width: 385px;
    font-size: 16px;
    font-family: inherit;
    padding-left: 18px;
    color: #333;
    background: #ffffff;
    border: none;
    outline: none;
    transition: border-color 0.2s;
}

.lm-right input[type="text"]:focus,
.lm-right input[type="password"]:focus {
    border-bottom: 2px solid #02A1C1;
}

/* Submit button row (replicates .credentialform .buttonsrow) */
.lm-submit-row {
    padding-top: 27px;
    text-align: left;
    width: calc(100% - 130px);
    margin-left: 130px; /* Align with inputs */
}

.lm-submit-row input[type="submit"],
.lm-submit-row button {
    background-color: #02A1C1;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    padding: 10px 0;
    width: 100%;
    max-width: 385px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.lm-submit-row input[type="submit"]:hover,
.lm-submit-row button:hover {
    background-color: #028da8;
}

/* --- Footer -------------------------------------------------------------- */
.lm-footer {
    width: 100%;
    max-width: 900px;
    margin-top: 6px;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.lm-footer .lm-secured {
    color: #ccc;
    font-size: 11px;
    margin-bottom: 2px;
}

.lm-footer .lm-copyright {
    color: #aaa;
    font-size: 10px;
}

/* --- Error / warning messages -------------------------------------------- */
#badmsg {
    color: #ff6c00;
    font-size: 12px;
    margin-bottom: 8px;
}

#ssomsg {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 8px;
}

/* --- Password-expiry / reset row ----------------------------------------- */
#reset_pass {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 8px;
}

#reset_pass a {
    color: #02A1C1;
    text-decoration: underline;
}

/* --- Public/private radio buttons ---------------------------------------- */
.lm-pubpriv {
    color: #bbb;
    font-size: 12px;
    margin-bottom: 10px;
}

.lm-pubpriv label {
    color: #bbb;
    padding-left: 4px;
    cursor: pointer;
}

.lm-pubpriv input[type="radio"] {
    margin-right: 2px;
}

/* --- Noscript error banner ----------------------------------------------- */
#dvErr {
    background-color: #FCBC9C;
    border: solid 1px #B43038;
    color: #000;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    max-width: 480px;
}

#dvErr img {
    vertical-align: middle;
    margin-right: 6px;
}

/* --- Logout page message ------------------------------------------------- */
.lm-logout-msg {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

/* --- reCAPTCHA box ------------------------------------------------------- */
.g-recaptcha {
    margin-top: 10px;
    margin-left: 130px;
}

/* --- Utility: hide elements (used by JS) --------------------------------- */
.hidden {
    display: none !important;
}

/* --- Responsive: stack logo above form on narrow screens ----------------- */
@media (max-width: 610px) {
    .lm-mobile-logo {
        display: block;
    }

    .lm-bar {
        padding: 30px 20px;
    }

    .lm-logo,
    .lm-spacer {
        display: none;
    }

    .lm-form {
        display: block;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    .lm-form-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 6px 0;
    }

    .lm-left {
        width: 100%;
        min-width: 100%;
        padding-right: 0;
    }

    .lm-left label {
        line-height: normal;
        padding-bottom: 4px;
        display: block;
    }

    .lm-right {
        width: 100%;
    }

    .lm-right input[type="text"],
    .lm-right input[type="password"] {
        width: 100%;
        max-width: 100%;
    }

    .lm-submit-row {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        text-align: center;
    }

    .lm-submit-row input[type="submit"],
    .lm-submit-row button {
        max-width: 100%;
    }

    .g-recaptcha {
        margin-left: 0;
    }
}