/* MMC Client Portal — Styles */

:root {
    --primary: #333333;
    --primary-dark: #222222;
    --accent-gold: #FFC648;
    --accent-red: #ED1C24;
    --gradient: linear-gradient(135deg, #FFC648, #ED1C24);
    --text: #2b2b2b;
    --text-muted: #666666;
    --text-light: #888888;
    --bg: #fafafa;
    --card-bg: #ffffff;
    --border: #e8e8e8;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ── */

.public-nav, .portal-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-brand {
    display: flex;
    align-items: center;
}
.nav-brand img { height: 80px; width: auto; }
.nav-brand:hover { text-decoration: none; opacity: 0.85; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-links a { color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-user { color: var(--text-muted); font-size: 0.85rem; }

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: #ffffff;
    border: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    letter-spacing: 0.02em;
}
.btn-primary:hover { background: linear-gradient(135deg, #e6b23e, #d4191f); box-shadow: 0 4px 12px rgba(237,28,36,0.25); text-decoration: none; }

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); text-decoration: none; }

.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.btn-google {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
}
.btn-google:hover { background: var(--bg); box-shadow: var(--shadow); text-decoration: none; }

/* ── Main content ── */

main {
    min-height: 60vh;
}

.portal-nav ~ main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ── Cards ── */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* ── Dashboard ── */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.dashboard-card h3 { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.dashboard-card-number { font-size: 2.5rem; font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; }

/* ── Detail grid ── */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.detail-item { }
.detail-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.detail-value { font-size: 0.95rem; }

/* ── Tables ── */

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0.75rem 0.5rem; border-bottom: 2px solid var(--border); }
.table td { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table tr:last-child td { border-bottom: none; }

/* ── Badges ── */

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-muted);
}
.badge-attivo { background: #dcfce7; color: #166534; }
.badge-inattivo { background: #fef2f2; color: #991b1b; }
.badge-scaduto { background: #fef2f2; color: #991b1b; }
.badge-bozza { background: #fef9c3; color: #854d0e; }

/* ── Alerts ── */

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Homepage Hero ── */

.home-hero {
    background: #1e1e1e;
    color: #ffffff;
    padding: 3rem 2rem 3.5rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.home-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    background: url('/static/img/icona-bianco.svg') no-repeat center;
    background-size: contain;
    opacity: 0.035;
    pointer-events: none;
}
.home-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}
.home-hero-inner {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.home-hero h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
    color: #ffffff;
    line-height: 1.15;
}
.home-hero-divider {
    width: 48px;
    height: 3px;
    background: var(--gradient);
    margin: 0 auto 1rem;
    border: none;
    border-radius: 2px;
}
.home-hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 1.75rem;
    line-height: 1.6;
    font-weight: 400;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.25rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.btn-hero:hover {
    background: linear-gradient(135deg, #e6b23e, #d4191f);
    box-shadow: 0 8px 28px rgba(237,28,36,0.35);
    text-decoration: none;
    transform: translateY(-2px);
}

/* ── Homepage Services ── */

.home-services {
    padding: 2.5rem 2rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}
.home-services-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.home-services-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}
.home-services-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.home-services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}
.home-service-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
}
.home-service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 3px;
    background: var(--gradient);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.home-service-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}
.home-service-card:hover::after {
    opacity: 1;
}
.home-service-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
    letter-spacing: -0.01em;
}
.home-service-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ── Homepage Contact (removed — integrated into footer) ── */

/* ── Login ── */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}
.login-card h1 { margin-bottom: 0.5rem; }
.login-card p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }
.login-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 1.5rem; }

/* ── Footer ── */

.public-footer {
    background: #1e1e1e;
    border-top: none;
    padding: 3.5rem 0;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-top: 0;
}
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.footer-brand { margin-bottom: 1.25rem; }
.footer-brand img { height: 64px; width: auto; opacity: 0.9; }
.footer-divider {
    width: 40px;
    height: 2px;
    background: var(--gradient);
    margin: 1.25rem auto;
    border: none;
    border-radius: 1px;
}
.footer-contact {
    margin-top: 0.5rem;
}
.footer-contact a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-weight: 600;
}
.footer-contact a:hover {
    color: #ffffff;
    text-decoration: none;
}
.footer-tagline {
    color: rgba(255,255,255,0.35);
    font-size: 0.78rem;
    margin-top: 0.75rem;
    letter-spacing: 0.02em;
}

/* ── Utilities ── */

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

/* ── Responsive ── */

@media (max-width: 1024px) {
    .home-services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-container { flex-direction: column; align-items: flex-start; }
    .nav-links { width: 100%; justify-content: flex-start; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .detail-grid { grid-template-columns: 1fr; }
    .home-hero { padding: 3rem 1.5rem; }
    .home-hero h1 { font-size: 1.8rem; }
    .home-hero-subtitle { font-size: 0.95rem; }
    .home-hero::before { width: 220px; height: 220px; }
    .home-services { padding: 2rem 1.5rem; }
    .home-services-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .nav-brand img { height: 50px; }
    .footer-brand img { height: 40px; }
}

/* ── Form elements ── */

select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}
