/* Theme tokens only, so the page follows the shell's light and dark themes. */

.public-shell {
    display: grid;
    grid-template-columns: minmax(280px, 5fr) 7fr;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-page, var(--bg-surface-primary));
    color: var(--text-paragraph);
    font-family: var(--font-family);
}

.public-shell__brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--spacing-10);
    /* Set by PublicShell, so the image comes from this app's origin even when federated. */
    background: var(--public-shell-brand-image) no-repeat center center / cover;
    color: #fff;
}

.public-shell__logo {
    height: 40px;
    width: auto;
    align-self: flex-start;
    /* The same treatment the sidebar gives the logo on this background. */
    filter: brightness(0) invert(1);
}

.public-shell__tagline {
    margin: 0;
    max-width: 18ch;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
}

.public-shell__content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-10) var(--spacing-6);
}

.accept-invite {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
    width: 100%;
    max-width: 480px;
}

.accept-invite--status {
    gap: var(--spacing-4);
}

.accept-invite--status > button {
    align-self: flex-start;
}

.accept-invite__header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.accept-invite__title {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    color: var(--text-title);
}

.accept-invite__description {
    margin: 0;
    font-size: var(--font-size-m);
    color: var(--text-paragraph);
}

/* The same card the user details page shows: a card body trims its top and bottom padding
   to sit under a header, and this card is all body, so it is evened out all round. */
.accept-invite .card__body {
    padding-top: var(--spacing-4);
    padding-bottom: var(--spacing-4);
}

/* Two fields to a row, as on the user details page, and anything that would sit alone on
   a row spans it rather than leaving half of it empty. */
.accept-invite__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    overflow-wrap: anywhere;
}

.accept-invite__wide {
    grid-column: 1 / -1;
}

.accept-invite__form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
}

.accept-invite__form > button {
    width: 100%;
}

.accept-invite__loading {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    width: 100%;
    max-width: 480px;
}

.accept-invite__loading p {
    margin: 0;
    color: var(--text-paragraph);
}

/* The shell's status loading bar. */
.accept-invite__loading-track {
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-secondary);
    overflow: hidden;
}

.accept-invite__loading-fill {
    width: 25%;
    height: 100%;
    border-radius: var(--radius-full);
    background-color: var(--color-fire);
    animation: accept-invite-loading 1.2s ease-in-out infinite;
}

@keyframes accept-invite-loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

@media (max-width: 800px) {
    .public-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .public-shell__brand {
        flex-direction: row;
        align-items: center;
        padding: var(--spacing-5) var(--spacing-4);
    }

    .public-shell__logo {
        height: 28px;
    }

    .public-shell__tagline {
        display: none;
    }

    .public-shell__content {
        align-items: flex-start;
        padding: var(--spacing-8) var(--spacing-4);
    }

    .accept-invite__details {
        grid-template-columns: 1fr;
    }
}

/* The portal reset screen's requirements list. Colours are the design system's own error
   and success accents, which the theme has no tokens for. */
.password-requirements {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    margin-top: calc(-1 * var(--spacing-3));
    font-size: var(--font-size-xs);
    color: var(--text-paragraph);
}

.password-requirements__title {
    margin: 0;
    font-weight: var(--font-weight-semibold);
}

.password-requirements__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.password-requirements__rule {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.password-requirements__rule svg {
    flex-shrink: 0;
}

.password-requirements__rule--unmet svg {
    color: #c62828;
}

.password-requirements__rule--met svg {
    color: #2e7d32;
}
