/* Forms, with the values of docs/maquettes/ajout-v2.html, and the account pages. */
.lbl {
    display: block;
    font-size: 0.78125rem;
    font-weight: 600;
    margin: 14px 0 6px;
}

/* "facultatif", after the label of an optional field. */
.lbl .opt {
    font-weight: 400;
    color: var(--muted);
}

.hint {
    font-size: 0.78125rem;
    color: var(--muted);
    margin-top: 6px;
}

.center {
    text-align: center;
}

.f {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--paper);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}

/*
 * Every field at 1rem, 16 px by default, rather than the 14 px of the mockups (decision 2 of
 * plan 09): under 16 px, Safari on iPhone zooms in on the field touched. After .f, whose
 * "font: inherit" would bring back the size of the text around it.
 */
.f,
input,
select,
textarea {
    font-size: 1rem;
}

.f::placeholder {
    color: var(--placeholder);
}

/* An empty date field keeps the height of the others (iOS Safari shrinks it). */
.f[type="date"] {
    min-height: 44px;
}

/*
 * Shown after 1.5 s by CSS alone (ruling P12): the « Me connecter » button of the login link page,
 * for a browser without JavaScript or whose modules do not load. Before that, a tap could send the
 * link once more, as the page submits itself. With JavaScript, auto-submit takes the class off and
 * decides. A step of visibility, not a motion: prefers-reduced-motion has nothing to change here.
 */
.appears-later {
    visibility: hidden;
    animation: appears-later 0s 1.5s forwards;
}

@keyframes appears-later {
    to {
        visibility: visible;
    }
}

/* No "display" here: the hidden attribute must keep hiding a button. */
.btn {
    width: 100%;
    font: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 13px;
    border-radius: 14px;
    border: 0;
    background: var(--accent);
    color: var(--paper);
    cursor: pointer;
}

/* A link that looks like the button: centred text, no underline. */
a.btn {
    display: block;
    text-align: center;
    text-decoration: none;
}

.btn.ghost {
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--line);
}

/* What cannot be undone: « Supprimer mon compte ». */
.btn.danger {
    background: var(--paper);
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

/* « Annuler » under a form: back, nothing done (« Supprimer mon compte »). */
p.cancel {
    text-align: center;
    font-size: 0.875rem;
}

p.cancel a {
    color: var(--muted);
    text-underline-offset: 3px;
}

p.cancel a:hover,
p.cancel a:focus-visible {
    color: var(--ink);
}

/* The passkey under the login form (plan 10): « ou », the button, its hint, in one block shown on a
 * device that has used a passkey (ruling C-pk). No "display" on what the hidden attribute toggles
 * (that block, the message). */
.passkey-login {
    margin-top: 1.25rem;
}

.passkey-login .or {
    margin: 0 0 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
}

.passkey-login .hint {
    text-align: center;
}

.passkey-login .flash {
    margin-top: 0.75rem;
}

/* The « Recevoir un code » form, under the message, when the add window closed while the page was
 * open. */
.passkey-register .passkey-code-link {
    margin: 0.5rem 0 0;
}

/* « Connexion rapide » (plan 10, task 7, passkeys.html.twig): under « Tes appareils », a card per
 * passkey, its name and the badge « Synchronisé », its dates, its name's field and « Renommer » on
 * one row, then « Retirer »; under the cards, what creates one. No "display" on what the hidden
 * attribute toggles (the button, the code's step, the hints, the message, the code's link: ruling
 * P19). */
.passkeys {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
}

.block-title + .passkeys {
    margin-top: 12px;
}

.passkeys > li + li {
    margin-top: 12px;
}

.passkey-card h3 {
    font: 650 1.0625rem/1.25 var(--display);
    margin: 0;
    overflow-wrap: anywhere;
}

.passkey-card .tag {
    margin: 0.375rem 0 0;
}

.passkey-dates span {
    display: block;
}

.passkey-rename-row {
    display: flex;
    gap: 8px;
}

.passkey-rename-row .f {
    flex: 1;
    min-width: 0;
}

.card .passkey-rename-row .btn {
    flex: none;
    width: auto;
    margin-top: 0;
    padding: 10px 16px;
}

.passkey-create .flash {
    margin-top: 0.75rem;
}

.passkey-create form + form {
    margin-top: 12px;
}

.passkey-limit {
    margin: 0;
}

.passkey-sessions a {
    color: var(--ink);
    text-underline-offset: 3px;
}

/* A column for one form: login, code. */
.narrow {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.narrow > form,
.narrow > .flash,
.narrow > p {
    margin-top: 20px;
}

/* « Bienvenue »: the discreet way out under the card, its button read as a link (.linklike). */
.narrow > .onboarding-logout {
    margin-top: 32px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
}

.card {
    background: var(--paper);
    border: 1.5px solid var(--line);
    border-radius: 18px;
    padding: 16px;
}

.card > :first-child {
    margin-top: 0;
}

.card .btn {
    margin-top: 16px;
}

.flash {
    border-radius: 12px;
    padding: 10px 12px;
}

.flash.error {
    background: var(--accent-soft);
}

.flash.ok {
    background: var(--ok-soft);
}

/* Something to know before going on: a link shown only once. */
.flash.warning {
    background: var(--gold-soft);
    color: var(--gold-ink);
}

.field-error {
    font-size: 0.78125rem;
    color: var(--accent);
    margin: 6px 0 0;
}

/* The honeypot: off screen for people, still in the page for robots. */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.code-input {
    font-size: 1.5rem;
    letter-spacing: .3em;
    text-align: center;
}
