/* ============================================================
   admin-login.css
   Loaded AFTER admin-ui.css, so every var(--ma-*) token, the
   font stack and the base .ma-* components are already in scope.
   This file only adds what the login screen needs: a full-height
   centred shell and the brand block at the top of the card.
   ============================================================ */

.al-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    /* A very soft tint keeps a large empty area from reading as flat grey. */
    background:
        radial-gradient(1100px 520px at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
        var(--ma-bg);
}

.al-card {
    width: 100%;
    max-width: 408px;
    background: var(--ma-card);
    border: 1px solid var(--ma-line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .07);
    overflow: hidden;
}

/* ---------- brand block ---------- */
.al-brand {
    padding: 26px 26px 20px;
    text-align: center;
    border-bottom: 1px solid var(--ma-line-2);
    background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}

.al-mark {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ma-accent);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.5px;
    box-shadow: 0 4px 12px rgba(47, 111, 235, .28);
}

/* The image is decorative: the initials above are the fallback if it is
   missing or slow, and the alt text stays out of the way either way. */
.al-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    display: block;
}

.al-brand h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.2px;
    color: var(--ma-text);
}

.al-brand p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ma-muted);
}

/* ---------- body ---------- */
.al-body {
    padding: 22px 26px 26px;
}

.al-field + .al-field {
    margin-top: 15px;
}

.al-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--ma-muted);
}

/* admin-ui.css sets no box-sizing anywhere, so .ma-in falls back to
   content-box: width:100% describes the CONTENT only, and the padding and
   border are then added on top. The input rendered ~24px wider than its
   container on its own, and with room reserved for the reveal button on the
   right it overflowed by ~86px - sliding out from under the button and
   pushing text past it.

   The reset is scoped to .al-page on purpose. A global
   * { box-sizing: border-box } in admin-ui.css would be the tidy fix, but it
   would reflow every input, button and table on all eight admin pages, and
   that cannot be visually verified from here. */
.al-page,
.al-page *,
.al-page *::before,
.al-page *::after {
    box-sizing: border-box;
}

/* The password field and its reveal button are laid out as a flex row rather
   than an absolutely positioned overlay. The button is a sibling in normal
   flow, so it can never cover the input no matter what the box metrics do. */
.al-pw {
    display: flex;
    align-items: center;
    gap: 8px;
}

.al-pw .ma-in {
    /* min-width:0 lets a flex item shrink below its intrinsic width, which
       stops the input forcing the row wider than the card. */
    flex: 1 1 auto;
    min-width: 0;
}

.al-reveal {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--ma-line);
    border-radius: 5px;
    background: #fff;
    color: var(--ma-muted);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color .12s, border-color .12s;
}

.al-reveal:hover {
    color: var(--ma-accent);
    border-color: var(--ma-accent);
}

.al-reveal:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(47, 111, 235, .2);
}

.al-submit {
    width: 100%;
    height: 40px;
    margin-top: 20px;
}

.al-hint {
    margin: 16px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--ma-muted);
}

/* ---------- error ---------- */
/* Reuses the admin flash colours so a failed login looks the same as
   every other message in the panel. */
.al-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid #f0dcb4;
    border-radius: 6px;
    background: var(--ma-warn-bg);
    color: var(--ma-warn);
    font-size: 13.5px;
    line-height: 1.45;
}

.al-alert::before {
    content: "!";
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--ma-warn);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

/* ---------- foot ---------- */
.al-foot {
    margin-top: 18px;
    font-size: 12px;
    color: var(--ma-muted);
    text-align: center;
}

.al-foot a {
    color: var(--ma-accent);
    text-decoration: none;
}

.al-foot a:hover {
    text-decoration: underline;
}

/* ---------- small screens ---------- */
@media (max-width: 420px) {
    .al-brand {
        padding: 22px 20px 18px;
    }

    .al-body {
        padding: 20px 20px 24px;
    }

    .al-mark {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        font-size: 20px;
    }
}
