/* ===== LexAlert — Stile Svizzero/Istituzionale ===== */

:root {
    --swiss-red: #E30613;
    --swiss-red-dark: #B8050F;
    --swiss-red-light: #FDE8E9;
    --gray-900: #1A1A1A;
    --gray-800: #2D2D2D;
    --gray-700: #404040;
    --gray-600: #555555;
    --gray-500: #777777;
    --gray-400: #999999;
    --gray-300: #BFBFBF;
    --gray-200: #E0E0E0;
    --gray-100: #F2F2F2;
    --gray-50: #F8F8F8;
    --white: #FFFFFF;
    --green: #1B7A3D;
    --green-light: #E8F5ED;
    --amber: #C67A00;
    --amber-light: #FFF3E0;
    --blue: #1A5276;
    --blue-light: #E8F0F7;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
    --radius: 6px;
}

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

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--swiss-red); text-decoration: none; }
a:hover { color: var(--swiss-red-dark); }

/* ===== NAVIGATION ===== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: var(--shadow-md); }
.nav-inner {
    max-width: 1140px; margin: 0 auto; padding: 0 24px;
    height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--gray-900);
}
.nav-logo-icon {
    width: 32px; height: 32px; background: var(--swiss-red);
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
}
.nav-logo-icon svg { width: 18px; height: 18px; }
.nav-logo-text {
    font-family: 'DM Serif Display', serif;
    font-size: 22px; letter-spacing: -0.5px;
}
.nav-logo-text span { color: var(--swiss-red); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
    text-decoration: none; color: var(--gray-600);
    font-size: 15px; font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover { color: var(--gray-900); }
.nav-cta {
    background: var(--swiss-red) !important; color: var(--white) !important;
    padding: 8px 20px; border-radius: var(--radius); font-weight: 600 !important;
}
.nav-cta:hover { background: var(--swiss-red-dark) !important; }

/* ===== HERO ===== */
.hero {
    padding: 140px 24px 80px;
    background: linear-gradient(175deg, var(--white) 0%, var(--gray-50) 50%, var(--gray-100) 100%);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -200px; right: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(227,6,19,0.04) 0%, transparent 70%);
}
.hero-inner {
    max-width: 1140px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--swiss-red-light); color: var(--swiss-red);
    padding: 6px 14px; border-radius: 20px; font-size: 13px;
    font-weight: 600; margin-bottom: 24px; letter-spacing: 0.3px;
}
.hero-badge::before {
    content: ''; width: 6px; height: 6px;
    background: var(--swiss-red); border-radius: 50%;
}
.hero h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 48px; line-height: 1.15; color: var(--gray-900);
    margin-bottom: 20px; letter-spacing: -0.5px;
}
.hero h1 em { color: var(--swiss-red); font-style: italic; }
.hero-desc {
    font-size: 18px; color: var(--gray-600);
    margin-bottom: 36px; line-height: 1.7; max-width: 480px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: var(--radius);
    font-size: 15px; font-weight: 600; text-decoration: none;
    transition: all 0.2s; cursor: pointer; border: none; font-family: inherit;
}
.btn-primary { background: var(--swiss-red); color: var(--white); }
.btn-primary:hover { background: var(--swiss-red-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: #DC3545; color: var(--white); }
.btn-danger:hover { background: #B02A37; color: var(--white); }
.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #14612F; color: var(--white); }

/* ===== HERO VISUAL ===== */
.hero-visual {
    background: var(--white); border-radius: 12px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200); overflow: hidden;
}
.hero-visual-header {
    background: var(--gray-900); padding: 14px 20px;
    display: flex; align-items: center; gap: 8px;
}
.hero-visual-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-700); }
.hero-visual-dot:nth-child(1) { background: #FF5F57; }
.hero-visual-dot:nth-child(2) { background: #FFBD2E; }
.hero-visual-dot:nth-child(3) { background: #28C840; }
.hero-visual-body { padding: 24px; }
.mini-alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px; border-radius: var(--radius); margin-bottom: 10px;
    animation: slideIn 0.5s ease-out both;
}
.mini-alert:nth-child(1) { animation-delay: 0.3s; }
.mini-alert:nth-child(2) { animation-delay: 0.6s; }
.mini-alert:nth-child(3) { animation-delay: 0.9s; }
.mini-alert-red { background: var(--swiss-red-light); border-left: 3px solid var(--swiss-red); }
.mini-alert-amber { background: var(--amber-light); border-left: 3px solid var(--amber); }
.mini-alert-green { background: var(--green-light); border-left: 3px solid var(--green); }
.mini-alert-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.mini-alert-text { font-size: 13px; line-height: 1.5; }
.mini-alert-title { font-weight: 600; color: var(--gray-900); }
.mini-alert-sub { color: var(--gray-500); font-size: 12px; margin-top: 2px; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== FEATURES ===== */
.features { padding: 80px 24px; background: var(--white); }
.features-inner { max-width: 1140px; margin: 0 auto; }
.section-label {
    font-size: 13px; font-weight: 600; color: var(--swiss-red);
    letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 12px;
}
.section-title {
    font-family: 'DM Serif Display', serif;
    font-size: 36px; color: var(--gray-900); margin-bottom: 16px;
}
.section-desc {
    font-size: 17px; color: var(--gray-500);
    max-width: 560px; margin-bottom: 48px; line-height: 1.7;
}
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.feature-card {
    padding: 32px; border: 1px solid var(--gray-200);
    border-radius: 10px; transition: all 0.3s; position: relative;
}
.feature-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--swiss-red); border-radius: 10px 10px 0 0;
    opacity: 0; transition: opacity 0.3s;
}
.feature-card:hover::after { opacity: 1; }
.feature-icon {
    width: 44px; height: 44px; background: var(--gray-100);
    border-radius: 10px; display: flex; align-items: center;
    justify-content: center; margin-bottom: 20px;
}
.feature-icon svg { width: 22px; height: 22px; color: var(--swiss-red); }
.feature-card h3 { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 10px; }
.feature-card p { font-size: 15px; color: var(--gray-500); line-height: 1.6; }

/* ===== PRICING ===== */
.pricing { padding: 80px 24px; background: var(--gray-50); }
.pricing-inner { max-width: 1140px; margin: 0 auto; text-align: center; }
.pricing-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; margin-top: 48px; text-align: left;
}
.price-card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: 10px; padding: 36px 32px; position: relative; transition: all 0.3s;
}
.price-card:hover { box-shadow: var(--shadow-md); }
.price-card.featured { border-color: var(--swiss-red); box-shadow: var(--shadow-lg); }
.price-card.featured::before {
    content: 'Consigliato'; position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%); background: var(--swiss-red); color: var(--white);
    font-size: 12px; font-weight: 700; padding: 4px 16px;
    border-radius: 20px; letter-spacing: 0.5px;
}
.price-name {
    font-size: 14px; font-weight: 600; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.price-amount {
    font-family: 'DM Serif Display', serif;
    font-size: 42px; color: var(--gray-900); margin-bottom: 4px;
}
.price-amount span { font-family: 'Source Sans 3', sans-serif; font-size: 16px; color: var(--gray-400); font-weight: 400; }
.price-desc { font-size: 14px; color: var(--gray-500); margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--gray-200); }
.price-features { list-style: none; margin-bottom: 32px; }
.price-features li {
    font-size: 14px; color: var(--gray-700); padding: 6px 0;
    display: flex; align-items: center; gap: 10px;
}
.price-features li::before { content: '✓'; color: var(--green); font-weight: 700; }
.price-btn {
    display: block; width: 100%; text-align: center; padding: 12px;
    border-radius: var(--radius); font-size: 15px; font-weight: 600; text-decoration: none;
}
.price-btn-primary { background: var(--swiss-red); color: var(--white); }
.price-btn-primary:hover { background: var(--swiss-red-dark); color: var(--white); }
.price-btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.price-btn-secondary:hover { background: var(--gray-200); }

