:root {
    --primary: #0033A0; /* Deep Corporate Blue */
    --primary-hover: #002277;
    --accent: #00D1FF; /* Bright modern cyan */
    --bg-light: #F4F7FA;
    --white: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);
}

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

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

/* Navbar */
.navbar {
    background-color: var(--white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    margin-left: 2rem;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
}

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

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 2rem 8rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, #001f66 100%);
    z-index: -2;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg opacity="0.05" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="white" d="M0 0l50 50L0 100z"/></svg>') repeat;
    background-size: 100px 100px;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: var(--white);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Search Form */
.tracking-form {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    background: var(--white);
    padding: 0.5rem;
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    align-items: center;
}

.search-icon {
    color: var(--text-muted);
    margin-left: 1rem;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    background: transparent;
    font-weight: 500;
}

.btn-track {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-track:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,51,160,0.3);
}

.error-msg {
    position: absolute;
    top: 100%; left: 0; right: 0;
    margin-top: 1rem;
    background: #FEF2F2;
    color: var(--error);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.3s ease-out;
}

/* Results Section */
.results {
    flex: 1;
    padding: 2rem;
    margin-top: -4rem;
    z-index: 10;
    position: relative;
}

.result-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    animation: fadeIn 0.5s ease-out;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tracking-number .label {
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.tracking-number h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.25rem;
}

/* Stepper */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
    padding: 0 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    width: 120px;
}

.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: all 0.4s ease;
}

.step-label {
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.95rem;
}

.step-line {
    flex: 1;
    height: 4px;
    background: var(--border);
    margin: 0 -40px;
    transform: translateY(-16px);
    z-index: 1;
    transition: all 0.4s ease;
}

/* Active State (Blue default) */
.step.step-active .step-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 6px rgba(0, 51, 160, 0.1);
}
.step.step-active .step-label {
    color: var(--primary);
}
.step-line.line-active {
    background: var(--primary);
}

/* Active State (Green when delivered) */
.stepper-wrapper.is-delivered .step.step-active .step-icon {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1);
}
.stepper-wrapper.is-delivered .step.step-active .step-label {
    color: var(--success);
}
.stepper-wrapper.is-delivered .step-line.line-active {
    background: var(--success);
}

/* Failed State inside Stepper */
.failed-state {
    text-align: center;
    padding: 2rem;
    background: #FEF2F2;
    border-radius: 12px;
    border: 2px solid #FECACA;
    margin-bottom: 3rem;
}
.failed-state .error-icon {
    color: var(--error);
    margin-bottom: 1rem;
}
.failed-state h3 {
    color: #991B1B;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.failed-state p {
    color: #B91C1C;
    font-weight: 500;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.info-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.info-card h4 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.info-main {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.info-sub {
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.6;
}

.info-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 500;
}

/* Utils & Animations */
.hidden { display: none !important; }

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1rem; }
    .search-bar { flex-direction: column; border-radius: 16px; padding: 1rem; }
    .search-icon { display: none; }
    .search-bar input { text-align: center; padding: 1rem; width: 100%; }
    .btn-track { width: 100%; border-radius: 8px; }
    
    .result-container { padding: 1.5rem; }
    .result-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .info-grid { grid-template-columns: 1fr; }
    
    .stepper-wrapper { flex-direction: column; gap: 2rem; padding: 0; }
    .step-line { width: 4px; height: 40px; transform: none; margin: -1.5rem 0; }
}

/* --- NEW SECTIONS --- */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Services */
.services {
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-light);
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.service-card h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* About Us */
.about {
    background: var(--bg-light);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-image {
    flex: 1;
}

.image-placeholder {
    background: var(--white);
    height: 400px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* FAQ */
.faq {
    background: var(--white);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
}

.faq-question {
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-question:hover {
    background: var(--bg-light);
}

.faq-icon {
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    padding: 0 2rem 1.5rem;
    max-height: 200px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Extended Footer */
.footer-extended {
    background: var(--text-main);
    color: var(--text-muted);
    padding-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-desc {
    line-height: 1.6;
    max-width: 300px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--accent);
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-info svg {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .about-content {
        flex-direction: column;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container { flex-direction: column; gap: 1rem; }
    .nav-links { margin-left: 0; display: flex; gap: 1rem; }
    
    .hero { padding: 3rem 1rem 5rem; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    
    .search-bar { flex-direction: column; border-radius: 16px; padding: 1rem; gap: 0.5rem; }
    .search-icon { display: none; }
    .search-bar input { text-align: center; padding: 0.8rem; width: 100%; }
    .btn-track { width: 100%; border-radius: 8px; }
    
    .section-container { padding: 3rem 1.5rem; }
    .section-header h2 { font-size: 2rem; }
    
    .result-container { padding: 1.5rem; }
    .result-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .info-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    
    /* Stepper Verticale per Mobile */
    .stepper-wrapper { 
        flex-direction: column; 
        gap: 0; 
        padding: 0; 
        align-items: flex-start; 
        margin-left: 1rem;
    }
    .step { 
        flex-direction: row; 
        width: auto; 
        align-items: center; 
        gap: 1.5rem; 
    }
    .step-icon { 
        width: 48px; 
        height: 48px; 
        margin-bottom: 0; 
    }
    .step-label { 
        font-size: 1.1rem; 
    }
    .step-line { 
        width: 4px; 
        height: 40px; 
        margin: 0; 
        transform: translateX(22px); /* Centra la linea sotto l'icona (48/2 - 4/2) */
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.cookie-banner.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    display: flex !important; /* Override the default .hidden */
}

.cookie-content h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.cookie-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 800px;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    margin-left: 2rem;
}

.btn-accept {
    background: var(--success);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-accept:hover {
    background: #059669;
}

.btn-reject {
    background: var(--bg-light);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reject:hover {
    background: #E5E7EB;
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    .cookie-buttons {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    .cookie-buttons button {
        flex: 1;
    }
}
