:root {
    --primary: #1A2E40;       /* Blu profondo ed elegante */
    --primary-dark: #101D28;
    --secondary: #5C6F84;     /* Grigio pietra raffinato */
    --accent: #D4AF37;        /* Dettaglio oro sobrio / commemorativo */
    --bg-light: #F7F9FA;
    --bg-card: #FFFFFF;
    --text-dark: #2C3E50;
    --text-muted: #6C7A89;
    --border-color: #E2E8F0;
    --success: #27AE60;
    --danger: #C0392B;
    --radius: 8px;
    --shadow: 0 10px 25px -5px rgba(26, 46, 64, 0.08), 0 8px 10px -6px rgba(26, 46, 64, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Lora', serif;
    color: var(--primary);
    font-weight: 600;
}

.container {
    width: 90%;
    max-width: 1150px;
    margin: 0 auto;
    padding: 30px 0;
}

.site-main {
    flex: 1;
}

/* Header & Nav */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1150px;
    margin: 0 auto;
}

.logo {
    font-family: 'Lora', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary);
    font-weight: 400;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--accent);
}

.btn-login, .btn-nav {
    background: var(--primary);
    color: var(--bg-card) !important;
    padding: 10px 20px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.btn-login:hover, .btn-nav:hover {
    background: var(--primary-dark);
}

.btn-logout {
    color: var(--danger) !important;
    font-weight: 600;
}

/* Bottoni Generali */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-card);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--bg-card);
}

.btn-secondary:hover {
    background: #4A5B6D;
}

.btn-danger {
    background: var(--danger);
    color: var(--bg-card);
}

.btn-success {
    background: var(--success);
    color: var(--bg-card);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    margin-right: 4px;
    text-decoration: none;
    display: inline-block;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Hero Section Homepage */
.hero-section {
    background: linear-gradient(rgba(26, 46, 64, 0.9), rgba(26, 46, 64, 0.92)), url('../uploads/hero-bg.jpg') center/cover;
    color: var(--bg-card);
    text-align: center;
    padding: 100px 20px;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: var(--bg-card);
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.15rem;
    max-width: 750px;
    margin: 0 auto 35px;
    color: #E2E8F0;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Features Grid */
.features-section {
    padding: 60px 0;
    text-align: center;
}

.features-section h2 {
    font-size: 2.2rem;
    margin-bottom: 40px;
}

.grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: left;
}

.feature-card {
    background: var(--bg-card);
    padding: 35px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
}

.feature-card h3 {
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-muted);
}

/* Form & Autenticazione */
.auth-container, .form-container {
    max-width: 550px;
    margin: 40px auto;
}

.auth-card, .styled-form, .memorial-lock-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.auth-card h2, .form-container h2, .memorial-lock-card h2 {
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.auth-card p, .form-container p, .memorial-lock-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 46, 64, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Dashboard & Tabelle */
.dashboard h2 {
    font-size: 2rem;
    margin-bottom: 25px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
}

.stat-card h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 5px;
    font-family: 'Lora', serif;
}

.action-bar {
    margin-bottom: 25px;
}

.data-table {
    width: 100%;
    background: var(--bg-card);
    border-collapse: collapse;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-top: 15px;
    margin-bottom: 30px;
}

.data-table th, .data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #F1F5F9;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Badge Stati */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge.attiva { background: #D1FAE5; color: #065F46; }
.badge.sospesa { background: #FEE2E2; color: #991B1B; }

/* Alert Messaggi */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* Pagine Commemorative / Statiche */
.memorial-page {
    max-width: 800px;
    background: var(--bg-card);
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 40px auto;
    border: 1px solid var(--border-color);
    text-align: center;
}

.memorial-photo {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg-light);
    box-shadow: var(--shadow);
    margin: 0 auto 20px;
}

.memorial-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.memorial-header .dates {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-weight: 500;
}

.memorial-bio {
    text-align: left;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.memorial-bio h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.static-page {
    max-width: 900px;
    background: var(--bg-card);
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 40px auto;
    border: 1px solid var(--border-color);
}

.static-page h2 {
    font-size: 2.3rem;
    margin-bottom: 15px;
}

.static-page .subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.steps-grid, .benefits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.step-card, .benefit-box {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    position: relative;
}

.step-number {
    display: inline-block;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: var(--bg-card);
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: var(--bg-card);
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links a {
    color: #CBD5E1;
    margin: 0 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--bg-card);
}

/* Utility Classi */
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 25px; }
.text-center { text-align: center; }

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2.1rem; }
    .header-container { flex-direction: column; gap: 15px; }
    .main-nav { gap: 10px; flex-wrap: wrap; justify-content: center; }
}