# RAMA AG — Login Black Titanium ("Brush Corners") Implementation Report

Status: **LIVE — `rama-v1.0.0-rc2` (`37f8dbd`) on `http://localhost:3400` since 27.11.2026 06:58.**
Scope: Phases 01–06 of the owner's "Premium Login Page Redesign" spec. This was a UI-only change: no migrations, no auth/route/validation/throttling/CSRF/session changes, and no other modules were touched.

## 1. Summary

- `/login` is now a full-screen Black Titanium page:
  - DE/SQ switch at the top right.
  - The original RAMA AG logo centred above a static smoked-glass card in the exact centre.
  - A one-line copyright footer.
  - Animated painter's-brush strokes in the top-left and bottom-right corners; the centre stays clean and dark.
- It is not split-screen. There are no slogans, no statistics and no server status line (the old `/health` status line was removed).
- The form contract is unchanged: `POST login.store` with `login` (username **or** e-mail, as before), `password` and `_token`. `LoginController`, the rate limiter, sessions and the role redirects are untouched.

## 2. Modified and new files

| File | Change |
| --- | --- |
| `resources/views/auth/login.blade.php` | Rewritten markup (same form fields, action, CSRF, error keys) |
| `resources/views/components/auth/locale-switch.blade.php` | **New.** DE/SQ segmented control; same `POST locale.update` mechanism as `<x-language-switcher>` |
| `resources/views/components/layouts/guest.blade.php` | Body background `#08090b` and `theme-color` (shared only with the change-password page) |
| `resources/css/login-titanium.css` | **New.** All `.ti-*` styles, scoped to the sign-in page |
| `resources/css/app.css` | One `@import` line |
| `resources/js/brush-corners-scene.js` | **New.** Canvas 2D background |
| `resources/js/login.js` | Scene wiring, password toggle, client "required" check, loading state. The status fetch was removed |
| `resources/js/liquid-glass-scene.js` | **Removed** (replaced) |
| `lang/de/login.php`, `lang/sq/login.php` | New keys `subheading` and `copyright` |
| `resources/brand/RAMA-AG-White.png` | **New.** The owner's original logo, byte-identical (SHA-256 `31ce236d…0568`, 5136×972) |
| `public/brand/rama-ag-white.png` | **New.** Web derivative, exactly ¼ scale (1284×243, 25 KB, same aspect ratio) |
| `tests/Feature/Auth/LoginTitaniumPageTest.php` | **New.** 4 tests: form contract, SQ/DE texts, switcher, logo proportions and hash |

The old `.lg-*` classes stay in `app.css` and `black-titanium.css` because the change-password page still uses them.

## 3. Design

Tokens (scoped to `.ti-stage`): Obsidian `#08090B`, Black Titanium `#15171A`, Gunmetal `#25282D`, Graphite `#35383D`, Titanium Silver `#A5A9B0`, Platinum `#D9DCE1`, Pure White `#F5F5F7`, border `rgba(255,255,255,.10)`. These are consistent with the platform's `--bt-*` tokens.

- **Logo.** The original white PNG, scaled by width only (`height: auto`), at 168–232 px. A very soft drop-shadow glow, no rebuild with a font and no 3D. The measured ratio on every viewport is 5.284 (source: 5136/972 = 5.284).
- **Card.**
  - 400 px wide on desktop, radius 18 px, padding 32 px (26/22 on mobile).
  - Smoked glass `blur(18px)`, thin titanium border, soft shadow, 1 px inner highlight.
  - It stays static. The reveal runs only on the first load (700 ms, opacity 0→1, translateY 8→0) and is skipped after a failed login.
- **Typography.** Geist (self-hosted). Title 22 px/600, subtitle 13.5 px, labels 12 px/500.
- **Inputs.**
  - Height 48 px, radius 9 px, leading user/lock icons, silver focus ring.
  - Invalid state via `aria-invalid`; styled `:-webkit-autofill` and `:autofill`.
  - Show/hide password button with `aria-pressed` and a translated `aria-label`.
