/*
 * Login.aspx and Common/LoginChangePassword.aspx - the sign-in pages in the new look (FleetIncludeControl:
 * Bootstrap 5, FleetShell.css tokens). Styled after www.e-arc.com: a white header with the ARC logo, ARC red
 * (#da291c) for actions, rounded pill buttons. Below the header, a light "about" section with a faint pattern of
 * ARC arcs (left) and the sign-in card (right). Below 900px only the card shows.
 */
html, body {
    height: 100%;
}

body.fl-login {
    --fl-accent: #da291c;               /* ARC red, as on e-arc.com */
    --fl-accent-hover: #b81f14;
    --fl-accent-rgb: 218, 41, 28;
    --fl-ink: #1f2328;
    --fl-line: #eaeaea;
    margin: 0;
    background: #ffffff;
    color: var(--fa-text);
    font-size: 14px;
}

/* Light grey with a faint dot grid and a few thin red arcs echoing the ARC logo's swoosh, across the whole page
   below the white header */
.fl-page {
    --fl-top: clamp(28px, 7vh, 80px);  /* where the about text and the sign-in card start */
    --fl-card-pad: 36px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    background-color: #f7f7f8;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='700' viewBox='0 0 900 700' fill='none'%3E%3Cg stroke='%23da291c' stroke-width='1.5'%3E%3Cpath d='M-40 690 C 180 420 470 300 940 270' stroke-opacity='.11'/%3E%3Cpath d='M-40 730 C 200 470 500 360 940 340' stroke-opacity='.08'/%3E%3Cpath d='M-40 770 C 220 520 530 420 940 410' stroke-opacity='.05'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(rgba(31, 35, 40, 0.09) 1px, transparent 1.4px);
    background-repeat: no-repeat, repeat;
    background-position: left bottom, 0 0;
    background-size: 100% auto, 22px 22px;
}

/* ---------------- Header (e-arc.com style) ---------------- */
.fl-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 72px;
    padding: 0 clamp(16px, 4vw, 48px);
    background: #ffffff;
    border-bottom: 1px solid var(--fl-line);
}

.fl-header-brand {
    display: flex;
    align-items: center;
}

    .fl-header-brand img {
        display: block;
        height: 34px;
        width: auto;
    }

.fl-header-divider {
    width: 1px;
    height: 30px;
    background: var(--fl-line);
}

.fl-header-product {
    display: block;
    height: 30px;
    width: auto;
}

.fl-header-links {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}

    .fl-header-links a {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        text-decoration: none;
        font-size: 14px;
    }

.fl-header-help {
    color: #5a5a5a;
}

    .fl-header-help:hover {
        color: var(--fl-ink);
    }

/* Outlined red pill, like "Locations" on e-arc.com */
.fl-pill {
    padding: 7px 16px;
    border: 1px solid var(--fl-accent);
    border-radius: 999px;
    color: var(--fl-accent);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

    .fl-pill:hover {
        background: var(--fl-accent);
        color: #ffffff;
    }

/* ---------------- About section (left) ---------------- */
.fl-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    /* the label lines up with the card's greeting */
    padding: calc(var(--fl-top) + var(--fl-card-pad)) clamp(32px, 6vw, 88px) 40px;
}

.fl-brand-inner {
    position: relative;
    max-width: 480px;
}

.fl-brand-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fl-accent);
}

    .fl-brand-kicker::before {
        content: "";
        width: 22px;
        height: 2px;
        border-radius: 2px;
        background: var(--fl-accent);
    }

.fl-brand-title {
    margin: 14px 0 12px;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--fl-ink);
}

    .fl-brand-title span {
        color: var(--fl-accent);
    }

.fl-brand-text {
    margin: 0 0 30px;
    max-width: 420px;
    font-size: 15px;
    line-height: 1.6;
    color: #5a5a5a;
}

.fl-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

    .fl-points li {
        display: flex;
        gap: 14px;
        align-items: flex-start;
    }

        .fl-points li > i {
            flex: 0 0 38px;
            height: 38px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            font-size: 17px;
            color: var(--fl-accent);
            background: #ffffff;
            border: 1px solid var(--fl-line);
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
        }

        .fl-points li strong {
            display: block;
            font-size: 14px;
            color: var(--fl-ink);
        }

        .fl-points li span {
            font-size: 13px;
            color: #6a6a6a;
        }

