@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #faf9fd;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f4f3f7;
    
    --primary: #002045;       /* Dark Institutional Blue */
    --primary-light: #1960a3; /* Royal Blue */
    --primary-glow: rgba(25, 96, 163, 0.08);
    
    --secondary: #1960a3;     /* Royal Blue */
    --secondary-light: #2b6cb0;
    --secondary-glow: rgba(43, 108, 176, 0.08);
    
    --text-primary: #1a1c1e;   /* Dark text */
    --text-secondary: #43474e; /* Medium Gray */
    --text-muted: #74777f;     /* Slate Gray */
    
    --border-color: #e3e2e6;
    --border-color-hover: #c4c6cf;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.2s ease-in-out;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Header & Navigation */
header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Hamburger toggle styling */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

.btn {
    background: var(--primary);
    color: #ffffff !important;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: none;
}

.btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--primary) !important;
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--bg-base);
    border-color: var(--primary-light);
}

.btn-success {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-success:hover {
    background: var(--secondary-light);
    border-color: var(--secondary-light);
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 4rem auto 2rem;
    padding: 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--primary) 30%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* Card Component */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

/* Dynamic Configurator Grid */
.configurator-wrapper {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.step-card {
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.input-icon-wrapper {
    position: relative;
}

.input-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1.1rem;
    transition: var(--transition);
}

.input-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Autocomplete suggestion dropdown */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color-hover);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 10;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.suggestion-item {
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.suggestion-pop {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Population Live Badge & Stats Info */
.info-badge {
    display: inline-flex;
    align-items: center;
    background: var(--primary-glow);
    color: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Package Options */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.package-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border-radius: var(--radius-md);
}

.package-card.recommended {
    border: 2px solid var(--primary);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.2);
}

.badge-recommended {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--text-primary);
    padding: 0.25rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.package-header {
    margin-bottom: 1.5rem;
}

.package-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.package-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 1rem 0;
}

.package-price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.package-features {
    list-style: none;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.package-features li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.package-features li::before {
    content: '✓';
    color: var(--secondary);
    font-weight: 700;
}

/* Drag and Drop Asset Upload */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.file-list {
    margin-top: 1.5rem;
    text-align: left;
}

.file-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* SEO content format specific styles */
.seo-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.seo-article h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.qa-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 2rem 0;
}

.qa-box h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.qa-box p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.article-content {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}

/* Admin / Dashboard Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #f4f3f7;
    border-right: 1px solid var(--border-color);
    padding: 2rem;
}

.sidebar-menu {
    list-style: none;
    margin-top: 2rem;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: var(--bg-surface);
    color: var(--primary);
}

.sidebar-menu a.active {
    background: var(--primary);
    color: #ffffff !important;
}

.main-content {
    padding: 3rem;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

/* Tables for partners */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: var(--bg-surface);
}

th {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color-hover);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f4f3f7;
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
}

tbody tr:nth-child(even) {
    background-color: #faf9fd;
}

tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

tr:hover td {
    background: var(--bg-surface-hover);
}

.status-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-accepted { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-completed { background: rgba(16, 185, 129, 0.15); color: #10b981; }

/* Grid of features in post-purchase dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Footer styling */
footer {
    background: var(--primary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 2rem;
    margin-top: 6rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo-desc h3 {
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-links h4 {
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #cbd5e1;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Responsive adjustment */
@media(max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* simple stack for mobile dashboard */
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .logo {
        font-size: 1.05rem; /* Ridotto per evitare overlap su mobile */
        gap: 0.35rem;
    }
    .logo-img {
        width: 42px !important; /* Ridimensionato su mobile */
        height: 42px !important;
    }
    .menu-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
        gap: 1rem;
        box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }
}
