/* ==========================================================================
   Sign-in screen.

   A two-panel layout: the brand side states what the software is, the form side
   does the work. Both mirror automatically under dir="rtl" because the split is
   a flex row and the spacing uses logical properties.
   ========================================================================== */

:root {
    --auth-brand: #0f4c81;
    --auth-brand-deep: #0a3557;
    --auth-brand-ink: #e8f0f7;
    --auth-rule: #e2e8f0;
    --auth-ink: #0f172a;
    --auth-muted: #5b6b7a;
}

html,
body {
    height: 100%;
}

body.auth-body {
    margin: 0;
    background: #eef1f5;
    color: var(--auth-ink);
}

.auth-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

/* ---------------------------------------------------------------- brand side */

.auth-brand {
    flex: 1 1 46%;
    max-width: 34rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 2.75rem 3rem;
    color: var(--auth-brand-ink);
    background:
        /* faint ledger ruling, in keeping with the subject */
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.045) 0,
            rgba(255, 255, 255, 0.045) 1px,
            transparent 1px,
            transparent 2.25rem
        ),
        linear-gradient(160deg, var(--auth-brand) 0%, var(--auth-brand-deep) 100%);
    overflow: hidden;
}

/* A single soft highlight keeps the panel from reading as a flat block. */
.auth-brand::after {
    content: "";
    position: absolute;
    inset-inline-end: -18%;
    top: -12%;
    width: 30rem;
    height: 30rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, transparent 68%);
    pointer-events: none;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

/* The brand panel holds one block of content, vertically centred, with the
   address line pinned to the bottom. */
.auth-brand-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Equal free space above and below, which also pushes the address line to
       the foot of the panel without absolute positioning. */
    margin-block: auto;
}

.auth-logo {
    display: block;
    max-height: 170px;
    max-width: 100%;
    /* A white backing, because most logos are drawn for paper and would lose
       their darker elements against this navy panel. */
    object-fit: contain;
    background: #fff;
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-mark i {
    font-size: 1.6rem;
    opacity: 0.9;
}

.auth-brand h1 {
    font-size: 1.9rem;
    line-height: 1.25;
    font-weight: 600;
    margin: 0 0 0.6rem;
}

.auth-brand .auth-tagline {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0;
    color: rgba(232, 240, 247, 0.82);
    max-width: 26rem;
}

.auth-points {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.875rem;
    color: rgba(232, 240, 247, 0.9);
}

.auth-points i {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    opacity: 0.75;
}

.auth-brand-foot {
    font-size: 0.75rem;
    color: rgba(232, 240, 247, 0.6);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

/* ----------------------------------------------------------------- form side */

.auth-main {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #f7f9fb;
}

.auth-panel {
    width: 100%;
    max-width: 24rem;
}

.auth-panel h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.auth-panel .auth-sub {
    font-size: 0.875rem;
    color: var(--auth-muted);
    margin: 0 0 1.75rem;
}

.auth-form .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}

.auth-form .form-control {
    padding: 0.6rem 0.8rem;
    border-color: #cbd5e1;
    background: #fff;
}

.auth-form .form-control:focus {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 0.18rem rgba(15, 76, 129, 0.14);
}

.auth-form .input-group-text {
    background: #fff;
    border-color: #cbd5e1;
    color: var(--auth-muted);
}

/* Show/hide password sits inside the field's group. */
.auth-reveal {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--auth-muted);
    padding-inline: 0.7rem;
}

.auth-reveal:hover {
    color: var(--auth-brand);
    background: #f1f5f9;
}

.auth-submit {
    width: 100%;
    padding: 0.65rem 1rem;
    font-weight: 600;
    background: var(--auth-brand);
    border-color: var(--auth-brand);
}

.auth-submit:hover,
.auth-submit:focus {
    background: var(--auth-brand-deep);
    border-color: var(--auth-brand-deep);
}

.auth-lang {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-rule);
}

.auth-lang a {
    font-size: 0.8125rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--auth-muted);
}

.auth-lang a:hover {
    background: #eef2f7;
    color: var(--auth-brand);
}

.auth-lang a.is-current {
    background: rgba(15, 76, 129, 0.1);
    color: var(--auth-brand);
    font-weight: 600;
}

/* Seeded logins, shown only outside production. */
.auth-demo {
    margin-top: 1.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.4rem;
    background: #fff;
    padding: 0.8rem 0.9rem;
}

.auth-demo-title {
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--auth-muted);
    margin: 0 0 0.5rem;
}

.auth-demo-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    padding: 0.3rem 0.35rem;
    border-radius: 0.25rem;
    font: inherit;
    font-size: 0.8125rem;
    color: #334155;
    text-align: start;
    cursor: pointer;
}

.auth-demo-row:hover {
    background: #f1f5f9;
}

.auth-demo-row .role {
    flex: 0 0 5.5rem;
    font-weight: 600;
}

.auth-demo-row .who {
    color: var(--auth-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-demo-row .fill {
    margin-inline-start: auto;
    font-size: 0.6875rem;
    color: var(--auth-brand);
    white-space: nowrap;
    opacity: 0;
}

.auth-demo-row:hover .fill,
.auth-demo-row:focus-visible .fill {
    opacity: 1;
}

.auth-demo-note {
    margin: 0.55rem 0 0;
    font-size: 0.6875rem;
    color: var(--auth-muted);
}

/* Urdu ---------------------------------------------------------------------- */

html[lang="ur"] .auth-brand h1,
html[lang="ur"] .auth-brand .auth-tagline,
html[lang="ur"] .auth-points li,
html[lang="ur"] .auth-panel h2,
html[lang="ur"] .auth-panel .auth-sub {
    font-family: 'Jameel Noori Nastaleeq', 'Alvi Nastaleeq', 'Noto Nastaliq Urdu',
        'Urdu Typesetting', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.95;
}

html[lang="ur"] .auth-brand h1 {
    font-size: 1.8rem;
}

/* Email addresses stay left-to-right even in an RTL page. */
.auth-demo-row .who,
input[type="email"] {
    direction: ltr;
}

html[lang="ur"] input[type="email"] {
    text-align: right;
}

/* Small screens ------------------------------------------------------------- */

@media (max-width: 61.99em) {
    .auth-shell {
        flex-direction: column;
    }

    .auth-brand {
        flex: 0 0 auto;
        max-width: none;
        padding: 1.75rem 1.5rem;
        gap: 1.25rem;
    }

    .auth-brand h1 {
        font-size: 1.4rem;
    }

    /* The panel is only a band across the top here, so the logo is scaled back
       to leave room for the sign-in form without scrolling. */
    .auth-logo {
        max-height: 96px;
        margin-bottom: 1rem;
    }

    .auth-points,
    .auth-brand-foot {
        display: none;
    }

    .auth-main {
        padding: 2rem 1.25rem 3rem;
    }
}

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