/* ===== CTA ===== */
.cta-section {
    padding: 80px 24px; background: var(--gray-900);
    text-align: center; position: relative; overflow: hidden;
}
.cta-section::before {
    content: ''; position: absolute; top: -100px; left: 50%;
    transform: translateX(-50%); width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(227,6,19,0.15) 0%, transparent 60%);
}
.cta-section h2 { font-family: 'DM Serif Display', serif; font-size: 36px; color: var(--white); margin-bottom: 16px; position: relative; }
.cta-section p { font-size: 17px; color: var(--gray-400); margin-bottom: 36px; position: relative; }
.cta-section .btn { position: relative; }

/* ===== FOOTER ===== */
.footer { padding: 40px 24px; background: var(--gray-900); border-top: 1px solid rgba(255,255,255,0.08); }
.footer-inner { max-width: 1140px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-text { font-size: 14px; color: var(--gray-500); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 14px; color: var(--gray-500); text-decoration: none; }
.footer-links a:hover { color: var(--gray-300); }

/* ===== DASHBOARD ===== */
.demo-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--gray-900); height: 56px;
    display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.demo-topbar-left { display: flex; align-items: center; gap: 12px; }
.demo-topbar .nav-logo-icon { width: 28px; height: 28px; border-radius: 3px; }
.demo-topbar .nav-logo-icon svg { width: 15px; height: 15px; }
.demo-topbar-title { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--white); }
.demo-topbar-title span { color: var(--swiss-red); }
.demo-badge {
    background: rgba(227,6,19,0.15); color: var(--swiss-red);
    font-size: 11px; font-weight: 700; padding: 3px 10px;
    border-radius: 20px; letter-spacing: 0.5px;
}
.demo-back {
    color: var(--gray-400); text-decoration: none; font-size: 14px;
    display: flex; align-items: center; gap: 6px;
}
.demo-back:hover { color: var(--white); }
.demo-body { padding: 80px 24px 40px; max-width: 1140px; margin: 0 auto; }
.demo-welcome { margin-bottom: 32px; }
.demo-welcome h1 { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--gray-900); margin-bottom: 6px; }
.demo-welcome p { font-size: 15px; color: var(--gray-500); }
.demo-company-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--white); border: 1px solid var(--gray-200);
    padding: 6px 14px; border-radius: 20px; font-size: 13px; color: var(--gray-600); margin-top: 12px;
}
.demo-company-badge strong { color: var(--gray-900); }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: 10px; padding: 22px 24px; position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; }
.stat-card-red::before { background: var(--swiss-red); }
.stat-card-amber::before { background: var(--amber); }
.stat-card-green::before { background: var(--green); }
.stat-card-blue::before { background: var(--blue); }
.stat-number { font-family: 'DM Serif Display', serif; font-size: 32px; color: var(--gray-900); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }

/* Dashboard grid */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dash-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; }
.dash-card-header {
    padding: 18px 24px; border-bottom: 1px solid var(--gray-100);
    display: flex; justify-content: space-between; align-items: center;
}
.dash-card-header h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 8px; }
.dash-card-header h3 svg { width: 18px; height: 18px; color: var(--gray-400); }
.dash-card-count { font-size: 12px; background: var(--gray-100); color: var(--gray-600); padding: 2px 10px; border-radius: 10px; font-weight: 600; }

/* Scadenze */
.scadenza-item {
    padding: 16px 24px; border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: flex-start; gap: 14px; transition: background 0.15s;
}
.scadenza-item:hover { background: var(--gray-50); }
.scadenza-item:last-child { border-bottom: none; }
.scadenza-urgency { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; }
.urgency-high { background: var(--swiss-red); box-shadow: 0 0 0 3px var(--swiss-red-light); }
.urgency-medium { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-light); }
.urgency-low { background: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.scadenza-content { flex: 1; }
.scadenza-title { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 3px; }
.scadenza-desc { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.scadenza-date { flex-shrink: 0; text-align: right; }
.scadenza-date-day { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.scadenza-date-diff { font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.date-urgent { background: var(--swiss-red-light); color: var(--swiss-red); }
.date-warning { background: var(--amber-light); color: var(--amber); }
.date-ok { background: var(--green-light); color: var(--green); }

/* Normative */
.norma-item { padding: 16px 24px; border-bottom: 1px solid var(--gray-100); transition: background 0.15s; }
.norma-item:hover { background: var(--gray-50); }
.norma-item:last-child { border-bottom: none; }
.norma-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.norma-source { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--gray-400); }
.norma-date { font-size: 12px; color: var(--gray-400); }
.norma-title { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 6px; line-height: 1.4; }
.norma-summary { font-size: 13px; color: var(--gray-500); line-height: 1.6; margin-bottom: 10px; }
.norma-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.norma-tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 4px; background: var(--gray-100); color: var(--gray-600); }
.norma-tag-red { background: var(--swiss-red-light); color: var(--swiss-red); }
.norma-tag-blue { background: var(--blue-light); color: var(--blue); }

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: 100vh; padding-top: 56px; }
.admin-sidebar {
    width: 240px; background: var(--white); border-right: 1px solid var(--gray-200);
    padding: 24px 0; position: fixed; top: 56px; bottom: 0; overflow-y: auto;
}
.admin-sidebar-nav { list-style: none; }
.admin-sidebar-nav li a {
    display: flex; align-items: center; gap: 10px; padding: 10px 24px;
    font-size: 14px; font-weight: 500; color: var(--gray-600);
    text-decoration: none; transition: all 0.15s;
}
.admin-sidebar-nav li a:hover { background: var(--gray-50); color: var(--gray-900); }
.admin-sidebar-nav li a.active { background: var(--swiss-red-light); color: var(--swiss-red); font-weight: 600; border-right: 3px solid var(--swiss-red); }
.admin-sidebar-nav li a svg { width: 18px; height: 18px; }
.admin-content { flex: 1; margin-left: 240px; padding: 32px; }
.admin-content h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 24px; color: var(--gray-900); margin-bottom: 24px;
}
.admin-topbar-actions { display: flex; gap: 12px; align-items: center; }

/* Admin Tables */
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 10px; overflow: hidden; border: 1px solid var(--gray-200); }
.admin-table th {
    text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
    color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px;
    background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}
.admin-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }

/* Admin Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300);
    border-radius: var(--radius); font-size: 14px; font-family: inherit;
    color: var(--gray-800); transition: border-color 0.2s; background: var(--white);
}
.form-control:focus { outline: none; border-color: var(--swiss-red); box-shadow: 0 0 0 3px var(--swiss-red-light); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* Login */
.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--gray-100);
}
.login-card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: 12px; padding: 48px 40px; width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-card h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 24px; color: var(--gray-900); margin-bottom: 8px; text-align: center;
}
.login-card p { font-size: 14px; color: var(--gray-500); text-align: center; margin-bottom: 32px; }
.login-logo { text-align: center; margin-bottom: 24px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { max-width: 500px; }
    .hero h1 { font-size: 36px; }
    .features-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin-left: auto; margin-right: auto; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
    .admin-sidebar { display: none; }
    .admin-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 30px; }
    .hero { padding: 120px 16px 60px; }
    .stats-row { grid-template-columns: 1fr; }
}
