/* =========================================
   Variabili CSS – Factory Guarding
   ========================================= */
:root {
    --fg-primary:        #1b3a5c;
    --fg-primary-dark:   #132b45;
    --fg-accent:         #00a8cc;
    --fg-accent-dark:    #007fa0;
    --navbar-height:     76px;
    --bs-primary:        var(--fg-primary);
}

/* =========================================
   Reset / Base
   ========================================= */
html {
    font-size: 14px;
    font-family: 'Montserrat', Arial, sans-serif;
    background: #f4f7fb;
    color: #222;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    font-size: 1rem;
    background: #f4f7fb;
    color: #222;
    padding-top: var(--navbar-height);
}

/* =========================================
   Utilità brand
   ========================================= */
.text-fg-primary { color: var(--fg-primary) !important; }
.text-fg-accent  { color: var(--fg-accent)  !important; }
.fw-700          { font-weight: 700 !important; }
.fw-600          { font-weight: 600 !important; }
.py-6            { padding-top: 4.5rem !important; padding-bottom: 4.5rem !important; }
.mb-6            { margin-bottom: 4.5rem !important; }

/* =========================================
   Pulsanti
   ========================================= */
.btn-fg {
    background-color: var(--fg-accent);
    border-color: var(--fg-accent);
    color: #fff;
    font-weight: 600;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-fg:hover,
.btn-fg:focus {
    background-color: var(--fg-accent-dark);
    border-color: var(--fg-accent-dark);
    color: #fff;
}

.btn-outline-fg {
    border-color: var(--fg-accent);
    color: var(--fg-accent);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-outline-fg:hover {
    background-color: var(--fg-accent);
    color: #fff;
}

/* =========================================
   Navbar
   ========================================= */
.navbar {
    background: rgba(27, 58, 92, 0.97);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    min-height: var(--navbar-height);
}

.navbar-brand { font-size: 1.3rem; color: #fff !important; }

/* Forza il testo del brand navbar sempre bianco,
   anche se .text-fg-primary eredita color: #1a2535 dai titoli */
.navbar-brand span {
    color: #fff !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-nav .btn-fg.nav-link {
    color: #fff !important;
    background-color: var(--fg-accent);
}

.navbar-toggler { border-color: rgba(255,255,255,0.3); }
.navbar-toggler-icon { filter: invert(1); }

/* =========================================
   Hero Section
   ========================================= */
.hero-section {
    background: linear-gradient(135deg, var(--fg-primary) 0%, #0d2438 100%);
    min-height: calc(100vh - var(--navbar-height));
    padding: 4rem 0;
}

/* Dashboard mockup nel hero */
.mockup-screen {
    background: #1e2d3d;
    border: 1px solid rgba(255,255,255,0.08);
    max-width: 460px;
    margin: 0 auto;
}

.mockup-bar { }

.mockup-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.mockup-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    color: #fff;
    text-align: center;
}

.mockup-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.2rem;
}

.mockup-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

/* =========================================
   Page Banner (pagine interne)
   ========================================= */
.page-banner {
    position: relative;
    background: linear-gradient(135deg, var(--fg-primary) 0%, #0d2438 100%);
    padding: 5rem 0 4rem;
    overflow: hidden;
}

.page-banner::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");
}

.page-banner__overlay { display: none; }

.page-banner__title {
    position: relative;
    z-index: 1;
    color: #fff;
}

.page-banner__title h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}

/* =========================================
   Pillar cards (homepage)
   ========================================= */
.pillar-card {
    background: #fff;
    border: 1px solid #e8edf5;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pillar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

.pillar-card.featured {
    border-color: var(--fg-accent);
    box-shadow: 0 4px 20px rgba(0, 168, 204, 0.15) !important;
}

.pillar-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--fg-primary) 0%, var(--fg-accent) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: #fff;
}

/* =========================================
   Flow steps (homepage "come funziona")
   ========================================= */
.flow-step {
    padding: 1.5rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8edf5;
}

.flow-step.featured {
    background: var(--fg-primary);
    border-color: var(--fg-primary);
    color: #fff;
}

.flow-step.featured p { color: rgba(255,255,255,0.7); }

.flow-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--fg-accent) 0%, var(--fg-accent-dark) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin: 0 auto 0.75rem;
}

/* =========================================
   CTA Strip
   ========================================= */
.cta-strip {
    background: linear-gradient(135deg, var(--fg-primary) 0%, var(--fg-primary-dark) 100%);
}

/* =========================================
   Feature badge
   ========================================= */
.feature-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 168, 204, 0.1);
    color: var(--fg-accent);
    border: 1px solid rgba(0, 168, 204, 0.3);
    border-radius: 20px;
    padding: 0.3rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Feature visual placeholder */