- **Button.**
  - Silver→Platinum gradient with dark text, and no idle animation.
  - A light sweep runs on hover only; press scales to 0.985.
  - While submitting: disabled, `aria-busy`, spinner and the "Duke u kyçur… / Anmeldung läuft…" label.
  - bfcache restore re-enables it.
- **Errors.** The server errors (`invalid`, `tooMany`, `validation`) are unchanged and translated. Empty fields are now caught in the browser with the existing `login.errors.validation` text, and no request is sent. The server-side validation is still the authority.
- **Footer.** "© {year} RAMA AG — Të gjitha të drejtat e rezervuara." / "… — Alle Rechte vorbehalten."

## 4. Animation architecture (Brush Corners)

- **Painting.** Each corner has 4 strokes: a wide gunmetal wash, the main silver stroke, a graphite stroke and a thin platinum accent. Each is a cubic Bézier, painted **once per size** into its own offscreen canvas:
  - an underpaint body;
  - 40–130 bristles with their own offset, width, opacity, waviness and dry-brush end length;
  - paint flecks.
  - A seeded PRNG keeps the strokes the same on every visit.
- **Per frame**, only about 10 `drawImage` calls with transforms run, plus one gradient fill and one mask per corner. There is no path building, no DOM reads and no layout.
  - (A) Spreading: each stroke scales slowly along its own axis, from where the brush landed, with a slight swell, turn and drift.
  - (B) A titanium light sweep, `source-atop`, so it lights only the paint.
  - (C) Breathing opacity.
  - (D) Parallax of at most **6 px**, eased in a frame-rate-independent way. It is active only with a fine pointer (`hover:hover and pointer:fine`) on desktop widths and never from touch or pen events.
- **Soft corner mask.** A pre-rendered elliptical gradient (`destination-in`) dissolves the paint towards the centre, so no layer edge is visible. A 12 px bleed means parallax never exposes a gap at the screen edge.
- **Seamless loop.** `PERIOD = 20 s`. Every periodic term is a whole-number multiple of 2π·t/20. The light band wraps only while it is outside the painted area. So `frame(t) ≡ frame(t + 20 s)`: no seam, no reset and no flash. There are no replay buttons or controls.
- **Pausing.** Time advances only while frames run. A hidden tab, `pagehide` or bfcache stops the loop, `dt` is capped at 100 ms, and resuming is seamless.
- **Fallbacks.**
  - `prefers-reduced-motion` or low-power hints (`saveData`, ≤ 2 cores, ≤ 2 GB device memory) → one static frame and no sweep. The card reveal and shake are also disabled.
  - Tablet, or no fine pointer: 75 % bristles, 85 % intensity, a 30 fps cap and no parallax.
  - Mobile (≤ 640 px): 55 % bristles, 70 % intensity, a 30 fps cap and no parallax.
- **Device pixel ratio.** Capped at 1.75 (desktop) or 1.5. Resizing is debounced to 150 ms, and a mode change rebuilds the scene. `destroy()` releases the offscreen canvases.

## 5. Performance

Measured in headless Edge at 1920×1080 on the `:3401` copy:

- **Frame time.** Frame interval p95 **4.3 ms**. Headless rAF is not vsync-locked, so this shows the work per frame is far below a 16.7 ms (60 fps) budget.
- **Heap.** No growth while animating: 3.26 MB → 2.86 MB over 6 s.
- **Bundle.** `login.js` is 8.9 kB (3.9 kB gzip). There are no libraries, no external fonts and no CDN, and everything is CSP `self`-compliant (the grain is a `data:` SVG, which the existing `img-src` allows).

## 6. Auth and security verification

