Fixed some bugs in api and auth services, completed auth cores.

This commit is contained in:
Giuseppe Raffa
2026-05-25 23:14:50 +02:00
parent 318ea3555f
commit 47faa41eb9
41 changed files with 2061 additions and 101 deletions

View File

@@ -0,0 +1,585 @@
@font-face {
font-family: "Elms";
src: url("../fonts/elmssans.ttf");
font-weight: normal;
font-style: normal;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* ── Variabili tema ── */
:root {
--bg-body: #0f1117;
--bg-card: #1a1d27;
--border: #2a2d3a;
--text-primary: #f0f0f0;
--text-secondary: #6b7280;
--text-label: #9ca3af;
--input-bg: #0f1117;
--input-placeholder: #3d4150;
--accent: #4f8ef7;
--accent-hover: #3b7de8;
--accent-active: #2f6dd4;
--error: #f87171;
--shadow: rgba(0, 0, 0, 0.4);
--grad-1: #0f1117;
--grad-2: #1a1d27;
--grad-3: #0d1520;
--grad-4: #111827;
}
@media (prefers-color-scheme: light) {
:root {
--bg-body: #eef1f7;
--bg-card: #ffffff;
--border: #dde1ec;
--text-primary: #111827;
--text-secondary: #6b7280;
--text-label: #4b5563;
--input-bg: #f5f7fc;
--input-placeholder: #b0b8cc;
--accent: #3b7de8;
--accent-hover: #2f6dd4;
--accent-active: #2260be;
--error: #dc2626;
--shadow: rgba(0, 0, 0, 0.1);
--grad-1: #dce8ff;
--grad-2: #eef1f7;
--grad-3: #d4e4fb;
--grad-4: #e8edf8;
}
}
/* ── Sfondo animato ── */
@keyframes gradientShift {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
body {
font-family: "Elms", sans-serif;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(
135deg,
var(--grad-1),
var(--grad-2),
var(--grad-3),
var(--grad-4)
);
background-size: 400% 400%;
animation: gradientShift 12s ease infinite;
}
/* ── Card ── */
.login-container {
width: 100%;
max-width: 400px;
padding: 48px 40px;
background-color: var(--bg-card);
border-radius: 16px;
border: 1px solid var(--border);
box-shadow: 0 24px 48px var(--shadow);
transition:
background-color 0.3s,
border-color 0.3s;
}
.login-logo {
font-size: 13px;
font-weight: bold;
letter-spacing: 4px;
color: var(--accent);
text-transform: uppercase;
margin-bottom: 24px;
}
.login-container h1 {
font-size: 26px;
color: var(--text-primary);
margin-bottom: 8px;
transition: color 0.3s;
}
.login-container p {
font-size: 14px;
color: var(--text-secondary);
margin-bottom: 32px;
line-height: 1.5;
transition: color 0.3s;
}
/* ── Form ── */
.login-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.input-group {
display: flex;
flex-direction: column;
gap: 6px;
}
.input-group label {
font-size: 13px;
color: var(--text-label);
letter-spacing: 0.3px;
transition: color 0.3s;
}
.input-group input {
width: 100%;
padding: 12px 14px;
background-color: var(--input-bg);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text-primary);
font-family: "Elms", sans-serif;
font-size: 15px;
outline: none;
transition:
border-color 0.2s,
background-color 0.3s,
color 0.3s;
}
.input-group input::placeholder {
color: var(--input-placeholder);
}
.input-group input:focus {
border-color: var(--accent);
}
.error-message {
font-size: 13px;
color: var(--error);
min-height: 18px;
transition: color 0.3s;
}
/* ── Bottone ── */
@keyframes btnPulse {
0% {
box-shadow: 0 0 0 0 rgba(79, 142, 247, 0.5);
}
70% {
box-shadow: 0 0 0 10px rgba(79, 142, 247, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(79, 142, 247, 0);
}
}
@keyframes btnSpin {
to {
transform: rotate(360deg);
}
}
.btn-login {
width: 100%;
padding: 13px;
background-color: var(--accent);
color: #fff;
border: none;
border-radius: 8px;
font-family: "Elms", sans-serif;
font-size: 15px;
cursor: pointer;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
transition:
background-color 0.2s,
transform 0.15s,
box-shadow 0.2s;
}
.btn-login::after {
content: "";
position: absolute;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.08);
top: 0;
left: -100%;
transition: left 0.3s ease;
}
.btn-login:hover::after {
left: 0;
}
.btn-login:hover {
background-color: var(--accent-hover);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(79, 142, 247, 0.35);
}
.btn-login:active {
background-color: var(--accent-active);
transform: translateY(0px);
box-shadow: none;
animation: btnPulse 0.4s ease-out;
}
.btn-login:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.btn-spinner {
width: 16px;
height: 16px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-top-color: #fff;
border-radius: 50%;
animation: btnSpin 0.7s linear infinite;
display: none;
flex-shrink: 0;
}
.btn-login.loading .btn-spinner {
display: block;
}
.btn-login.loading .btn-label {
opacity: 0.7;
}
/* ════════════════════════════════════════════════════════════
PAGINA PROFILO
════════════════════════════════════════════════════════════ */
body.page-profile {
display: block;
align-items: stretch;
justify-content: stretch;
}
.profile-shell {
max-width: 960px;
margin: 0 auto;
padding: 32px 20px 80px;
}
/* ── Topbar ── */
.profile-topbar {
display: flex;
align-items: center;
gap: 24px;
padding: 12px 0 28px;
border-bottom: 1px solid var(--border);
margin-bottom: 32px;
}
.profile-brand {
font-size: 13px;
font-weight: bold;
letter-spacing: 4px;
color: var(--accent);
text-transform: uppercase;
}
.profile-nav {
display: flex;
gap: 8px;
flex: 1;
}
.nav-link {
padding: 8px 14px;
border-radius: 8px;
border: 1px solid var(--border);
color: var(--text-primary);
text-decoration: none;
font-size: 13px;
transition:
background 0.15s,
border-color 0.15s,
transform 0.1s;
}
.nav-link:hover {
border-color: var(--accent);
background: var(--input-bg);
transform: translateY(-1px);
}
.btn-ghost {
padding: 8px 16px;
background: transparent;
color: var(--text-primary);
border: 1px solid var(--border);
border-radius: 8px;
cursor: pointer;
font-family: "Elms", sans-serif;
font-size: 13px;
transition:
background 0.15s,
border-color 0.15s,
color 0.15s;
}
.btn-ghost:hover {
border-color: var(--error);
color: var(--error);
}
/* ── Main grid ── */
.profile-main {
display: grid;
gap: 24px;
}
/* ── Card base ── */
.card {
background-color: var(--bg-card);
border: 1px solid var(--border);
border-radius: 16px;
padding: 28px;
box-shadow: 0 8px 24px var(--shadow);
}
.card-header {
display: flex;
align-items: baseline;
justify-content: space-between;
margin-bottom: 20px;
}
.card-header h2 {
font-size: 16px;
font-weight: 500;
color: var(--text-primary);
}
.muted {
color: var(--text-secondary);
font-size: 13px;
}
/* ── Hero ── */
.profile-hero {
display: flex;
align-items: center;
gap: 24px;
}
.avatar {
width: 72px;
height: 72px;
border-radius: 50%;
background: linear-gradient(
135deg,
var(--accent),
var(--accent-active)
);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 30px;
font-weight: bold;
flex-shrink: 0;
box-shadow: 0 4px 14px rgba(79, 142, 247, 0.35);
}
.hero-info h1 {
font-size: 24px;
color: var(--text-primary);
margin-bottom: 4px;
}
/* ── Sessions list ── */
.sessions-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.session-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 16px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--input-bg);
transition: border-color 0.15s;
}
.session-row.is-current {
border-color: var(--accent);
background: rgba(79, 142, 247, 0.05);
}
.session-info {
flex: 1;
min-width: 0;
}
.session-title {
font-size: 14px;
color: var(--text-primary);
margin-bottom: 4px;
display: flex;
align-items: center;
gap: 8px;
}
.session-meta {
font-size: 12px;
line-height: 1.6;
}
.badge {
font-size: 10px;
padding: 2px 8px;
border-radius: 10px;
background: var(--accent);
color: #fff;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.btn-revoke {
padding: 8px 14px;
background: transparent;
color: var(--error);
border: 1px solid var(--border);
border-radius: 8px;
cursor: pointer;
font-family: "Elms", sans-serif;
font-size: 12px;
transition:
background 0.15s,
border-color 0.15s;
}
.btn-revoke:hover:not(:disabled) {
background: rgba(248, 113, 113, 0.1);
border-color: var(--error);
}
.btn-revoke:disabled {
opacity: 0.6;
cursor: wait;
}
/* ── kv grid (account info) ── */
.kv-grid {
display: grid;
grid-template-columns: 180px 1fr;
gap: 12px 20px;
font-size: 13px;
}
.kv-grid dt {
color: var(--text-label);
}
.kv-grid dd {
color: var(--text-primary);
}
.mono {
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 12px;
word-break: break-all;
}
/* ── Toast ── */
.toast {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%) translateY(20px);
padding: 12px 20px;
border-radius: 10px;
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--text-primary);
box-shadow: 0 8px 24px var(--shadow);
opacity: 0;
pointer-events: none;
transition:
opacity 0.2s,
transform 0.2s;
font-size: 13px;
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
.toast.ok {
border-color: #22c55e;
}
.toast.err {
border-color: var(--error);
}
/* ── Responsive ── */
@media (max-width: 600px) {
.profile-topbar {
flex-wrap: wrap;
gap: 12px;
}
.profile-nav {
order: 3;
width: 100%;
}
.profile-hero {
flex-direction: column;
text-align: center;
}
.kv-grid {
grid-template-columns: 1fr;
gap: 4px 0;
}
.kv-grid dt {
margin-top: 12px;
}
.session-row {
flex-direction: column;
align-items: stretch;
}
.btn-revoke {
width: 100%;
}
}