/* i.tem brand login. Reproduces the look of the legacy portal (wwwdev.houston-econocom.com) at
   desktop widths, but not its implementation: the legacy page places six absolutely-positioned
   boxes and repeats its 65%/35% split in two places that can drift apart. Here the whole shell is
   one grid, so the columns line up by construction and the mobile tier is a template override
   rather than a set of positioning resets. */

:root {    
    --item-primary: #533EEF;
    --item-dark: #3E0D81;
    --item-accent: #F9D957;
    --item-text: #404040;
    --item-border: #CCCCCC;
    --item-surface: #FFFFFF;
    --item-on-dark: #FFFFFF;
    --item-danger: #B00020;
    --item-overlay: #282828;    
    --form-column: min(35%, 560px);
    --footer-height: 90px;
    --hero-aspect: 1920 / 915;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    display: grid;
    grid-template-columns: 1fr var(--form-column);
    grid-template-rows: minmax(0, 1fr) minmax(var(--footer-height), auto);
    grid-template-areas:
        "hero   form"
        "brand  meta";
    height: 100svh;
    margin: 0;
    font-family: Arial, "Segoe UI", Verdana, Tahoma, Futura, sans-serif;
    font-size: 14px;
    line-height: 1.4286;
    color: var(--item-text);
    background: var(--item-surface);
}

:focus-visible {
    outline: 2px solid var(--item-primary);
    outline-offset: 2px;
}

.login-hero-panel :focus-visible,
.login-brand-bar :focus-visible,
.cookie-banner :focus-visible {
    outline-color: var(--item-on-dark);
}

/* ---- Left branded panel: logo, then a vertically centred carousel band ---- */
.login-hero-panel {
    grid-area: hero;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding-top: var(--cookie-banner-height, 0px);
    background: var(--item-dark);
}

.brand-logo {
    flex: 0 0 auto;
    padding: 30px 24px 10px;
}

.brand-logo img {
    width: 134px;
    height: auto;
}

.login-hero {
    position: relative;
    flex: 0 1 auto;
    margin-block: auto;
    width: 100%;
    max-height: 100%;
    aspect-ratio: var(--hero-aspect);    
    min-height: 0;
}

.slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transition: opacity .6s ease;
}

.slide.is-active {
    opacity: 1;
}

.slide picture,
.slide img {
    display: block;
    width: 100%;
    height: 100%;
}

.slide img {
    object-fit: cover;
}

.slide figcaption {
    position: absolute;
    inset: 0 15% 20px;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--item-on-dark);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}

.slide figcaption h2 {
    margin: 0;
    font-size: clamp(1.75rem, 3.4vw, 2.6875rem);
    font-weight: 700;
    line-height: 1.2;
    text-transform: lowercase;
}

.slide figcaption p {
    margin: .75rem 0 0;
    font-size: 1rem;
}

.hero-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.25rem;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: .375rem;
}

/* aria-current is the single source of truth for which dot is active — the JS sets it, the CSS
   reads it, so the visual and the accessible state cannot disagree. */
.hero-dot {
    position: relative;
    width: 10px;
    height: 10px;
    padding: 0;
    border: 1px solid var(--item-on-dark);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.hero-dot[aria-current="true"] {
    background: var(--item-on-dark);
}

/* Keeps the dot 10px while giving the pointer a ~32px target. */
.hero-dot::after {
    content: "";
    position: absolute;
    inset: -11px;
}

/* ---- Right form panel ---- */
.login-form-panel {
    grid-area: form;
    min-width: 0;
    padding: calc(55px + var(--cookie-banner-height, 0px)) 30px 55px;
    overflow-y: auto;
    background: var(--item-surface);
}

.login-form-panel h1 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
}

.login-hint {
    margin: 0 0 20px;
}

label {
    display: block;
    margin: 12px 0 5px;
    font-weight: 700;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 6px 12px;
    font: inherit;
    color: var(--item-text);
    background: var(--item-surface);
    border: 1px solid var(--item-border);
    border-radius: 4px;
}

input:focus-visible {
    border-color: var(--item-primary);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--item-primary);
}

.checkbox-row label {
    margin: 0;
    font-weight: 400;
}

/* The primary action. Shared by real submit buttons and by .button-primary, which is for links
   that end a flow (the MFA "Continue") — those navigate rather than submit, so they must stay an
   <a> and only borrow the look.
   min-width, not the legacy fixed 100px: "Passwort festlegen" has to fit too. */
.login-form-panel button[type="submit"],
.login-form-panel .button-primary {
    display: inline-block;
    min-width: 100px;
    margin-top: 20px;
    padding: 6px 12px;
    font: inherit;
    text-align: center;
    text-decoration: none;
    color: var(--item-on-dark);
    background: var(--item-primary);
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
}

.login-form-panel button[type="submit"]:hover,
.login-form-panel .button-primary:hover {
    background: var(--item-dark);
}

