/* ---------------------------------------------------
    AUTH PAGES (Views/Shared/_AuthLayout.cshtml: Admin/Auth/Login, Admin/Auth/ResetPassword)
    Linemi redesign, canvas "Linemi App Redesign" > Auth-Login.dc.html, Auth-ResetPassword.dc.html.
    Uses the shared --lm-* tokens (Content/redesign/tokens.css).
    The auth layout loads no Bootstrap, so rules are scoped under body.lm-auth only;
    element resets use :where() so any class still beats them (same approach as home.css).
----------------------------------------------------- */

/* region BASE */

:where(.lm-auth) {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--lm-bg);
    color: var(--lm-ink);
    font-family: var(--lm-font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:where(.lm-auth) *,
:where(.lm-auth) *::before,
:where(.lm-auth) *::after {
    box-sizing: border-box;
}

:where(.lm-auth) :where(h1, p, ul) {
    margin: 0;
}

:where(.lm-auth) :where(a) {
    color: var(--lm-blue);
}

    :where(.lm-auth) :where(a):hover {
        color: var(--lm-blue-dark);
    }

.lm-auth :focus-visible {
    outline: 3px solid var(--lm-sky);
    outline-offset: 2px;
}

.lm-auth .lm-link {
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
}

    .lm-auth .lm-link:hover {
        text-decoration: underline;
    }

.lm-auth .lm-skip {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 10;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--lm-navy);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

    .lm-auth .lm-skip:focus {
        top: 12px;
    }

/* endregion */

/* region HEADER (logo + language) */

.lm-auth .lm-auth-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 32px;
}

.lm-auth .lm-auth-logo {
    display: inline-flex;
    align-items: center;
    color: var(--lm-navy);
    border-radius: 8px;
}

    .lm-auth .lm-auth-logo:hover {
        color: var(--lm-navy);
    }

/* Language selector: shared component in langmenu.css, loaded after this file. */

/* endregion */

/* region MAIN + FORM PANEL */

.lm-auth .lm-auth-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px 24px 48px;
}

.lm-auth .lm-auth-panel {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 36px 32px;
    background: #fff;
    border: 1px solid var(--lm-line);
    border-radius: 22px;
    box-shadow: 0 30px 60px -40px rgba(8,24,43,.5);
}

.lm-auth .lm-auth-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--lm-blue-tint);
    color: var(--lm-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lm-auth .lm-auth-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lm-auth .lm-auth-title {
    font-size: 28px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--lm-ink);
}

.lm-auth .lm-auth-lead {
    font-size: 15px;
    color: var(--lm-muted);
}

.lm-auth .lm-auth-alt {
    font-size: 14px;
    color: var(--lm-muted);
    text-align: center;
}

.lm-auth .lm-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 8px;
    font-size: 14px;
    border-radius: 10px;
}

/* endregion */

/* region FIELDS */

.lm-auth .lm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--lm-ink);
}

.lm-auth .lm-input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--lm-input-line);
    border-radius: 12px;
    background: #fff;
    color: var(--lm-ink);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

    .lm-auth .lm-input:focus {
        outline: 3px solid var(--lm-blue-tint);
        border-color: var(--lm-blue);
    }

/* Show/hide password button. Login places it inside the input (region LOGIN). */
.lm-auth .lm-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--lm-subtle);
    cursor: pointer;
}

    .lm-auth .lm-icon-btn:hover {
        color: var(--lm-ink);
    }

    .lm-auth .lm-icon-btn[hidden] {
        display: none;
    }

    .lm-auth .lm-icon-btn .lm-eye-off,
    .lm-auth .lm-icon-btn[aria-pressed="true"] .lm-eye {
        display: none;
    }

    .lm-auth .lm-icon-btn[aria-pressed="true"] .lm-eye-off {
        display: block;
    }

/* MVC ValidationSummary: empty .validation-summary-valid renders nothing. */
.lm-auth .validation-summary-valid {
    display: none;
}

.lm-auth .validation-summary-errors {
    color: var(--lm-danger);
    font-size: 13px;
    font-weight: 500;
}

    .lm-auth .validation-summary-errors ul {
        padding-left: 18px;
    }

/* endregion */

/* region BUTTON */

.lm-auth .lm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}

.lm-auth .lm-btn-primary {
    background: var(--lm-blue);
    color: #fff;
}

    .lm-auth .lm-btn-primary:hover {
        background: var(--lm-blue-dark);
        color: #fff;
    }

