/* ============================================================
   Elioplus Design System - split-screen login layout
   ============================================================

   Used by Components/DsLoginShell.razor (the frame) and ElioplusLoginPage.razor (the
   frame with the password form), and by pages that reuse the same classes for a
   second screen (a register form, say) without going through the component. Those classes are therefore plain global class names, not scoped:
   a consuming page gets them by linking this file, not by importing anything.

   --ds-login-* are this component's own values. They point at the legacy brand
   primitives in foundations/tokens.css (the only place a colour literal lives) and
   are declared here because they describe the login surface, not a role the rest of
   the system shares. An application that wants a different login skin overrides
   them in its own stylesheet, linked after this one.

   MudBlazor's controls inside the form are shaped through MudBlazor's own custom
   property (--mud-default-borderradius) rather than by reaching into its markup or
   forcing the cascade.
   ============================================================ */

:root {
    --ds-login-brand: var(--ds-legacy-blue-600);
    --ds-login-brand-dark: var(--ds-legacy-blue-800);
    --ds-login-bg: var(--ds-legacy-blue-50);
    --ds-login-muted: var(--ds-legacy-steel);
    /* The form's fields and submit button are a touch rounder than the app's 8px. */
    --ds-login-radius: 10px;
}

.login-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--ds-login-bg);
}

/* Left brand panel */
.login-brand {
    flex: 1 1 42%;
    min-width: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 64px;
    color: var(--ds-text-inverse);
    background: linear-gradient(135deg, var(--ds-login-brand) 0%, var(--ds-login-brand-dark) 100%);
}

/* Two faint decorative discs. Tints of white too faint for the --ds-white-a* text
   ladder, so they are mixed from the token rather than written down. */
.login-brand::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ds-white) 7%, transparent);
    pointer-events: none;
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -90px;
    left: -70px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ds-white) 5%, transparent);
    pointer-events: none;
}

.login-brand-logo {
    position: relative;
    z-index: 1;
    font-size: var(--ds-text-20);
    font-weight: var(--ds-weight-bold);
    letter-spacing: 0.02em;
    color: var(--ds-text-inverse);
}

.login-logo {
    position: relative;
    z-index: 1;
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* A customer's own logo (e.g. a vendor's partner portal sign-in): kept in its own colours on a light tile, because it is
 * rarely drawn for a dark background. */
.login-logo--brand {
    height: 56px;
    max-width: 240px;
    padding: 8px 12px;
    background: var(--ds-surface);
    border-radius: var(--ds-radius-md);
    filter: none;
    align-self: flex-start;
}

.login-brand-mid {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-product-name {
    margin: 0 0 20px 0;
    font-size: 0.78rem;
    font-weight: var(--ds-weight-semibold);
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    color: var(--ds-white-a75);
}

.login-heading {
    margin: 0 0 16px 0;
    font-size: 2.5rem;
    line-height: 1.15;
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-inverse);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.login-subtext {
    margin: 0;
    max-width: 380px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ds-white-a90);
}

/* Optional marketing copy in the brand panel (ElioplusLoginPage BrandContent):
   a title followed by check points. */
.login-pitch {
    margin-top: 40px;
}

.login-pitch-title {
    margin: 0 0 24px 0;
    font-size: 1.35rem;
    line-height: 1.35;
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-inverse);
}

.login-pitch-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-pitch-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.login-pitch-icon {
    flex: none;
    margin-top: 2px;
    color: var(--ds-text-inverse);
}

.login-pitch-heading {
    display: block;
    font-size: 1rem;
    font-weight: var(--ds-weight-semibold);
    color: var(--ds-text-inverse);
}

.login-pitch-text {
    display: block;
    margin-top: 2px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ds-white-a90);
}

.login-brand-foot {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    color: var(--ds-white-a75);
}

/* Right form panel */
.login-form-panel {
    flex: 1 1 58%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--ds-surface);
}

/* MudBlazor reads its field outline and button radius from this property, so setting
   it here rounds every control in the form without touching MudBlazor's markup. */
.login-form-wrap {
    width: 100%;
    max-width: 380px;
    --mud-default-borderradius: var(--ds-login-radius);
}

/* A form with fields side by side (a sign-up form). */
.login-form-wrap--wide {
    max-width: 440px;
}

/* The form panel's own heading, for a form with steps (send a code, then enter it): the
   brand panel holds the page's h1, so this is an h2 that says which step this is. */
.login-form-header {
    margin: 0 0 24px 0;
}

/* The product name, for small screens only: below 900px the brand panel is hidden (see the
   end of this file), and this is then the only place the product is named. */
.login-form-brand {
    display: none;
    margin: 0 0 16px 0;
    font-size: var(--ds-text-12);
    font-weight: var(--ds-weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ds-login-brand);
}

.login-form-brand-sub {
    margin-left: 4px;
    font-weight: var(--ds-weight-medium);
    letter-spacing: normal;
    text-transform: none;
    color: var(--ds-login-muted);
}

.login-form-title {
    margin: 0 0 6px 0;
    font-size: var(--ds-text-22);
    font-weight: var(--ds-weight-semibold);
    line-height: var(--ds-leading-tight);
    color: var(--ds-text-primary);
}

.login-form-subtitle {
    margin: 0;
    font-size: var(--ds-text-14);
    line-height: var(--ds-leading-body);
    color: var(--ds-text-secondary);
}

/* MudBlazor's filled-button rules are single classes linked before this file, so these
   win on order. The glow is the brand blue, mixed from its token. */
.login-submit-btn {
    height: 50px;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--ds-login-brand) 18%, transparent);
    transition: transform 0.1s ease, box-shadow 0.18s ease;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--ds-login-brand) 28%, transparent);
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--ds-login-brand) 16%, transparent);
}

/* In-form footer */
.login-footer {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.login-footer-caption {
    font-size: 0.78rem;
    color: var(--ds-login-muted);
}

.login-help-link {
    font-size: 0.78rem;
    font-weight: var(--ds-weight-semibold);
    color: var(--ds-login-brand);
    text-decoration: none;
}

.login-help-link:hover {
    color: var(--ds-login-brand-dark);
    text-decoration: underline;
}

/* Small screens show the form alone. The brand panel holds the page's h1, so it is
   hidden visually rather than with display: none, which would take the heading out of
   the accessibility tree and leave the page without one. */
@media (max-width: 900px) {
    .login-brand {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .login-form-panel {
        flex: 1 1 100%;
    }

    .login-form-brand {
        display: block;
    }
}