a {
    color: var(--item-primary);
}

.error {
    margin-top: 12px;
    color: var(--item-danger);
}

.field-error {
    display: block;
    margin-top: .35rem;
    font-weight: 600;
    color: var(--item-danger);
}

/* ---- MFA enrolment (MfaSetup.cshtml) ---- */
/* Centred and capped rather than full-width: the PNG is generated at 8px per module (~390px), so
   240px still downscales cleanly, and a QR much larger than this is no easier to scan. */
.mfa-qr {
    display: block;
    width: min(100%, 240px);
    height: auto;
    margin: 0 auto 16px;
    padding: 8px;
    background: var(--item-surface);
    border: 1px solid var(--item-border);
}

/* The secret and its copy button share one row; the code takes the slack. */
.mfa-secret {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 0 16px;
}

.mfa-secret code {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    padding: 6px 10px;
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 13px;
    letter-spacing: .08em;
    word-break: break-all;
    background: #F4F4F6;
    border: 1px solid var(--item-border);
}

.copy-button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    padding: 0;
    color: var(--item-primary);
    background: var(--item-surface);
    border: 1px solid var(--item-border);
    border-radius: 0;
    cursor: pointer;
}

.copy-button:hover {
    background: #F4F4F6;
}

.copy-button svg {
    display: block;
    width: 18px;
    height: 18px;
}

.copy-button .icon-copied,
.copy-button.is-copied .icon-copy {
    display: none;
}

.copy-button.is-copied {
    color: #1B7F3B;
    border-color: #1B7F3B;
}

.copy-button.is-copied .icon-copied {
    display: block;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
    margin: 0 0 20px;
    padding: 12px;
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    list-style: none;
    background: #F4F4F6;
    border: 1px solid var(--item-border);
}


.login-brand-bar {
    grid-area: brand;
    display: grid;
    place-items: center;
    padding: 4px 16px;
    background: var(--item-dark);
}


.login-brand-bar picture {
    display: block;
    width: min(25%, 320px);
}

.login-brand-bar img {
    display: block;
    width: 90%;
    height: auto;
}

.login-meta-bar {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--item-surface);
}

.lang-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.lang-bar button {
    flex: 1 1 0;
    min-width: 0;
    padding: 3px 6px;
    font: inherit;
    color: var(--item-dark);
    background: var(--item-accent);
    border: 2px solid var(--item-accent);
    border-radius: 0;
    cursor: pointer;
}

.lang-bar button:hover {
    filter: brightness(0.95);
}


.lang-bar button[aria-current="true"] {
    border-color: var(--item-dark);
    font-weight: 700;
    cursor: default;
}

.copyright {
    /*margin: 0;*/
    font-size: 10px;
    text-align: center;
}

/* ---- Cookie banner ---- */
/* A fixed overlay, so it never adds to the document height (as a grid row it pushed the page past
   100svh and produced a scrollbar). The panels behind it reserve its measured height instead —
   see --cookie-banner-height on .login-hero-panel. */
.cookie-banner {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 15px 1.5rem;
    text-align: center;
    color: var(--item-on-dark);
    background: var(--item-overlay);
}

.cookie-button {
    min-width: 100px;
    padding: 5px 10px;
    font: inherit;
    color: var(--item-on-dark);
    background: var(--item-primary);
    border: 0;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
}

.cookie-button:hover {
    background: var(--item-dark);
}

@media (max-width: 1199px) {
    :root {
        --form-column: max(35%, 380px);
    }
}

@media (max-width: 899px) {
    body {
        grid-template-columns: 1fr;        
        grid-template-rows: auto auto 1fr auto auto;
        grid-template-areas:
            "hero"
            "form"
            "lang"
            "brand"
            "copy";       
        height: auto;
        min-height: 100svh;
        background: var(--item-dark);
    }
    
    .login-meta-bar {
        display: contents;
    }
    
    .login-hero-panel {
        background: none;
    }

    .login-hero {
        display: none;
    }

    .brand-logo {
        padding: 25px 30px 0;
    }

    .brand-logo img {
        width: 149px;
    }

    /* The form becomes a card floating on the purple page. */
    .login-form-panel {
        margin: 15px 30px 20px;
        padding: 16px;
        overflow-y: visible;
        border: 1px solid #DDDDDD;
        box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
    }

    .lang-bar {
        grid-area: lang;
        align-self: start;
        padding: 0 30px;
    }
    
    .lang-bar button {
        flex: 0 0 auto;
        min-width: 65px;
        min-height: 44px;
    }

    .login-brand-bar {
        justify-items: start;
        padding: 24px 30px 0;
        background: none;
    }
    
    .login-brand-bar picture {
        width: min(80%, 251px);
    }

    .copyright {
        grid-area: copy;
        padding: 8px 30px 24px;
        color: var(--item-on-dark);
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slide {
        transition: none;
    }
}