| Check | Result |
| --- | --- |
| Full main suite (MariaDB test DB) | **566 tests, 468 passed, 98 skipped by design, 0 failed** (9,848 assertions) |
| Memory suite (SQLite) | **97 tests, 96 passed, 1 skipped, 0 failed** |
| Node tests (`tests/Frontend`, `tests/js`) | **6/6 passed**; `node --check` OK for every JS file; production Vite build OK |
| Existing `LoginTest`, `SimpleCredentialsTest`, `LocalizationTest`, `PasswordChangeTest` | All green, unchanged |
| Browser: admin login by **username**, SQ | Loading state OK → `/dashboard` |
| Browser: worker login by username | Loading state OK → `/dashboard`; `/smgv` still **403** |
| Wrong credentials | Generic translated error, inputs `aria-invalid`, identifier kept, no reveal replay |
| Empty submit | Caught client-side, no POST |
| Guests (`:3401` and live `:3400`) | `/dashboard`, `/smgv`, `/smgv/monthly`, `/smgv/annual`, `/smgv/exports`, `/audit` all **302 → /login** |
| CSRF | `POST /login` without a token → **419** (both servers) |
| Headers (live) | CSP unchanged; `Cache-Control: no-store, private` on `/login` |
| Data before sign-in | None: the status/health call on the page was removed |

## 7. Responsive and accessibility verification

The automated browser QA (`qa-results.json`) passed **104/104** checks on `:3401` (test DB, synthetic accounts, removed afterwards). It ran at 1920×1080, 1440×900, 1280×720, tablet (iPad 810×1080, touch) and mobile (iPhone 13, 390×844, touch), each in DE and SQ, switching the language through the real control. Every viewport checked:

- active language;
- no horizontal overflow;
- no vertical scroll on desktop, laptop and tablet;
- the card centred to ±1 px, and 400 px wide (380–420) on desktop;
- exact logo ratio;
- translated texts and footer;
- no status line;
- **0 console errors**.

Also checked:

- **Keyboard order:** DE → SQ → identifier → password → show/hide → submit. All controls have visible focus rings.
- **Reduced motion:** static frame (canvas byte-identical over time).
- **Animation:** the canvas changes over time, and parallax responds to the mouse.
- **Contrast on the card:** text `#F5F5F7` and `#B4B8BF` (≥ 8.5:1), hints `#8E9299` (≈ 5.6:1), button text `#08090B` on silver (≥ 8:1).
- **Mobile:** content scrolls when needed (virtual keyboard); 16 px inputs prevent iOS zoom; no autofocus on touch.

## 8. Build and deployment

