/* ============================================================
   GeroService - Foglio stile principale
   ============================================================ */

:root {
    --primary:       #1a3a6e;
    --primary-light: #2455a0;
    --primary-pale:  #e8f0fe;
    --accent:        #f97316;
    --accent-dark:   #ea6c0a;
    --success:       #16a34a;
    --danger:        #dc2626;
    --dark:          #0f1c2e;
    --gray-100:      #f8fafc;
    --gray-200:      #f1f5f9;
    --gray-300:      #e2e8f0;
    --gray-500:      #64748b;
    --gray-700:      #334155;
    --text:          #1e293b;
    --sidebar-w:     260px;
    --topbar-h:      60px;
    --radius:        12px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:        0 4px 16px rgba(0,0,0,.1);
    --shadow-lg:     0 10px 40px rgba(0,0,0,.15);
    --transition:    .2s ease;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background: var(--gray-100);
    line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; }

img { max-width: 100%; }

a { color: var(--primary-light); }
a:hover { color: var(--primary); }

.fw-600 { font-weight: 600; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    font-size: .8rem;
    z-index: 1031;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    z-index: 1030;
}

.brand-logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -.5px; }
.brand-g    { color: var(--primary); }
.brand-s    { color: var(--accent); }

.nav-link {
    font-weight: 500;
    font-size: .9rem;
    color: var(--gray-700) !important;
    padding: .5rem .75rem !important;
    border-radius: 8px;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
    background: var(--primary-pale);
    color: var(--primary) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,58,110,.4);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: transform var(--transition), box-shadow var(--transition);
}
.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249,115,22,.4);
    color: #fff;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: 8px;
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    min-height: 540px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-badge {
    display: inline-block;
    background: rgba(249,115,22,.15);
    color: var(--accent);
    border: 1px solid rgba(249,115,22,.3);
    border-radius: 50px;
    padding: .3rem 1rem;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: .5px;
}

.hero-shape {
    position: absolute;
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}
.hero-shape-2 {
    right: 80px;
    width: 300px;
    height: 300px;
    background: rgba(249,115,22,.08);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section-badge {
    display: inline-block;
    background: var(--primary-pale);
    color: var(--primary-light);
    border-radius: 50px;
    padding: .25rem .9rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--dark);
}

.section-subtitle {
    color: var(--gray-500);
    font-size: 1.05rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Feature cards */
.feature-card {
    border: none;
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}
.fi-blue   { background: var(--primary-pale); color: var(--primary); }
.fi-orange { background: #fff4ed; color: var(--accent); }
.fi-green  { background: #f0fdf4; color: var(--success); }
.fi-purple { background: #f5f3ff; color: #7c3aed; }

/* Product cards */
.product-card {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.product-card-img {
    height: 180px;
    object-fit: contain;
    padding: 1.25rem;
    background: var(--gray-100);
}
.product-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.product-price-old {
    font-size: .85rem;
    color: var(--gray-500);
    text-decoration: line-through;
}
.badge-novita {
    background: var(--accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: .25rem .6rem;
    border-radius: 6px;
    letter-spacing: .3px;
}

/* News cards */
.news-card {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.news-date { font-size: .78rem; color: var(--gray-500); }
.news-card .card-body { padding: 1.25rem; }

/* ============================================================
   STATS / COUNTERS
   ============================================================ */
.stats-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.stat-item { color: #fff; text-align: center; }
.stat-number { font-size: 2.5rem; font-weight: 800; }
.stat-label { font-size: .9rem; opacity: .8; }

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    border-radius: 20px;
    padding: 3.5rem 2.5rem;
    color: #fff;
    text-align: center;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--dark); }

.footer-top { padding: 3.5rem 0 2.5rem; }

.footer-heading {
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: .6rem;
    font-size: .88rem;
    color: rgba(255,255,255,.55);
}
.footer-links a {
    color: rgba(255,255,255,.55);
    text-decoration: none;
    transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }

.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 1rem;
    transition: background var(--transition), color var(--transition);
}
.footer-social:hover {
    background: var(--accent);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 1.25rem 0;
}

/* ============================================================
   LOGIN / REGISTER PAGES
   ============================================================ */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2.25rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.form-control, .form-select {
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    padding: .65rem 1rem;
    font-size: .9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(36,85,160,.12);
    outline: none;
}

.input-icon-group {
    position: relative;
}
.input-icon-group .form-control {
    padding-left: 2.75rem;
}
.input-icon-group .bi {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 1rem;
    pointer-events: none;
}

/* ============================================================
   PAGE HERO (sub-pages)
   ============================================================ */
.page-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    padding: 3.5rem 0;
    color: #fff;
}
.page-hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.breadcrumb-item.active { color: rgba(255,255,255,.6); }
.breadcrumb-item a { color: rgba(255,255,255,.8); text-decoration: none; }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.4); }

/* ============================================================
   DASHBOARD / AREA RISERVATA
   ============================================================ */
.dashboard-body {
    background: var(--gray-200);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--dark) 0%, var(--primary) 100%);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 1rem .75rem;
    flex: 1;
}