/* ---------------- Sign-in panel ---------------- */
.fl-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--fl-top) 24px 20px;
}

/* The sign-in form in its own white box, so it stands out from the background */
.fl-card {
    width: 100%;
    max-width: calc(380px + 2 * var(--fl-card-pad));
    padding: var(--fl-card-pad);
    background: #ffffff;
    border: 1px solid var(--fl-line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 40px rgba(15, 23, 42, 0.08);
    animation: fl-rise 0.5s ease-out both;
}

@keyframes fl-rise {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.fl-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fa-text);
}

.fl-subtitle {
    margin: 0 0 22px;
    color: var(--fa-text-muted);
}

/* Message from the server (login failed, account locked, ...) - hidden while empty */
.fl-alert {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: var(--fa-danger-soft);
    color: #7f1d1d;
    font-size: 13px;
    line-height: 1.45;
}

    .fl-alert:empty {
        display: none;
    }

    .fl-alert::before {
        content: "\F332";               /* bi-exclamation-circle-fill */
        font-family: "bootstrap-icons";
        color: var(--fa-danger);
        font-size: 15px;
        line-height: 1.3;
    }

/* Corp user / Fleet user - the two radio buttons as one segmented control */
.fl-segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    margin-bottom: 20px;
    border-radius: 9px;
    background: var(--fa-slate-100);
    border: 1px solid var(--fa-border);
}

    .fl-segment input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .fl-segment label {
        margin: 0;
        padding: 7px 10px;
        border-radius: 7px;
        text-align: center;
        font-weight: 600;
        font-size: 13px;
        color: var(--fa-text-muted);
        cursor: pointer;
        transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    }

    .fl-segment input:checked + label {
        background: var(--fa-surface);
        color: var(--fl-accent);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    }

    .fl-segment input:focus-visible + label {
        outline: 2px solid var(--fl-accent);
        outline-offset: 1px;
    }

.fl-label {
    display: block;
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fa-text);
}

.fl-field {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

    .fl-field > i {
        position: absolute;
        left: 13px;
        font-size: 16px;
        color: var(--fa-text-muted);
        pointer-events: none;
    }

    .fl-field input,
    .fl-field select {
        width: 100%;
        height: 44px;
        padding: 0 44px 0 40px;
        border: 1px solid var(--fa-border);
        border-radius: 9px;
        background: var(--fa-surface);
        color: var(--fa-text);
        font-size: 14px;
        transition: border-color 0.15s, box-shadow 0.15s;
    }

        .fl-field input:focus,
        .fl-field select:focus {
            outline: none;
            border-color: var(--fl-ink);    /* neutral, so a focused field never looks like an error */
            box-shadow: 0 0 0 3px rgba(31, 35, 40, 0.1);
        }

    .fl-field:focus-within > i {
        color: var(--fl-ink);
    }

.fl-field-btn {
    position: absolute;
    right: 6px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--fa-text-muted);
    font-size: 16px;
}

    .fl-field-btn:hover {
        background: var(--fa-slate-100);
        color: var(--fa-text);
    }

.fl-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -10px 0 14px;
    font-size: 12px;
    color: var(--fa-warning);
}

    .fl-hint[hidden] {
        display: none;
    }

/* Keep me signed in - the check box drawn as a switch */
.fl-keep {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 4px 0 22px;
    cursor: pointer;
}

    .fl-keep input[type=checkbox] {
        -webkit-appearance: none;
        appearance: none;
        flex: 0 0 36px;
        width: 36px;
        height: 20px;
        margin: 1px 0 0;
        border-radius: 999px;
        background: var(--fa-slate-300);
        position: relative;
        cursor: pointer;
        transition: background 0.18s;
    }

        .fl-keep input[type=checkbox]::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #ffffff;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
            transition: transform 0.18s;
        }

        .fl-keep input[type=checkbox]:checked {
            background: var(--fl-accent);
        }

            .fl-keep input[type=checkbox]:checked::after {
                transform: translateX(16px);
            }

        .fl-keep input[type=checkbox]:focus-visible {
            outline: 2px solid var(--fl-accent);
            outline-offset: 2px;
        }

    .fl-keep strong {
        display: block;
        font-size: 13px;
        font-weight: 600;
    }

    .fl-keep small {
        font-size: 12px;
        color: var(--fa-text-muted);
    }