1. **Branch.** `feature/login-titanium` was created from `develop/v1` (`3af3397`). Commit `37f8dbd`, tag **`rama-v1.0.0-rc2`**.
2. **Backup.** `D:\- CLAUD PROJECTS\RAMA AG\backups\login-rc2-predeploy-20261127-065745\` (owner + SYSTEM only). It contains:
   - live DB logical dump (49 tables, 32 triggers, 19 migrations; sha256 `10a0b334…a130`) + `verification.json` (row counts, checksums);
   - the files to be changed, the previous `public/build`, `GIT_HEAD`/`GIT_STATUS`, and a git bundle;
   - `SHA256SUMS`, re-verified with 0 mismatches.
3. **Maintenance window, about 6 s.** No migrations.
   - `artisan down`.
   - `git merge --ff-only` of `main` → `37f8dbd`.
   - `public/build` mirrored from the tested build (20 files, hash-identical).
   - `optimize:clear` + `optimize`.
   - Only the RAMA `:3400` process restarted (old PID 72760 → new PID 64048, same `php -S … server.php` from `public/`; logs `.tools\rama-serve-rc2*.log`).
   - `artisan up`.
4. **Live checks.**
   - `/health` 200 `{"status":"ok"}`, `/up` 200, `/login` 200 with the new assets, logo 200.
   - Guest redirects and CSRF as listed above.
   - Headless render with 0 console errors (`live-3400-*.png`).
5. **Not touched.** Quality (folder, DB, MariaDB binaries), `.env`, the admin password and the live users. No synthetic data was written to the live DB.

**Rollback.**

1. `artisan down`.
2. `git checkout rama-v1.0.0-rc1` on `main` (or `git reset --hard 3af3397`).
3. Restore `public/build` from the backup's `public-build\`.
4. `artisan optimize:clear` and `artisan optimize`.
5. Restart `:3400`.
6. `artisan up`.

## 9. Limitations and open points

- **PDF/Excel logo (`RAMA_PDF_LOGO`): not wired.** The supplied logo is **white on transparent**, and the PDF and Excel pages are white, so it would be invisible there. Also, the live `.env` already defines `RAMA_PDF_LOGO`/`RAMA_LOGO`, so changing it would need an `.env` edit plus `artisan optimize`. Recommendation: the owner supplies a dark (black/graphite) version of the same logo; then set `RAMA_PDF_LOGO=brand/<file>.png` and run `artisan optimize`.
- **Sidebar logo (`RAMA_LOGO`): live since 27.11.2026 09:20.** See section 11.
- **Real devices.** Performance and visuals were verified in headless Edge with device emulation, not on a real iPhone or iPad, and not on a 60 Hz panel with vsync.
- **Favicon.** It is still the placeholder SVG.

## 10. Screenshots

All screenshots are in `D:\- CLAUD PROJECTS\RAMA AG\phase02b-evidence\login-rc2\screens\`:

- `login-{1920,1440,1280,tablet,mobile}-{de,sq}.png`
- `login-error-de.png`, `login-validation-de.png`, `login-loading-sq.png`
- `login-reduced-motion.png`, `login-parallax.png`
- `after-login-qa.admin.png`, `after-login-qa.worker.png`
- `live-3400-1920-sq.png`, `live-3400-390-sq.png`
- `qa-results.json`

Test logs and JUnit files are one level up.

## 11. Follow-up: white logo in the app (`RAMA_LOGO`)

The owner approved showing the white logo everywhere `RAMA_LOGO` is used. Those places are the `<x-logo>` component in the sidebar, the settings page, the error pages and the change-password page.

**Verified on `:3401`** (test DB, synthetic admin removed afterwards; `RAMA_LOGO=brand/rama-ag-white.png` passed as a process variable, no file changed). The logo checks passed 23/23 at 1440×900 and iPhone 13; the only 2 failures were console-error checks for the pre-existing issue below. Screenshots are in `screens\sidebar-logo\`.

| Place | Rendered size | Ratio (source 5.284) |
| --- | --- | --- |
| Sidebar, expanded (desktop and mobile drawer) | 148 × 28 | 5.286 |
| Sidebar, collapsed | 46 × 8.7 (small but proportional) | 5.285 |
| Settings | 144 × 27.3 | 5.284 |
| 404 error page | 160 × 30.3 | 5.287 |

There was no horizontal overflow and no layout breakage. The `width="480" height="120"` attributes on `<x-logo>` are overridden by `h-auto`, so the real ratio is used.

**Live switch: APPLIED 27.11.2026 09:20** on the owner's direct instruction ("ndrysho RAMA_LOGO në .env live"). `.env` was backed up to `backups\sidebar-logo-env-20261127-092041` (owner + SYSTEM only, SHA256SUMS); only the `RAMA_LOGO` line changed (`brand/rama-placeholder.svg` → `brand/rama-ag-white.png`); `artisan optimize` rebuilt the config cache; no restart needed. Verified: `config('rama.logo')` = the white logo, `/health` 200, `/login` 200, logo asset 200, guests still redirected. `RAMA_PDF_LOGO` unchanged (empty).

Earlier status: **not applied.** My automatic permission check refused to edit the live `.env`, so the live `.env` is unchanged (`RAMA_LOGO=brand/rama-placeholder.svg`). The step that remains, for the owner to run or to approve explicitly:

1. Back up `.env` to `backups\sidebar-logo-env-<timestamp>\` (owner + SYSTEM only).
2. Change only the line `RAMA_LOGO=brand/rama-placeholder.svg` to `RAMA_LOGO=brand/rama-ag-white.png`.
3. Run `.\.tools\php\php.exe artisan optimize`. No restart is needed, because `php -S` reads the cached config on every request.
4. Check `/health`, `/login` and `/brand/rama-ag-white.png` (200).

`RAMA_PDF_LOGO` stays empty until the dark logo arrives.

**Pre-existing findings (not changed, outside scope):**
- The app layout's inline `<script>`, which restores the sidebar collapsed state before paint, is blocked by the CSP (`script-src 'self'`). This logs a console error on authenticated pages, and the state is applied a moment later by the bundled JS. The code is unchanged since rc1.
- The sidebar footer text reads "Heizung · Sanitär · Lüftung", which contradicts the logo's "Gipser und Maler". The owner should confirm the right text.

## 12. Update rc5: the "Roller Frame" design (owner's choice, 27.11.2026)

The owner chose concept **01 "Roller Frame"** from a mockup and asked for the live sign-in page to look like it. It replaces the canvas "Brush Corners" background. The mockup's demo tab bar, its "Infinite Loop" label and its Pause button were **not** shipped (no demo controls in production).

- **Background:**
  - a charcoal wall (#0E0F11 → #141518) with a fine vertical grain;
  - two CSS paint rollers hanging from the top edge (`components/auth/rollers.blade.php`). The left one is long (≈60 % of the height), the right one short (≈15 %). Each has a gunmetal cover with a metallic sheen, a silver roller bar, a bent wire frame and a dark handle.
- **Motion:**
  - one seamless 20 s loop: a slow ±8 px drift, the cover nap rolling, and a soft titanium light sweep;
  - ≤ 6 px parallax on fine pointers only;
  - paused while the tab is hidden; static under `prefers-reduced-motion`;
  - transform, opacity and background-position only.
- **Responsive:** lighter on tablets. Hidden on phones (≤ 760 px), so the card is never covered; verified that the rollers never overlap the card at any tested width.
- **Card (texts from the mockup):**

  | | SQ | DE |
  | --- | --- | --- |
  | Title | "Mirë se vini." | "Willkommen." |
  | Subtitle | "Hapësira juaj digjitale e punës." | "Ihr digitaler Arbeitsplatz." |
  | Button | "Hyr →" | "Anmelden →" |
  | Under the button | "◇ Qasje e mbrojtur" | "◇ Geschützter Zugang" |
  | Bottom line | "PRECIZION · CILËSI · ZANAT" | "PRÄZISION · QUALITÄT · HANDWERK" |

  The **real white logo** is kept (it is not recreated with a font). The **username field** "Emri i përdoruesit" / "Benutzername" is kept, with show/hide password. The DE/SQ switch is now plain text with the active language bright.
- The first-login password page uses the same backdrop.
- **Unchanged:** authentication, CSRF, throttling, error messages, the forced password change.
- **Removed:** the `brush-corners-scene.js` canvas.

**Verification:**
- Browser QA on `:3401` (synthetic accounts), 112/113 checks:
  - 1920, 1440, 1280, tablet and mobile, each in DE and SQ;
  - card centred, no overflow, no console errors, logo proportions;
  - admin and worker login with the loading state; worker still 403 on SMGV;
  - wrong password; keyboard order; reduced motion (static);
  - rollers shown/hidden per width and never under the card.

  The one "failure" is the script's old expected error text. The page correctly shows the current message "Benutzername oder Passwort ist falsch." (changed in rc3).
- Tests: main 581, memory 97, node 6, 0 failures. Production build OK.
- Deployment: backup `backups\login-roller-predeploy-20261127-182938` (30 checksums OK). Fast-forward to `c3dd060`, build mirrored, `optimize`. **Only `:3400` restarted** (window ≈10 s). Tag **`rama-v1.0.0-rc5`**.
- Live checks:
  - `/health` and `/login` 200, assets and logo 200;
  - guests redirected; CSRF 419.

**Screenshots:** `phase02b-evidence\login-roller\`
- `live-3400-login-1920.png`, `live-3400-login-390.png`
- `login-{1920,1440,1280,tablet,mobile}-{de,sq}.png`
