A5: sign up, sign in, sign out, profile and the base layout (WEB-02, WEB-06, WEB-11, WEB-50..54)
Registration (case-insensitive unique names, 8-256 char passwords, no email), sign-in with a generic error and a fresh session, internal-only ?next=, POST-only sign-out, password change that closes the other sessions. The failed-login backoff, the registration quota and the password-change guard live in the database so every web process shares them; the client IP is the last X-Forwarded-For hop. One responsive stylesheet with light/dark theme, labelled fields, alerts and no inline scripts or styles; Italian error pages and a readable CSRF failure. Mutation checks: open redirects, uncounted failures and a missing CSRF middleware are all caught. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d4b53d778
commit
efb3e2e702
28 files changed
+1232
-22
No files matched your search
@@ -0,0 +1,70 @@
|
||||
/* One stylesheet for the whole site (ADR-54). Mobile first, no inline styles or scripts anywhere, so the
|
||||
Content-Security-Policy can be tightened for these pages (Caddyfile). */
|
||||
:root {
|
||||
--bg: #f6f7f9; --surface: #ffffff; --text: #16202a; --muted: #5a6672; --line: #d9dee4;
|
||||
--accent: #1b5fd6; --accent-text: #ffffff; --error: #b42318; --error-bg: #fdecea; --ok: #067647; --ok-bg: #e7f6ec;
|
||||
--radius: 10px; --gap: 1rem;
|
||||
color-scheme: light dark;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #10161c; --surface: #19222b; --text: #e8edf2; --muted: #9aa7b3; --line: #2b3742;
|
||||
--accent: #6ea0ff; --accent-text: #0b1220; --error: #ff8f85; --error-bg: #3a1d1b; --ok: #6ddba0; --ok-bg: #12301f;
|
||||
}
|
||||
}
|
||||
*, *::before, *::after { box-sizing: border-box; }
|
||||
html { -webkit-text-size-adjust: 100%; }
|
||||
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55;
|
||||
font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
|
||||
h1 { font-size: 1.6rem; line-height: 1.25; margin: 1.2rem 0 .8rem; }
|
||||
h2 { font-size: 1.2rem; margin: 0 0 .8rem; }
|
||||
a { color: var(--accent); }
|
||||
.wrap { width: 100%; max-width: 60rem; margin-inline: auto; padding-inline: 1rem; }
|
||||
main { padding-block: 1rem 3rem; min-height: 60vh; }
|
||||
main:focus { outline: none; }
|
||||
|
||||
.skip-link { position: absolute; left: .5rem; top: -4rem; background: var(--accent); color: var(--accent-text);
|
||||
padding: .6rem 1rem; border-radius: var(--radius); z-index: 10; }
|
||||
.skip-link:focus { top: .5rem; }
|
||||
|
||||
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
|
||||
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-block: .6rem; }
|
||||
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
|
||||
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; }
|
||||
.nav a { text-decoration: none; padding: .5rem .2rem; }
|
||||
.nav a.button { padding: .5rem .9rem; }
|
||||
.inline { display: inline; margin: 0; }
|
||||
|
||||
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-block: 1rem; }
|
||||
.narrow { max-width: 28rem; }
|
||||
|
||||
.field { margin-bottom: 1rem; }
|
||||
label { display: block; font-weight: 600; margin-bottom: .3rem; }
|
||||
input[type=text], input[type=password] { width: 100%; min-height: 2.75rem; padding: .55rem .75rem; font: inherit; color: var(--text);
|
||||
background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
|
||||
.has-error input { border-color: var(--error); }
|
||||
.hint { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
|
||||
.error { color: var(--error); font-size: .95rem; margin: .3rem 0 0; }
|
||||
.error.box { background: var(--error-bg); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 1rem; }
|
||||
.messages { margin-block: 1rem 0; }
|
||||
.message { background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 .5rem; }
|
||||
.message.error { background: var(--error-bg); color: var(--error); }
|
||||
|
||||
.button, .link-button { font: inherit; cursor: pointer; }
|
||||
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .55rem 1.2rem; border: 0;
|
||||
border-radius: 8px; background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; }
|
||||
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
|
||||
.button.small { min-height: 2.25rem; padding: .3rem .9rem; }
|
||||
.link-button { background: none; border: 0; color: var(--accent); padding: .5rem .2rem; text-decoration: underline; }
|
||||
.aside { color: var(--muted); margin: 1rem 0 0; }
|
||||
|
||||
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
|
||||
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
|
||||
|
||||
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding-block: 1rem; }
|
||||
|
||||
/* Keyboard users always see where they are (WEB-06). */
|
||||
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
|
||||
|
||||
@media (min-width: 40rem) { h1 { font-size: 2rem; } .card { padding: 1.6rem; } }
|
||||
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
|
||||
Reference in new issue
Block a user