.fl-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 999px;             /* pill, like "Get Started" on e-arc.com */
    background: var(--fl-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(var(--fl-accent-rgb), 0.3);
    transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

    .fl-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(var(--fl-accent-rgb), 0.34);
        background: var(--fl-accent-hover);
    }

    .fl-submit:focus-visible {
        outline: 3px solid rgba(var(--fl-accent-rgb), 0.35);
        outline-offset: 2px;
    }

    .fl-submit i {
        transition: transform 0.15s;
    }

    .fl-submit:hover i {
        transform: translateX(3px);
    }

    .fl-submit .spinner-border {
        display: none;
    }

    .fl-submit.busy {
        pointer-events: none;
        filter: saturate(0.8);
    }

        .fl-submit.busy .bi,
        .fl-submit.busy .fl-submit-text {
            display: none;
        }

        .fl-submit.busy .spinner-border {
            display: inline-block;
        }

.fl-links {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    font-size: 13px;
}

    .fl-links a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        text-decoration: none;
        font-weight: 500;
        color: var(--fl-accent);
    }

        .fl-links a:hover {
            text-decoration: underline;
        }

.fl-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin-top: auto;
    padding-top: 28px;
    font-size: 12px;
    color: var(--fa-text-muted);
}

    .fl-footer a {
        color: #5a5a5a;
    }

/* Several messages (change password: every rule not met) - one per line */
.fl-alert {
    white-space: pre-line;
}

/* ---------------- Change password (Common/LoginChangePassword.aspx) ---------------- */
/* The password rules, ticked as they are met (LoginChangePassword.js) */
.fl-rules {
    list-style: none;
    margin: -6px 0 18px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 14px;
    border-radius: 9px;
    background: var(--fa-slate-50);
    border: 1px solid var(--fa-border);
    font-size: 12px;
    color: var(--fa-text-muted);
}

    .fl-rules li {
        display: flex;
        gap: 6px;
        align-items: flex-start;
        line-height: 1.35;
    }

        .fl-rules li::before {
            content: "\F28A";           /* bi-circle */
            font-family: "bootstrap-icons";
            font-size: 11px;
            line-height: 1.6;
            color: var(--fa-slate-300);
        }

        .fl-rules li[data-rule="special"],
        .fl-rules li[data-rule="name"] {
            grid-column: 1 / -1;
        }

        .fl-rules li.ok {
            color: var(--fa-success);
        }

            .fl-rules li.ok::before {
                content: "\F26A";       /* bi-check-circle-fill */
                color: var(--fa-success);
            }

        .fl-rules li.todo {
            color: var(--fa-text);
        }

.fl-hint-match {
    color: var(--fa-danger);
}

    .fl-hint-match.ok {
        color: var(--fa-success);
    }

/* Forgot password dialog fields */
.fl-dialog-field {
    margin-bottom: 12px;
}

    .fl-dialog-field label {
        display: block;
        margin-bottom: 4px;
        font-weight: 600;
        font-size: 12.5px;
    }

/* ---------------- Smaller screens ---------------- */
@media (max-width: 900px) {
    .fl-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .fl-brand {
        display: none;
    }

    .fl-panel {
        padding: 28px 16px 16px;
    }

    .fl-footer {
        overflow-wrap: anywhere;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .fl-page {
        --fl-card-pad: 22px;
    }

    .fl-header {
        height: 60px;
        gap: 12px;
    }

        .fl-header-brand img {
            height: 28px;
        }

    .fl-header-product {
        height: 24px;
    }

    .fl-header-help span,
    .fl-header-divider {
        display: none;
    }

    .fl-pill {
        padding: 6px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fl-card {
        animation: none;
    }
}
