feat: Introduce a comprehensive authentication system, including user management, JWT handling, and initial frontend components with Docker support.

This commit is contained in:
2026-03-23 15:44:37 -04:00
parent 757b72c549
commit 190f47f134
15 changed files with 1874 additions and 43 deletions
+371
View File
@@ -2958,3 +2958,374 @@ body.resizing-v {
transform: translateX(18px);
background: #22c55e;
}
/* ---------------------------------------------------------------------------
Utility — hidden class
--------------------------------------------------------------------------- */
.hidden { display: none !important; }
/* ---------------------------------------------------------------------------
Login Screen
--------------------------------------------------------------------------- */
.login-screen {
position: fixed;
inset: 0;
z-index: 10001;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #0f0c29 0%, #1a1a3e 50%, #24243e 100%);
}
.login-card {
width: 380px;
max-width: 90vw;
background: rgba(30, 30, 46, 0.85);
backdrop-filter: blur(20px);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 16px;
padding: 40px 36px;
box-shadow: 0 20px 60px rgba(0,0,0,0.5);
animation: loginFadeIn 0.4s ease-out;
}
@keyframes loginFadeIn {
from { opacity: 0; transform: translateY(20px) scale(0.97); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-header {
text-align: center;
margin-bottom: 32px;
}
.login-logo {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
margin-bottom: 8px;
}
.login-logo-icon {
font-size: 2rem;
}
.login-logo-text {
font-size: 1.8rem;
font-weight: 700;
background: linear-gradient(135deg, #a78bfa, #818cf8, #60a5fa);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: -0.02em;
}
.login-subtitle {
font-size: 0.88rem;
color: rgba(255,255,255,0.45);
margin: 0;
}
.login-form .form-group {
margin-bottom: 20px;
}
.login-form .form-group label {
display: block;
font-size: 0.82rem;
font-weight: 500;
color: rgba(255,255,255,0.6);
margin-bottom: 6px;
}
.login-form input[type="text"],
.login-form input[type="password"] {
width: 100%;
padding: 12px 14px;
border: 1px solid rgba(255,255,255,0.1);
border-radius: 10px;
background: rgba(255,255,255,0.06);
color: #e2e8f0;
font-size: 0.92rem;
font-family: inherit;
outline: none;
transition: border-color 200ms, box-shadow 200ms;
box-sizing: border-box;
}
.login-form input:focus {
border-color: #818cf8;
box-shadow: 0 0 0 3px rgba(129,140,248,0.2);
}
.login-form input::placeholder {
color: rgba(255,255,255,0.25);
}
.password-input-wrapper {
position: relative;
}
.password-toggle {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
font-size: 1rem;
opacity: 0.5;
transition: opacity 150ms;
padding: 4px;
}
.password-toggle:hover { opacity: 0.9; }
.form-group--inline {
display: flex;
align-items: center;
}
.checkbox-label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
font-size: 0.82rem;
color: rgba(255,255,255,0.5);
}
.checkbox-label input[type="checkbox"] {
accent-color: #818cf8;
width: 15px;
height: 15px;
}
.login-error {
padding: 10px 14px;
border-radius: 8px;
background: rgba(239,68,68,0.12);
border: 1px solid rgba(239,68,68,0.3);
color: #fca5a5;
font-size: 0.82rem;
margin-bottom: 16px;
}
.btn-login {
width: 100%;
padding: 13px 24px;
border: none;
border-radius: 10px;
background: linear-gradient(135deg, #7c3aed, #6366f1);
color: #fff;
font-size: 0.95rem;
font-weight: 600;
cursor: pointer;
transition: opacity 200ms, transform 100ms;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
font-family: inherit;
}
.btn-login:hover:not(:disabled) {
opacity: 0.92;
}
.btn-login:active:not(:disabled) {
transform: scale(0.98);
}
.btn-login:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.btn-spinner { font-size: 1rem; }
/* Light theme login */
[data-theme="light"] .login-screen {
background: linear-gradient(135deg, #e0e7ff, #f0f5ff, #dbeafe);
}
[data-theme="light"] .login-card {
background: rgba(255,255,255,0.9);
border: 1px solid rgba(0,0,0,0.08);
box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}
[data-theme="light"] .login-subtitle { color: rgba(0,0,0,0.45); }
[data-theme="light"] .login-form .form-group label { color: rgba(0,0,0,0.6); }
[data-theme="light"] .login-form input[type="text"],
[data-theme="light"] .login-form input[type="password"] {
background: rgba(0,0,0,0.04);
border-color: rgba(0,0,0,0.12);
color: #1e293b;
}
[data-theme="light"] .login-form input::placeholder { color: rgba(0,0,0,0.3); }
[data-theme="light"] .checkbox-label { color: rgba(0,0,0,0.5); }
[data-theme="light"] .login-error {
background: rgba(239,68,68,0.08);
color: #dc2626;
}
/* ---------------------------------------------------------------------------
User Menu (header)
--------------------------------------------------------------------------- */
.user-menu {
display: flex;
align-items: center;
gap: 8px;
}
.user-display-name {
font-size: 0.8rem;
color: var(--text-secondary);
font-weight: 500;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.user-menu-link,
.btn-logout {
display: flex;
align-items: center;
justify-content: center;
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 4px;
border-radius: 4px;
transition: color 150ms, background 150ms;
}
.user-menu-link:hover,
.btn-logout:hover {
color: var(--text-primary);
background: var(--bg-hover);
}
.btn-logout:hover { color: var(--danger); }
/* ---------------------------------------------------------------------------
Admin Panel
--------------------------------------------------------------------------- */
.admin-toolbar {
padding: 16px;
display: flex;
justify-content: flex-end;
}
.admin-users-list {
padding: 0 16px 16px;
}
.admin-table {
width: 100%;
border-collapse: collapse;
font-size: 0.82rem;
}
.admin-table th,
.admin-table td {
padding: 10px 12px;
text-align: left;
border-bottom: 1px solid var(--border);
}
.admin-table th {
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-muted);
font-weight: 600;
background: var(--bg-primary);
position: sticky;
top: 0;
}
.admin-table td { color: var(--text-primary); }
.admin-role-badge {
display: inline-block;
padding: 2px 10px;
border-radius: 10px;
font-size: 0.72rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.admin-role-admin {
background: rgba(129,140,248,0.15);
color: #818cf8;
}
.admin-role-user {
background: rgba(34,197,94,0.12);
color: #22c55e;
}
.admin-vaults-text {
font-size: 0.78rem;
color: var(--text-secondary);
}
.admin-actions {
white-space: nowrap;
}
.admin-action-btn {
background: none;
border: none;
cursor: pointer;
padding: 4px 6px;
border-radius: 4px;
font-size: 0.9rem;
transition: background 150ms;
}
.admin-action-btn:hover { background: var(--bg-hover); }
.admin-action-btn.danger:hover { background: rgba(239,68,68,0.12); }
/* Admin form overlay */
.admin-form-overlay {
position: absolute;
inset: 0;
background: rgba(0,0,0,0.6);
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
backdrop-filter: blur(4px);
}
.admin-form-card {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 12px;
padding: 28px 24px;
width: 440px;
max-width: 90vw;
max-height: 80vh;
overflow-y: auto;
box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.admin-form-card h3 {
margin: 0 0 20px;
font-size: 1.05rem;
color: var(--text-primary);
}
.admin-form-card .form-group {
margin-bottom: 16px;
}
.admin-form-card .form-group label {
display: block;
font-size: 0.82rem;
font-weight: 500;
color: var(--text-secondary);
margin-bottom: 6px;
}
.admin-form-card input[type="text"],
.admin-form-card input[type="password"],
.admin-form-card select {
width: 100%;
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg-primary);
color: var(--text-primary);
font-size: 0.88rem;
font-family: inherit;
outline: none;
transition: border-color 200ms;
box-sizing: border-box;
}
.admin-form-card input:focus,
.admin-form-card select:focus {
border-color: var(--accent);
}
.admin-vault-list {
display: flex;
flex-direction: column;
gap: 6px;
max-height: 160px;
overflow-y: auto;
padding: 8px;
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: 8px;
}
.admin-vault-list .checkbox-label {
color: var(--text-primary);
font-size: 0.82rem;
}
.admin-form-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 20px;
}