Files
northwind-ordini-php/style.css
2026-02-25 11:09:14 +01:00

172 lines
4.7 KiB
CSS

/* ==========================================================================
1. VARIABILI E COLORI (Design Tokens 2026)
========================================================================== */
:root {
/* Palette 2026: Basata su "Cloud Dancer" (bianco caldo) e accenti vibranti */
--bg-page: #f9f9fb; /* Sfondo chiaro e riposante */
--text-main: #1a1a1c; /* Testo quasi nero per massimo contrasto */
--text-muted: #64748b; /* Testo secondario */
--primary: #2563eb; /* Blu moderno e saturo */
--primary-hover: #1d4ed8;
--accent: #f59e0b; /* Ambra per richiamare l'attenzione */
/* Colori per i Form */
--input-bg: #ffffff;
--input-border: #e2e8f0;
--input-focus: #3b82f6;
--error: #ef4444;
--success: #10b981;
/* Spaziature e Bordi */
--radius: 12px;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}
/* Modalità Notte Automatica */
@media (prefers-color-scheme: dark) {
:root {
--bg-page: #0f172a;
--text-main: #f8fafc;
--text-muted: #94a3b8;
--input-bg: #1e293b;
--input-border: #334155;
}
}
/* ==========================================================================
2. TIPOGRAFIA E TESTO NELLA PAGINA
========================================================================== */
body {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background-color: var(--bg-page);
color: var(--text-main);
line-height: 1.6;
/* Tipografia fluida: scala tra 16px e 18px in base alla finestra */
font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
margin: 0;
padding: 2rem;
}
p {
margin-bottom: 1.5rem;
max-width: 70ch; /* Limita la larghezza per una lettura ottimale */
}
/* ==========================================================================
3. TITOLI (H1, H2, H3)
========================================================================== */
h1, h2, h3 {
margin-top: 2.5rem;
margin-bottom: 1rem;
font-weight: 800;
line-height: 1.2;
color: var(--primary);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); color: var(--text-main); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); border-left: 4px solid var(--accent); padding-left: 1rem; }
/* ==========================================================================
4. FORM E INPUT (Stile Moderno)
========================================================================== */
form {
display: flex;
flex-direction: column;
gap: 1.5rem;
max-width: 500px;
background: var(--input-bg);
padding: 2rem;
border-radius: var(--radius);
box-shadow: var(--shadow-md);
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
label {
font-weight: 600;
font-size: 0.9rem;
}
input, textarea, select {
padding: 0.75rem 1rem;
border: 2px solid var(--input-border);
border-radius: 8px;
background-color: var(--input-bg);
color: var(--text-main);
transition: all 0.2s ease;
font-size: 1rem;
}
input:focus {
outline: none;
border-color: var(--input-focus);
box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
/* Feedback validazione nativa senza JS */
input:invalid:not(:placeholder-shown) { border-color: var(--error); }
input:valid:not(:placeholder-shown) { border-color: var(--success); }
button {
background-color: var(--primary);
color: white;
padding: 0.8rem 1.5rem;
border: none;
border-radius: 8px;
font-weight: 700;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover { background-color: var(--primary-hover); }
/* ==========================================================================
5. TABELLE (Stile Minimalista Bento)
========================================================================== */
.table-container {
overflow-x: auto; /* Rende la tabella scrollabile su mobile */
margin: 2rem 0;
border-radius: var(--radius);
box-shadow: var(--shadow-sm);
}
table {
width: 100%;
border-collapse: collapse;
background: var(--input-bg);
text-align: left;
}
th, td {
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--input-border);
}
th {
background-color: var(--primary);
color: white;
font-weight: 600;
text-transform: uppercase;
font-size: 0.8rem;
letter-spacing: 0.05em;
position: sticky; /* Header fisso allo scroll */
top: 0;
}
tr:last-child td { border-bottom: none; }
/* Effetto riga al passaggio del mouse */
tr:hover td {
background-color: rgba(37, 99, 235, 0.05);
}
@media (max-width: 600px) {
th, td { padding: 0.75rem; font-size: 0.9rem; }
}