.sidebar-section {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.4);
    padding: .5rem .75rem;
    margin-top: .5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    border-radius: 8px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    margin-bottom: 2px;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.sidebar-link.active {
    background: rgba(255,255,255,.15);
    color: #fff;
    font-weight: 600;
}
.sidebar-link.text-danger-soft { color: rgba(248,113,113,.8); }
.sidebar-link.text-danger-soft:hover { background: rgba(220,38,38,.15); color: #f87171; }
.sidebar-link .bi { font-size: 1rem; width: 1rem; flex-shrink: 0; }

/* Dashboard content */
.dashboard-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Dashboard topbar */
.dashboard-topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--gray-300);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.dashboard-main {
    padding: 2rem 1.75rem;
    flex: 1;
}

/* Dashboard cards */
.dash-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.sci-blue   { background: var(--primary-pale); color: var(--primary); }
.sci-orange { background: #fff4ed; color: var(--accent); }
.sci-green  { background: #f0fdf4; color: var(--success); }
.sci-red    { background: #fef2f2; color: var(--danger); }

.stat-card-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-card-label { font-size: .8rem; color: var(--gray-500); font-weight: 500; margin-top: .2rem; }

/* Tables */
.table { font-size: .875rem; }
.table th { font-weight: 600; color: var(--gray-700); background: var(--gray-100); }
.table td { vertical-align: middle; }

/* Badges */
.badge { font-weight: 600; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .75rem;
    font-weight: 600;
    padding: .3rem .7rem;
    border-radius: 50px;
}
.sb-pending  { background: #fff4ed; color: var(--accent); }
.sb-success  { background: #f0fdf4; color: var(--success); }
.sb-danger   { background: #fef2f2; color: var(--danger); }
.sb-info     { background: #eff6ff; color: #2563eb; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay.show {
        display: block;
    }
    .dashboard-content {
        margin-left: 0;
    }
    .dashboard-main {
        padding: 1.25rem 1rem;
    }
}

/* ============================================================
   ADMIN SPECIFIC
   ============================================================ */
.admin-actions .btn { font-size: .8rem; padding: .3rem .65rem; }

/* ============================================================
   UTILITIES
   ============================================================ */
.bg-primary-pale { background: var(--primary-pale) !important; }
.text-primary     { color: var(--primary) !important; }
.text-accent      { color: var(--accent) !important; }

.rounded-xl { border-radius: var(--radius) !important; }

.shadow-card { box-shadow: var(--shadow) !important; }

/* ============================================================
   LOGO SITO
   ============================================================ */
.site-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}
.site-logo-sidebar {
    height: 30px;
    filter: brightness(0) invert(1);
}

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 3px solid var(--primary);
    box-shadow: 0 -4px 24px rgba(0,0,0,.14);
    z-index: 9999;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 220px;
}
.cookie-banner-text strong { display: block; margin-bottom: .25rem; color: var(--dark); }

.cookie-banner-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-btn-prefs {
    background: var(--gray-200);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-weight: 600;
    font-size: .82rem;
    padding: .45rem 1rem;
}
.cookie-btn-prefs:hover { background: var(--gray-300); }

.cookie-btn-reject {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-weight: 600;
    font-size: .82rem;
    padding: .45rem 1rem;
}
.cookie-btn-reject:hover { background: var(--gray-200); }

.cookie-btn-accept {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: .82rem;
    padding: .45rem 1.25rem;
}
.cookie-btn-accept:hover { opacity: .9; color: #fff; }

.cookie-link { color: var(--primary-light); font-weight: 600; }

.cookie-category {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--gray-300);
}

@media (max-width: 575.98px) {
    .cookie-banner { padding: 1rem; }
    .cookie-banner-inner { gap: 1rem; }
    .cookie-banner-actions { width: 100%; justify-content: flex-end; }
}

/* Scrollbar custom */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ============================================================
   FORM ELEMENTS AREA RISERVATA
   ============================================================ */
.form-label { font-weight: 600; font-size: .875rem; color: var(--gray-700); margin-bottom: .35rem; }

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 575.98px) {
    .auth-card { padding: 2rem 1.5rem; }
    .dashboard-topbar { padding: 0 1rem; }
    .hero { min-height: 420px; }
    .hero-shape { display: none; }
}
