/*
 * Vigilance S.P.I design system components (vs-*), copied from the mock-up
 * (docs/front/maquette.html). Every value comes from tokens.css.
 *
 * Keep this file in sync with the design system; page-specific layout goes
 * to site.css.
 */
.vs-root, .vs-root * {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 26px;
}

/* Links without a component class: the brand green, not the browser blue */
a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-hover);
}

.vs-icon {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentcolor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Button */
.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: var(--space-3) var(--space-5);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    text-decoration: none;

    /* A button label never wraps: the layout around it adapts instead. */
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}

.vs-btn-lg {
    min-height: 56px;
    padding: var(--space-4) var(--space-6);
    font-size: 18px;
}

.vs-btn-sm {
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
}

.vs-btn-block {
    width: 100%;

    /* Already as wide as it can be: wrapping is the last resort on tiny screens. */
    white-space: normal;
}

.vs-btn-primary {
    background: var(--brand);
    color: var(--on-brand);
}

.vs-btn-primary:hover {
    background: var(--brand-hover);
}

.vs-btn-accent {
    background: var(--accent);
    color: var(--on-accent);
}

.vs-btn-accent:hover {
    background: var(--accent-hover);
}

.vs-btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border-strong);
}

.vs-btn-secondary:hover {
    border-color: var(--ink);
}

.vs-btn-ghost {
    background: transparent;
    color: var(--brand);
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}

.vs-btn-ghost:hover {
    background: var(--brand-soft);
}

.vs-btn-on-deep {
    background: transparent;
    color: var(--on-deep);
    border-color: var(--on-deep);
}

.vs-btn-on-deep:hover {
    background: var(--on-deep);
    color: var(--surface-deep);
}

.vs-btn[disabled], .vs-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .55;
}

.vs-btn[aria-busy="true"] {
    cursor: progress;
}

.vs-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentcolor;
    border-right-color: transparent;
    border-radius: var(--radius-dome);
    animation: vs-spin .8s linear infinite;
}

@keyframes vs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Field */
.vs-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.vs-label {
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    color: var(--ink);
}

.vs-req {
    color: var(--danger);
    margin-left: var(--space-1);
}

.vs-input {
    width: 100%;
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 24px;
}

.vs-input::placeholder {
    color: var(--ink-muted);
}

textarea.vs-input {
    min-height: 128px;
    resize: vertical;
}

.vs-input[aria-invalid="true"] {
    border-color: var(--danger);
    border-width: 2px;
}

.vs-hint, .vs-msg {
    display: flex;
    gap: var(--space-1);
    align-items: flex-start;
    font-size: 15px;
    line-height: 22px;
    color: var(--ink-muted);
    margin: 0;
}

.vs-msg-error {
    color: var(--danger);
    font-weight: 600;
}

.vs-msg-success {
    color: var(--success);
    font-weight: 600;
}

.vs-msg .vs-icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

/* Alert */
.vs-alert {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--ink);
}

.vs-alert .vs-icon {
    width: 22px;
    height: 22px;
    margin-top: 2px;
}

.vs-alert-title {
    margin: 0 0 var(--space-1);
    font-weight: 700;
}

.vs-alert-body {
    margin: 0;
}

.vs-alert-info .vs-icon {
    color: var(--info);
}

.vs-alert-success {
    background: var(--brand-soft);
}

.vs-alert-success .vs-icon {
    color: var(--success);
}

.vs-alert-warning .vs-icon {
    color: var(--warning);
}

.vs-alert-danger {
    background: var(--accent-soft);
    border-color: var(--danger);
}

.vs-alert-danger .vs-icon {
    color: var(--danger);
}

/* Badge */
.vs-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    background: var(--surface-alt);
    color: var(--ink);
    border: 1px solid var(--border);
}

.vs-badge-brand {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: transparent;
}

.vs-badge-accent {
    background: var(--accent-soft);
    color: var(--ink);
    border-color: transparent;
}

.vs-badge-accent::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--radius-dome);
    background: var(--accent);
}

/* ServiceCard */
.vs-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: box-shadow .15s ease-out, border-color .15s ease-out;
}

.vs-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.vs-card-ico {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-dome);
    background: var(--brand-soft);
    color: var(--brand);
}

.vs-card-ico .vs-icon {
    width: 28px;
    height: 28px;
}

.vs-card-accent .vs-card-ico {
    background: var(--accent-soft);
    color: var(--accent);
}

.vs-card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 28px;
    font-weight: 700;
}

.vs-card p {
    margin: 0;
    color: var(--ink-muted);
}

.vs-card ul {
    margin: 0;
    padding-left: var(--space-5);
    color: var(--ink);
}

.vs-card-link {
    margin-top: auto;
    padding-top: var(--space-2);
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    gap: var(--space-1);
    align-items: center;
    min-height: 44px;
}

.vs-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
}

.vs-card-link:hover {
    text-decoration: underline;
}

.vs-card-accent .vs-card-link {
    color: var(--accent);
}

.vs-card:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* SiteHeader */
.vs-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.vs-header-in {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2) var(--space-4);
    min-height: 88px;
}

.vs-logo {
    display: inline-flex;
    flex-shrink: 0;
    min-height: 44px;
    align-items: center;
}

.vs-logo img {
    height: 72px;
    width: auto;
    display: block;
}

