/* =======================================================================
   Sign-in page.

   Layout only: every colour, size, weight, focus ring and button style
   comes from dashboard.css, so this page is the dashboard's own surface
   rather than a lookalike, and it follows the light/dark theme with it.
   ======================================================================= */

/* dashboard.css lays the app out as a full-height column; this page is a
   single centred card instead. */
body.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding: 24px;
    box-sizing: border-box;
}

.login { width: min(400px, 100%); }

.login-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    animation: login-card-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-theme="light"] .login-card { box-shadow: 0 10px 30px rgba(12, 32, 58, 0.12); }

/* The one authored moment: the card settles in from just below. */
@keyframes login-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.login-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

/* The company mark, drawn on nothing: it carries its own colour, so a tile
   behind it would only box it in. Sized by height so it keeps its ratio on
   both themes. */
.login-logo { height: 40px; width: auto; flex-shrink: 0; }

.login-title {
    margin: 0;
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    color: var(--text-heading);
    line-height: 1.15;
}

.login-label {
    display: block;
    margin: 18px 0 6px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-main);
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    caret-color: var(--accent);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.login-input::placeholder { color: var(--text-sub); }
.login-input:hover { border-color: var(--text-sub); }
.login-input:focus-visible { border-color: var(--accent); }
/* The browser's own "wrong password" styling would fight the palette. */
.login-input:-webkit-autofill { -webkit-text-fill-color: var(--text-main); transition: background-color 9999s; }

.login-hint  { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--text-warn); }
.login-error {
    display: flex; align-items: flex-start; gap: 6px;
    margin: 16px 0 0;
    font-size: var(--fs-sm);
    color: var(--text-danger);
}

.login-submit {
    width: 100%;
    margin-top: 20px;
    padding: 11px 18px;
    font-size: var(--fs-base);
}
.login-submit[aria-busy="true"] { cursor: progress; }
/* The captcha on the two forms that mail (pages._captcha), in the console's colours. */
.login-captcha {
    display: block;
    margin-top: 16px;
    --altcha-max-width: 100%;
    --altcha-color-base: var(--bg-card);
    --altcha-color-base-content: var(--text-main);
    --altcha-border-color: var(--border-color);
    --altcha-color-primary: var(--accent);
}
/* The same button as a link: the page of the old address (pages.moved). */
.login-submit-link { display: block; box-sizing: border-box; text-align: center; text-decoration: none; }


/* On a narrow phone the mark and a 24px title cannot share a line without
   breaking the title in half; give the mark its own line instead. */
@media (max-width: 420px) {
    .login-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .login-card { padding: 24px 20px; }
}

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

/* The pages of the user flows (backend/web/pages.py) and the links under the
   sign-in form: request access, forgot password. */
.login-text  { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--text-main); line-height: 1.5; }
.login-links { margin: 18px 0 0; display: flex; justify-content: space-between; gap: 12px;
               font-size: var(--fs-sm); }
.login-links a { color: var(--accent); text-decoration: none; }
.login-links a:hover, .login-links a:focus-visible { text-decoration: underline; }
.login-card form { margin: 0; }
