/* The auth pages (allauth/layouts/entrance.html and every page on it): the
   logo and the language menu in the page's top corners, one auth card at
   the page's centre, core's ground, card, fields, buttons and notices. */

/* The site's own fonts, as on the dashboard; the system's where a site
   chose none. */
.auth-body {
    margin: 0;
    font-family: var(--font-body), var(--font-family);
}

/* The card alone at the page's centre. The page keeps the bar's room at
   the top and, to stay centred, the same at the bottom: a tall card never
   runs under it. */
.auth-page {
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-block: 6rem;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    padding: 1rem;
}

.auth-bar {
    position: absolute;
    top: 1rem;
    /* On a phone, in line with the card's edge. */
    left: 1rem;
    right: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

/* A logo alone sits at the middle. */
.auth-bar:not(:has(.phx-language-menu)) {
    justify-content: center;
}

@media (min-width: 768px) {
    .auth-page {
        padding-block: 7rem;
    }

    .auth-bar {
        left: 1.5rem;
        right: 1.5rem;
    }
}

.auth-logo-link {
    display: block;
}

/* A box, not a height: a tall logo fills its height, a long wordmark its
   width. */
.auth-logo-img {
    display: block;
    width: auto;
    height: auto;
    max-height: 4rem;
    max-width: 9rem;
    object-fit: contain;
}

@media (min-width: 768px) {
    .auth-logo-img {
        max-height: 4.5rem;
    }
}

/* One column in the card, evenly spaced. */
.auth-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-heading {
    margin: 0;
    font-family: var(--font-heading), var(--font-family);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-align: center;
    color: rgb(var(--color-surface-800));
}

.auth-subtitle {
    max-width: 24rem;
    margin: 0 auto;
    font-size: 0.875rem;
    line-height: 1.625;
    text-align: center;
    color: rgb(var(--color-surface-600));
}

/* A stack by gap, not by margins: the form's hidden inputs (csrf, next)
   take no place in it. --phx-field-gap: the space between fields, which
   fields made of parts (the phone number) keep between their parts too. */
.auth-form {
    --phx-field-gap: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: var(--phx-field-gap);
}

/* One full-width action per row: side by side, the secondary ones read as
   fragments of the primary. */
.auth-actions-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Our links (the forgot-password link), and allauth's, which it writes
   bare inside a sentence. */
.auth-link,
.auth-card a:not([class]) {
    color: rgb(var(--color-primary-600));
    font-weight: 500;
    text-decoration: none;
}

.auth-link:hover,
.auth-card a:not([class]):hover {
    text-decoration: underline;
}

/* A second part of a page (adding an email under the list): a line and
   room above its heading. */
.auth-section {
    margin: 0.5rem 0 0;
    padding-top: 2rem;
    border-top: 1px solid rgb(var(--color-surface-200));
}

/* A choice allauth labels with a value and its tags (an email address,
   Verified, Primary): the value on its line, the tags on the next. */
.auth-choice:has(.phx-tag) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.auth-choice:has(.phx-tag)::after {
    content: "";
    order: 1;
    flex-basis: 100%;
    height: 0;
    margin-top: -0.375rem;
}

.auth-choice > .phx-tag {
    order: 2;
}

/* "or" between two lines: the other ways in. A joining word, the quietest
   text in the card: set as a field's supporting text, one step quieter
   than the subtitle. */
.auth-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgb(var(--color-surface-500));
}

.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    border-top: 1px solid rgb(var(--color-surface-200));
}

@media (prefers-color-scheme: dark) {
    .auth-heading {
        color: rgb(var(--color-surface-200));
    }

    .auth-subtitle,
    .auth-or {
        color: rgb(var(--color-surface-400));
    }

    .auth-link,
    .auth-card a:not([class]) {
        color: rgb(var(--color-primary-400));
    }

    .auth-section,
    .auth-or::before,
    .auth-or::after {
        border-top-color: rgb(var(--color-surface-800));
    }
}