.lm-auth .lm-btn-block {
    width: 100%;
    margin-top: 4px;
}

/* endregion */

/* region LOGIN (password, submit, forgot link)
   DOM order is label, input, submit, forgot link, show/hide button, so Tab goes
   password -> submit -> forgot link. The grid only moves them visually: the forgot link
   to the label row, the show/hide button over the right end of the input. */

.lm-auth .lm-login-secret {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "label  forgot"
        "input  input"
        "submit submit";
    column-gap: 12px;
    row-gap: 6px;
}

.lm-auth .lm-login-label {
    grid-area: label;
    align-self: baseline;
    font-size: 14px;
    font-weight: 600;
    color: var(--lm-ink);
}

.lm-auth .lm-login-forgot {
    grid-area: forgot;
    align-self: baseline;
    font-size: 13px;
}

.lm-auth .lm-login-input {
    grid-area: input;
    padding-right: 52px;
}

.lm-auth .lm-login-toggle {
    grid-area: input;
    justify-self: end;
    align-self: center;
    margin-right: 3px;
    position: relative; /* paint above the input it overlaps */
}

/* 6px row gap + 16px = the 22px the panel had between the password field and the button. */
.lm-auth .lm-login-submit {
    grid-area: submit;
    margin-top: 16px;
}

/* endregion */

/* region FOOTER */

.lm-auth .lm-auth-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 20px 32px;
    border-top: 1px solid var(--lm-line);
    font-size: 13px;
    color: var(--lm-subtle);
}

.lm-auth .lm-auth-version {
    font-family: var(--lm-mono);
    font-size: 12px;
}

/* endregion */

/* region REGISTER (wide panel, sections, switch, checkboxes) */

.lm-auth .lm-auth-panel-wide {
    max-width: 640px;
    gap: 28px;
}

.lm-auth .lm-section {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .lm-auth .lm-section + .lm-section {
        padding-top: 28px;
        border-top: 1px solid var(--lm-line);
    }

.lm-auth .lm-section-title {
    float: left;
    width: 100%;
    padding: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lm-blue);
}

.lm-auth .lm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.lm-auth .lm-span2 {
    grid-column: span 2;
}

.lm-auth .lm-inset {
    padding: 18px;
    background: var(--lm-panel);
    border-radius: 18px;
}

    .lm-auth .lm-inset[hidden] {
        display: none;
    }

.lm-auth select.lm-input {
    cursor: pointer;
}

/* Toggle switch: a native checkbox with role="switch". */
.lm-auth .lm-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.lm-auth .lm-switch {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    position: relative;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: var(--lm-input-line);
    cursor: pointer;
    transition: background-color .15s;
}

    .lm-auth .lm-switch::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 20px;
        height: 20px;
        border-radius: 999px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(8,24,43,.25);
        transition: transform .2s;
    }

    .lm-auth .lm-switch:checked {
        background: var(--lm-blue);
    }

        .lm-auth .lm-switch:checked::after {
            transform: translateX(18px);
        }

/* Checkbox row (consents). */
.lm-auth .lm-checkrow {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
}

.lm-auth .lm-check {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--lm-blue);
    cursor: pointer;
}

.lm-auth .field-validation-error {
    color: var(--lm-danger);
    font-size: 13px;
    font-weight: 500;
}

.lm-auth .field-validation-valid {
    display: none;
}

.lm-auth .lm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.lm-auth .lm-btn-light {
    background: #fff;
    color: var(--lm-ink);
    border-color: var(--lm-line-strong);
}

    .lm-auth .lm-btn-light:hover {
        color: var(--lm-ink);
        border-color: var(--lm-blue);
    }

/* endregion */

/* region RESPONSIVE */

@media (max-width: 640px) {
    .lm-auth .lm-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .lm-auth .lm-span2 {
        grid-column: auto;
    }

    .lm-auth .lm-actions {
        flex-direction: column-reverse;
    }

        .lm-auth .lm-actions .lm-btn {
            width: 100%;
        }

    .lm-auth .lm-auth-top {
        padding: 12px 16px;
    }

    .lm-auth .lm-auth-main {
        padding: 16px 16px 32px;
    }

    .lm-auth .lm-auth-panel {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .lm-auth .lm-auth-title {
        font-size: 26px;
    }

    .lm-auth .lm-auth-foot {
        justify-content: center;
        text-align: center;
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lm-auth * {
        transition: none !important;
    }
}

/* endregion */