/* Twice the original 48 px from tablets up; a little smaller on phones, where the sticky header takes room */
@media (width >= 640px) {
    .vs-header-in {
        min-height: 112px;
    }

    .vs-logo img {
        height: 96px;
    }
}

.vs-nav {
    display: none;
    margin-left: auto;
}

.vs-nav ul {
    display: flex;
    gap: var(--space-1);
    list-style: none;
    margin: 0;
    padding: 0;
}

.vs-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-3);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-md);
}

.vs-drawer a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.vs-nav a:hover {
    background: var(--surface-alt);
}

.vs-nav a[aria-current="page"] {
    color: var(--ink);
    box-shadow: inset 0 -3px 0 var(--accent);
    border-radius: 0;
}

.vs-header-actions {
    display: flex;
    flex-shrink: 0;
    gap: var(--space-2);
    margin-left: auto;
    align-items: center;
}

.vs-phone,
.vs-login {
    display: none;
}

.vs-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.vs-drawer {
    border-top: 1px solid var(--border);
    padding: var(--space-2) var(--space-4) var(--space-4);
}

.vs-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vs-drawer a[aria-current="page"] {
    color: var(--accent);
}

.vs-drawer .vs-btn {
    margin-top: var(--space-4);
}

/*
 * The full navigation needs about 1220 px with every label shown, more than
 * the 1200 px of the header. Below 1080 px it stays in the burger menu; on
 * desktop the team login is an icon, and the phone number shows from 1200 px.
 * Hidden labels stay in the accessible name of the button.
 */
@media (width >= 1080px) {
    .vs-nav {
        display: block;
    }

    .vs-header-actions {
        margin-left: var(--space-4);
    }

    .vs-phone,
    .vs-login {
        display: inline-flex;
        padding-inline: var(--space-3);
    }

    .vs-phone > span,
    .vs-login > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .vs-menu-btn, .vs-drawer {
        display: none;
    }
}

@media (width >= 1200px) {
    .vs-phone {
        padding-inline: var(--space-5);
    }

    .vs-phone > span {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
    }
}

/* Filters of a list: a <details>, folded on phones (Ui:Filters) */
.vs-filters > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.vs-filters > summary::-webkit-details-marker {
    display: none;
}

.vs-filters[open] > summary {
    margin-bottom: var(--space-3);
}

.vs-filters-on {
    color: var(--brand);
}

@media (width >= 960px) {
    .vs-filters > summary {
        display: none;
    }
}

/* Hero */
.vs-hero {
    background: var(--surface-deep);
    color: var(--on-deep);
    border-bottom: 4px solid var(--accent);
}

.vs-hero-in {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.vs-overline {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: 13px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

/* La flèche rouge du logo, en tête de chaque sur-titre */
.vs-overline::before {
    content: "";
    flex: none;
    width: 28px;
    height: 10px;
    background: currentcolor;
    clip-path: polygon(0 40%, 70% 40%, 70% 0, 100% 50%, 70% 100%, 70% 60%, 0 60%);
}

.vs-hero .vs-overline, .vs-on-deep .vs-overline {
    color: var(--accent-on-deep);
}

.vs-hero h1 {
    margin: 0;
    max-width: 16ch;
    font-family: var(--font-display);
    font-size: 36px;
    line-height: 40px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.vs-hero h1 em {
    font-style: normal;
    color: var(--logo-green);
}

.vs-hero-lead {
    margin: 0;
    max-width: 56ch;
    font-size: 19px;
    line-height: 30px;
    color: var(--on-deep-muted);
}

.vs-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.vs-hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--on-deep);
    font-size: 15px;
    line-height: 22px;
}

.vs-hero-proof li {
    display: inline-flex;
    gap: var(--space-2);
    align-items: center;
}

.vs-hero-proof .vs-icon {
    color: var(--logo-green);
}

@media (width >= 640px) {
    .vs-hero h1 {
        font-size: 56px;
        line-height: 60px;
    }
}

@media (width >= 960px) {
    .vs-hero-in {
        padding: var(--space-9) var(--space-7);
    }
}

/* Skeleton */
.vs-skel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.vs-skel-bar {
    height: 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    position: relative;
    overflow: hidden;
}

.vs-skel-ico {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-dome);
    background: var(--surface-alt);
}

.vs-skel-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    transform: translateX(-100%);
    animation: vs-shimmer 1.4s ease-in-out infinite;
}

@keyframes vs-shimmer {
    to {
        transform: translateX(100%);
    }
}

/* EmptyState */
.vs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-5);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-alt);
}

.vs-empty .vs-card-ico {
    background: var(--surface);
}

.vs-empty h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 28px;
}

.vs-empty p {
    margin: 0;
    max-width: 44ch;
    color: var(--ink-muted);
}

/* Focus : anneau plein 2px décalé de 2px (after the components, so it wins) */
.vs-root :focus-visible, .vs-btn:focus-visible, .vs-input:focus-visible, .vs-link:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.vs-on-deep :focus-visible {
    outline-color: var(--focus-on-deep);
}

.vs-card-link:focus-visible {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .vs-btn, .vs-card {
        transition: none;
    }

    .vs-spinner, .vs-skel-bar::after {
        animation: none;
    }
}

/* Honeypot of the public forms (HoneypotTrait): out of sight, not hidden from robots. */
.vs-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
