/* Sign-in feature parts: what the sign-in, MFA and registration screens need that the design
 * system does not define yet. The frame (logo, card, tenant login colour) is _SignInLayout on
 * Card, Typography, Form row, Button, Alert and Code input, with [data-sw-app="public"] tokens;
 * these pages do not load style-old-bootstrap.css, so nothing here undoes it.
 * Feature parts take the feature's prefix (UI-RULES, Card); promote one when a second screen
 * needs it. */

/* Bootstrap's display utilities are !important, so a hidden row that is also .d-flex (the
 * "Authenticating" and "Loading" lines) would show. [hidden] needs the same weight here. */
.login-page [hidden] {
    display: none !important;
}

/* The locked message takes focus when it replaces the code boxes. It isn't a control, so no
 * focus ring: the move is for keyboard and screen reader position. */
.login-page [tabindex="-1"]:focus {
    outline: none;
}

/* The company's login logo above the card: no taller than the old login page drew it. */
.signin-logo {
    max-height: 5rem;
}

/* Authenticator set-up: the server's QR image, centred. */
.signin-qr {
    display: block;
    width: 9.5rem;
    height: 9.5rem;
    margin: 0 auto;
}

/* Account set-up is a long form, grouped into sections under a rule. Block, not flex: a flex
 * gap would stack on FormControl's margin between fields. This spaces only what FormControl
 * does not - the heading, help and the blocks around fields. */
.signin-section {
    padding-top: var(--sw-space-4);
    border-top: 1px solid var(--sw-border);
}

.signin-section > * + * {
    margin-top: var(--sw-space-3);
}

.signin-section > :first-child {
    margin-top: 0;
}

.signin-section h2,
.signin-section p {
    margin-bottom: 0;
}

/* The set-up key reads in the code font, like the code it produces. */
.signin-key {
    font-family: var(--sw-font-family-code);
}

/* Divisions and territories: a grid of checkboxes. */
.signin-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: var(--sw-space-2) var(--sw-space-4);
}

.signin-checks .form-check-input {
    margin-right: var(--sw-space-2);
}

/* Show / Hide sits inside the right-hand end of the password field. */
.signin-password {
    position: relative;
}

.signin-password .form-control {
    padding-right: 4.5rem;
}

.signin-reveal {
    position: absolute;
    top: 50%;
    right: var(--sw-space-3);
    transform: translateY(-50%);
    font-size: var(--sw-font-size-sm);
}

/* The company's password rule as a checklist that ticks as the person types. */
.signin-rules-box {
    display: flex;
    flex-direction: column;
    gap: var(--sw-space-2);
    padding: var(--sw-space-3);
    background: var(--sw-surface-sunken);
    border-radius: var(--sw-radius-md);
}

.signin-rules {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: var(--sw-space-1) var(--sw-space-3);
    font-size: var(--sw-font-size-sm);
    color: var(--sw-text-secondary);
}

.signin-rules li {
    display: flex;
    align-items: center;
    gap: var(--sw-space-2);
}

.signin-rules li::before {
    content: "";
    flex: none;
    width: 1rem;
    height: 1rem;
    border-radius: var(--sw-radius-pill);
    border: 0.125rem solid var(--sw-border-strong);
}

.signin-rules li.is-met {
    color: var(--sw-success-text);
}

.signin-rules li.is-met::before {
    border-color: var(--sw-success);
    background: var(--sw-success) center / 0.625rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l3 3 5-6' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
}

/* The company's registration terms: a scrolling box above the agree checkbox. */
.signin-terms {
    max-height: 12.5rem;
    overflow-y: auto;
    padding: var(--sw-space-3);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-md);
    background: var(--sw-surface-sunken);
}

/* A centred form inside the centred card: a single checkbox would otherwise drift to the
 * edge, because Form row lets a check's label fill the row. */
.text-center .form-check.justify-content-center > .form-check-label {
    flex: 0 1 auto;
}
