/* ==========================================================================
   TDR Informatica - stile del sito (si appoggia a Bootstrap 5.3)
   Colori verificati per contrasto WCAG 2.2 AA (>= 4.5:1 per il testo)
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --tdr-ink: #172033;          /* testo principale  (17:1 su bianco) */
    --tdr-muted: #445066;        /* testo secondario  (8.6:1 su bianco) */
    --tdr-red: #c62828;          /* accento           (5.6:1 con testo bianco) */
    --tdr-red-dark: #a51f1f;     /* hover             (7.5:1) */
    --tdr-soft: #f3f6fa;
    --tdr-panel: #dde5ef;        /* pannello aziende  (ink: 12:1) */
    --tdr-line: #d5dce6;
    --tdr-focus: #0b57d0;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-color: var(--tdr-ink);
    --bs-body-bg: #fff;
    --bs-link-color: #b42323;
    --bs-link-hover-color: #8f1a1a;
    --bs-link-color-rgb: 180, 35, 35;
    --bs-link-hover-color-rgb: 143, 26, 26;
}

html { scroll-padding-top: 5.5rem; }
body { line-height: 1.65; font-size: 1.0625rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { letter-spacing: -0.015em; line-height: 1.2; color: var(--tdr-ink); }
p { max-width: 68ch; }
img { max-width: 100%; height: auto; }
.text-muted-tdr { color: var(--tdr-muted); }

/* --- Focus visibile per tutti gli elementi interattivi (WCAG 2.4.7 / 2.4.11) --- */
:focus-visible {
    outline: 3px solid var(--tdr-focus);
    outline-offset: 3px;
    border-radius: 4px;
}
main:focus { outline: none; }
.site-footer :focus-visible { outline-color: #fff; }

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 2000;
    background: var(--tdr-ink); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 .5rem .5rem;
    text-decoration: none; font-weight: 600; transition: top .15s;
}
.skip-link:focus { top: 0; color: #fff; }

/* --- Testata --- */
.site-header { background: #fff; border-bottom: 1px solid var(--tdr-line); position: sticky; top: 0; z-index: 1030; }
.navbar { --bs-navbar-padding-y: .75rem; }
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; margin-right: .75rem; }
.brand-mark { height: 34px; width: auto; }
.brand-text {
    border-left: 2px solid var(--tdr-line); padding-left: 1rem;
    font-weight: 500; letter-spacing: .22em; font-size: 1rem; color: var(--tdr-ink);
}
.navbar-toggler { border: 2px solid var(--tdr-ink); padding: .4rem .6rem; }
.navbar-toggler:focus { box-shadow: none; }
.nav-link {
    color: var(--tdr-ink); font-weight: 500; padding: .65rem .75rem !important;
    border-bottom: 3px solid transparent; min-height: 44px; display: flex; align-items: center;
}
.nav-link:hover { color: var(--tdr-red-dark); }
.nav-link.active { color: var(--tdr-ink); border-bottom-color: var(--tdr-red); font-weight: 600; }
.nav-link, .site-header .btn { white-space: nowrap; }
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .nav-link { padding-inline: .55rem !important; }
}
@media (max-width: 1199.98px) {
    .navbar-collapse { padding-top: .5rem; }
    .nav-link { border-bottom: 0; border-left: 4px solid transparent; }
    .nav-link.active { border-left-color: var(--tdr-red); }
}

@media (max-width: 575.98px) {
    .brand { gap: .65rem; }
    .brand-mark { height: 28px; }
    .brand-text { padding-left: .65rem; font-size: .8rem; letter-spacing: .14em; }
}

/* --- Pulsanti --- */
.btn { font-weight: 600; border-radius: 999px; padding: .65rem 1.4rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.btn-tdr { background: var(--tdr-red); border: 2px solid var(--tdr-red); color: #fff; }
.btn-tdr:hover, .btn-tdr:focus-visible, .btn-tdr:active { background: var(--tdr-red-dark); border-color: var(--tdr-red-dark); color: #fff; }
.btn-tdr-outline { background: #fff; border: 2px solid var(--tdr-red); color: var(--tdr-red-dark); }
.btn-tdr-outline:hover { background: var(--tdr-red-dark); border-color: var(--tdr-red-dark); color: #fff; }

.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -.2em; }
.icon-sm { width: 1em; height: 1em; }
.icon-xl { width: 3rem; height: 3rem; }

/* --- Hero --- */
.hero { background: linear-gradient(180deg, var(--tdr-soft), #fff); padding-block: 2.5rem 3rem; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem); font-weight: 800; }
.hero .lead { font-size: 1.125rem; color: var(--tdr-muted); }
/* riquadro immagine condiviso (home e chi siamo) */
.media-card { background: #fff; border: 1px solid var(--tdr-line); border-radius: 1rem; overflow: hidden; }
.media-card img { display: block; width: 100%; height: auto; }
@media (min-width: 992px) {
    .hero { padding-block: 4rem; }
}

/* --- Punti di forza --- */
.highlights { border-top: 1px solid var(--tdr-line); border-bottom: 1px solid var(--tdr-line); background: #fff; }
.highlights .row { margin-inline: -.75rem; }
.highlight { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1.5rem .75rem; height: 100%; }
.highlight .icon { width: 2.25rem; height: 2.25rem; color: var(--tdr-red); margin-bottom: .25rem; }
.highlight h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.highlight p { font-size: .95rem; color: var(--tdr-muted); margin: 0; }
@media (min-width: 992px) {
    .highlight + .highlight { border-left: 1px solid var(--tdr-line); }
}

/* --- Servizi --- */
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8125rem; font-weight: 700; color: var(--tdr-muted); margin-bottom: .5rem; }
.services { overflow: hidden; }
.services-half { padding-block: 3rem; }
/* la fascia grigia si estende fino al bordo dello schermo, il contenuto resta nella griglia */
.services-half.is-business { position: relative; z-index: 0; }
.services-half.is-business::before { content: ""; position: absolute; inset: 0 -100vw; background: var(--tdr-panel); z-index: -1; }
.services-half h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700; margin-bottom: 2rem; }
.service { height: 100%; }
.service .icon { width: 3.5rem; height: 3.5rem; color: var(--tdr-ink); margin-bottom: .75rem; }
.service h3 { font-size: 1.125rem; font-weight: 700; }
.service p { font-size: .975rem; color: var(--tdr-muted); }
.is-business .service p { color: #2f3b52; }
@media (min-width: 992px) {
    .services-half.is-business::before { left: 0; }
}
.more-link { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; color: var(--tdr-red-dark); }
.is-business .more-link { color: #8f1a1a; }

/* --- Sezioni generiche --- */
.section { padding: 4rem 0; }
.section-soft { background: var(--tdr-soft); }
.page-hero { background: var(--tdr-soft); padding: 3rem 0 2.5rem; border-bottom: 1px solid var(--tdr-line); }
.page-hero h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); font-weight: 800; }
.breadcrumb-tdr { font-size: .9rem; margin-bottom: 1rem; }
.breadcrumb-tdr a { color: var(--tdr-muted); }
.card-tdr { background: #fff; border: 1px solid var(--tdr-line); border-radius: 1rem; padding: 1.5rem; height: 100%; }
.card-tdr .icon { width: 2.5rem; height: 2.5rem; color: var(--tdr-red); margin-bottom: .75rem; }
.contact-card { background: var(--tdr-ink); color: #fff; border-radius: 1rem; padding: 2rem; }
.contact-card a:not(.btn) { color: #fff; }
.contact-card h3 { color: #fff; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: .85rem; align-items: flex-start; padding: .55rem 0; }
.contact-list .icon { margin-top: .2rem; }
.prose h2 { font-size: 1.5rem; margin-top: 2.25rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.5rem; }
.prose ul { max-width: 68ch; }

/* --- Modulo --- */
.form-label { font-weight: 600; }
.form-control, .form-select { border: 2px solid #8391a7; border-radius: .6rem; min-height: 48px; padding: .6rem .9rem; color: var(--tdr-ink); }
.form-control:focus, .form-select:focus { border-color: var(--tdr-focus); box-shadow: 0 0 0 .2rem rgba(11, 87, 208, .25); }
.form-control.is-invalid, .form-select.is-invalid { border-color: #b00020; background-image: none; padding-right: .9rem; }
.form-check { padding-left: 2.1rem; }
.form-check .form-check-input { margin-left: -2.1rem; }
.form-check-input { width: 1.4em; height: 1.4em; border: 2px solid #8391a7; margin-top: .15em; }
.form-check-input:checked { background-color: var(--tdr-red); border-color: var(--tdr-red); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(11, 87, 208, .25); border-color: var(--tdr-focus); }
.field-error { color: #b00020; font-weight: 600; font-size: .95rem; margin-top: .35rem; }
.req { color: #b00020; }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.alert-tdr { border-radius: .8rem; border-width: 2px; }

/* --- Footer --- */
.site-footer { background: var(--tdr-ink); color: #e6eaf1; }
.site-footer a { color: #fff; text-underline-offset: 3px; }
.site-footer address { font-style: normal; line-height: 1.8; }
.footer-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: #fff; margin-bottom: 1rem; }
.footer-muted { color: #c9d1de; max-width: 32ch; }
.footer-links li + li { margin-top: .5rem; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.2); color: #c9d1de; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
    .btn-tdr, .btn-tdr-outline { border: 2px solid ButtonText; }
}
@media print {
    .site-header, .skip-link, .site-footer .footer-links { display: none; }
}
