/*
 * P-Tech S.r.l. – Shared Design System CSS
 * Consolidated styles shared across all pages.
 * DO NOT duplicate these rules inline in HTML files.
 * Page-specific component styles are included at the bottom.
 */

/* ── Base ────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #F8FAFC;
    color: #1F2937;
}

/* ── Images: prevent layout shift ───────────────────── */
img {
    max-width: 100%;
    height: auto;
}

/* ── Skip navigation link (accessibility) ───────────── */
.skip-link {
    position: absolute;
    top: -999px;
    left: 0;
    padding: 0.5rem 1rem;
    background: #F2994A;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 6px 0;
}
.skip-link:focus {
    top: 0;
}

/* ── Beta/staging announcement bar ──────────────────── */
/* RIMUOVERE prima del lancio ufficiale                  */
.beta-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: 36px;
    background: #D97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    gap: 0.5rem;
}
/* Sposta l'header sotto la beta-bar quando presente */
body:has(.beta-bar) .header-glass {
    top: 36px;
}

/* ── Header glassmorphism ────────────────────────────── */
.header-glass {
    background: rgba(10, 37, 64, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Logo nell'header ────────────────────────────────── */
.header-glass img[alt="P-Tech S.r.l."] {
    height: 2.5rem;
    width: auto;
}
@media (min-width: 1024px) {
    .header-glass img[alt="P-Tech S.r.l."] {
        height: 3rem;
    }
}

/* ── Nav link con sottolineatura accent ──────────────── */
.nav-link {
    position: relative;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #F2994A;
    transition: width 0.25s ease;
}
.nav-link:hover        { color: #F2994A; }
.nav-link:hover::after { width: 100%; }

/* Voce attiva */
.nav-link-active        { color: #F2994A !important; }
.nav-link-active::after { width: 100%; }

/* ── Dropdown menu Servizi ───────────────────────────── */
.nav-dropdown { position: relative; }
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown:hover > a .dropdown-chevron,
.nav-dropdown:focus-within > a .dropdown-chevron { transform: rotate(180deg); }
.dropdown-chevron { transition: transform 0.2s ease; }
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    margin: 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.dropdown-item:hover  { color: #2F80ED; background-color: #EBF5FF; }
.dropdown-item.active { color: #2F80ED; background-color: #EBF5FF; font-weight: 600; }

/* ── Focus visible global improvement ───────────────── */
:focus-visible {
    outline: 2px solid #2F80ED;
    outline-offset: 2px;
}

/* ── Selection highlight ─────────────────────────────── */
::selection {
    background-color: rgba(47, 128, 237, 0.2);
    color: #0A2540;
}

/* ─────────────────────────────────────────────────────
   PAGE-SPECIFIC COMPONENT STYLES
   These are used by one page each but kept here to avoid
   any inline <style> blocks across the project.
───────────────────────────────────────────────────── */

/* ── Stat number: fluid type (index.html) ───────────── */
.stat-number {
    font-size: clamp(2.8rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1;
    color: #0A2540;
    letter-spacing: -0.02em;
}

/* ── Pillar number decorativo (servizi.html) ─────────── */
.pillar-number {
    font-size: clamp(3.5rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #0A2540;
    opacity: 0.06;
    pointer-events: none;
    user-select: none;
}

/* ── Timeline (chi-siamo.html) ───────────────────────── */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #2F80ED, #0A2540);
    transform: translateX(-50%);
}
@media (max-width: 767px) {
    .timeline-line { left: 1.5rem; }
}

/* ── Referenza card (settore-ospedaliero.html) ───────── */
.ref-card {
    border-left: 3px solid #F2994A;
    transition: border-left-color 0.2s ease;
}
.ref-card:hover {
    border-left-color: #2F80ED;
}

/* ── Form fields (contatti.html) ─────────────────────── */
.form-field {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #1F2937;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-field::placeholder { color: #9CA3AF; }
.form-field:focus {
    border-color: #2F80ED;
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

/* ── Sede card hover (contatti.html) ─────────────────── */
.sede-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sede-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(10, 37, 64, 0.10);
}

/* ── Legal content (privacy-policy.html, cookie-policy.html) */
.legal-content h2 { font-size: 1.25rem; font-weight: 700; color: #0A2540; margin-top: 2.5rem; margin-bottom: 0.75rem; }
.legal-content h3 { font-size: 1rem; font-weight: 600; color: #0A2540; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.legal-content p  { font-size: 0.9375rem; color: #374151; line-height: 1.75; margin-bottom: 1rem; }
.legal-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-content ul li { font-size: 0.9375rem; color: #374151; line-height: 1.75; margin-bottom: 0.25rem; }
.legal-content a  { color: #2F80ED; text-decoration: underline; }
.legal-content a:hover { color: #0A2540; }

/* ── Cookie table (cookie-policy.html) ───────────────── */
.cookie-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.cookie-table th { background-color: #0A2540; color: #ffffff; text-align: left; padding: 0.625rem 0.875rem; font-weight: 600; }
.cookie-table td { padding: 0.625rem 0.875rem; border-bottom: 1px solid #E5E7EB; color: #374151; vertical-align: top; }
.cookie-table tr:last-child td { border-bottom: none; }
.cookie-table tr:nth-child(even) td { background-color: #F8FAFC; }