.feature-visual {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fb 100%);
    border: 1px dashed rgba(0, 168, 204, 0.3);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.4rem 0;
    font-weight: 500;
}

/* Alarm type cards */
.alarm-type-card {
    background: #f8fafc;
    border: 1px solid #e8edf5;
}

/* =========================================
   Architettura
   ========================================= */
.arch-layer {
    background: #fff;
    border: 1px solid #e8edf5;
}

.arch-layer--server {
    border-color: var(--fg-accent);
    background: linear-gradient(135deg, #f0faff 0%, #fff 100%);
}

.arch-layer-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--fg-primary) 0%, var(--fg-accent) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin: 0 auto;
}

.arch-layer-icon.featured {
    width: 72px;
    height: 72px;
    font-size: 2rem;
}

.arch-layer-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fg-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.arch-component-card {
    background: #f4f7fb;
    border: 1px solid #e8edf5;
    font-size: 0.82rem;
}

.tech-spec-card {
    background: #fff;
    border: 1px solid #e8edf5;
}

/* =========================================
   HACCP
   ========================================= */
.haccp-stat-card {
    background: linear-gradient(135deg, var(--fg-primary) 0%, #0d2438 100%);
    color: #fff;
}

.haccp-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--fg-accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.haccp-stat-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.timeline-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--fg-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.alert-fg {
    background: rgba(0, 168, 204, 0.08);
    border: 1px solid rgba(0, 168, 204, 0.3);
    color: var(--fg-primary);
    border-radius: 8px;
}

.haccp-req-card {
    background: #fff;
    border: 1px solid #e8edf5;
    transition: transform 0.2s, box-shadow 0.2s;
}

.haccp-req-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.08) !important;
}

/* =========================================
   Contatti
   ========================================= */
.contact-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, var(--fg-primary), var(--fg-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.contact-form-card {
    background: #fff;
    border: 1px solid #e8edf5;
}

/* =========================================
   Footer
   ========================================= */
footer {
    background: #111a24;
    color: #fff;
    font-size: 0.92rem;
}

/* Titoli nel footer: sovrascrive la regola globale h1-h6 { color: #1a2535 } */
footer h1, footer h2, footer h3,
footer h4, footer h5, footer h6 {
    color: #fff;
}

/* .text-muted nel footer: Bootstrap usa #6c757d, invisibile su sfondo scuro */
footer .text-muted {
    color: rgba(255, 255, 255, 0.55) !important;
}

footer a { transition: color 0.2s; }

/* Link nel footer */
footer a.text-muted {
    color: rgba(255, 255, 255, 0.55) !important;
}

footer a.text-muted:hover,
.footer-link:hover {
    color: var(--fg-accent) !important;
    text-decoration: none;
}

/* Separatore footer */
footer hr {
    border-color: rgba(255, 255, 255, 0.12) !important;
    opacity: 1;
}

/* =========================================
   Form
   ========================================= */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dde3ef;
    font-size: 0.95rem;
    padding: 0.6rem 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--fg-accent);
    box-shadow: 0 0 0 0.2rem rgba(0, 168, 204, 0.15);
}

.form-label { font-size: 0.9rem; color: #444; }

/* =========================================
   Tipografia
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    color: #1a2535;
}

a {
    color: var(--fg-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: var(--fg-accent-dark); text-decoration: underline; }

/* =========================================
   Card generiche
   ========================================= */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: none;
}

/* =========================================
   Scrollbar
   ========================================= */
::-webkit-scrollbar { width: 8px; background: #e8edf5; }
::-webkit-scrollbar-thumb { background: #b0bdd0; border-radius: 4px; }

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 767.98px) {
    .page-banner { padding: 3.5rem 0 2.5rem; }
    .page-banner__title h1 { font-size: 1.6rem; }
    .hero-section { min-height: auto; padding: 2.5rem 0; }
}

/* =========================================
   Ideal-for strip (homepage "Particolarmente adatto a")
   ========================================= */
.ideal-for-strip {
    background: linear-gradient(135deg, #0d2438 0%, var(--fg-primary) 100%);
}

.ideal-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background-color 0.2s, transform 0.2s;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ideal-chip:hover {
    background: rgba(0, 168, 204, 0.18);
    transform: translateY(-2px);
}

/* Forza i titoli h* dentro ideal-for-strip a restare bianchi
   (sovrascrive la regola globale h1-h6 { color: #1a2535 }) */
.ideal-for-strip h1, .ideal-for-strip h2, .ideal-for-strip h3,
.ideal-for-strip h4, .ideal-for-strip h5, .ideal-for-strip h6 {
    color: #fff;
}