/* The auth pages link vars.css and fonts.css before this sheet: the very same
   tokens and faces as the app, so `html[data-theme="dark"]` repaints these pages
   too and they never depend on a remote font host. Declared as <link> rather
   than @import because an import is only discovered once THIS sheet has been
   parsed -- one serial round trip that left the page untouched by any style. */

/* See static/css/layout.css: a control does not inherit the page font unless it
   is told to, and the auth pages carry the first three controls anyone touches. */
button, input, select, textarea {
    font-family: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--lato);
    background-color: var(--bg-color);
    /* The default ink is the interface's, as in the app's body: without it the page
       falls back to the user agent's black, which `color-scheme` turns white in the
       dark theme -- a token of nothing, and a colour no other page carries. */
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: var(--panel-color);
    padding: 2.5rem;
    border-radius: var(--radius-surface);
    box-shadow: var(--shadow-auth);
    width: 100%;
    max-width: 400px;
}

/* The auth pages load their own sheets, not the app's: a `.brand-mark` rule in
   chat.css would never reach them. Scoping it to `.login-container` keeps this
   one on the auth surface, where the sheet is loaded. */
.login-container .brand-mark {
    width: 60px;
    height: 60px;
    display: block;
    margin: 0 auto 1.25rem;
}

h1 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-align: center;
    letter-spacing: -0.03em;
    font-size: 1.9rem;
}

/* The wordmark: the display face, as in the app's left panel. The h1's own tracking
   is tuned for the body face, so it is reset here rather than removed from the shared
   rule the password page also uses. */
.login-container .brand-name {
    font-family: var(--montserrat);
    font-weight: 400;
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: normal;
}

p {
    margin-bottom: 2rem;
    color: var(--text-dim);
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-control);
    box-sizing: border-box;
    color: var(--text-color);
    font: inherit;
    /* The border is what marks a field, so the border is what fades in. */
    transition: border-color 0.18s ease;
}

/* The identifier on the activation page: displayed for information, never
   edited (the invitation token decides which account is activated), so it
   reads as an inert value rather than a field. */
.form-group input[readonly] {
    background: var(--bg-color);
    color: var(--text-dim);
    cursor: default;
}

/* The field's focus mark is the interface's, ported rather than invented: the engine's
   ring goes -- it is drawn in the platform's blue, a colour of another palette -- and the
   border turns to the charte's accent. A checkbox has no border to recolour and keeps its
   ring, and the activation page's readonly value marks nothing: it is not a field. */
.form-group input:not([type="checkbox"], [readonly]):focus {
    outline: none;
    border-color: var(--accent-color);
}

/* And the controls answer the keyboard with the charte's ring, as in the app. */
button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.password-hint {
    margin-top: 0.5rem;
    margin-bottom: 0;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-dim);
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--accent-color);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-control);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
}

button:hover {
    background-color: var(--accent-hover);
}

.login-links {
    margin-top: 1.25rem;
    text-align: center;
}

.login-links a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-links a:hover {
    text-decoration: underline;
}

.error {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-surface);
    margin-bottom: 1rem;
    text-align: center;
}

/* The six-digit code is read in a mail and retyped here, so the digits are
   spaced and centred instead of set like an identifier. */
.code-field input {
    text-align: center;
    letter-spacing: 0.4em;
    font-size: 1.4rem;
    font-variant-numeric: tabular-nums;
}

/* The "stay signed in on this location" box: the field rule would stretch the
   box itself, so it keeps its own size and its label sits beside it. */
.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox input {
    width: auto;
    padding: 0;
    margin: 0;
    accent-color: var(--accent-color);
}

.form-group.checkbox label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Asking for another code is not the page's main gesture: it reads as a
   quieter button than "Valider", without becoming a second form. */
button.secondary {
    margin-top: 0.75rem;
    background: none;
    color: var(--link-color);
    font-weight: 400;
}

button.secondary:hover {
    background: none;
    text-decoration: underline;
}

/* The CGU screen's refusal is a real button on its own full-width line, not a
   link: it is a decision of equal weight to the acceptance above it, so it
   keeps the button's box and only swaps the paint. It is the one danger
   expression, filled (`.btn-danger`'s rule): a destructive decision never reads
   as a neutral one that happens to have red text. */
.cgu-refuse-form {
    margin-top: 0.75rem;
}

button.cgu-refuse {
    background-color: var(--error-color);
    color: var(--on-accent);
}

button.cgu-refuse:hover {
    background-color: var(--error-hover);
}

.success {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-surface);
    margin-bottom: 1rem;
    text-align: center;
}
