/* outil-en-ligne.fr — Design System v2 */
/* Direction : minimalisme raffiné, typographie forte, palette froide */


@font-face {
  font-display: swap; 
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/dm-mono-v16-latin-regular.woff2') format('woff2'); 
}
/* dm-mono-500 - latin */
@font-face {
  font-display: swap; 
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/dm-mono-v16-latin-500.woff2') format('woff2'); 
}

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
  font-weight: 100 900; /* couvre tous les poids */
  font-display: swap;
}

/* ─── Tokens ─────────────────────────────────────────────────── */

:root {
    --c-bg:          #f5f6f8;
    --c-surface:     #ffffff;
    --c-surface-2:   #f0f2f5;
    --c-border:      rgba(0, 0, 0, 0.07);
    --c-border-md:   rgba(0, 0, 0, 0.12);

    --c-ink:         #0e1117;
    --c-ink-2:       #374151; /* Optimisé pour la conformité WCAG AA (anciennement #4a5163) */
    --c-ink-3:       #6b7280; /* Ajusté pour maintenir la hiérarchie visuelle en sécurité */

    --c-accent:      #1e40af; /* Sécurisé à 5.6:1 de contraste pour le texte et boutons */
    --c-accent-light:#eff4ff;
    --c-accent-dark: #172554; /* Bleu très profond pour les états hover */

    --c-success:     #059669;
    --c-success-bg:  #ecfdf5;
    --c-warning:     #b45309; /* Sécurisé pour le contraste des textes d'alerte */
    --c-warning-bg:  #fffbeb;
    --c-danger:      #dc2626;
    --c-danger-bg:   #fef2f2;
    --c-info:        #0369a1; /* Sécurisé pour le contraste (anciennement #0891b2) */
    --c-info-bg:   #ecfeff;

    /* Bootstrap compat */
    --primary-color:   var(--c-accent);
    --secondary-color: var(--c-ink-2);
    --success-color:   var(--c-success);
    --info-color:      var(--c-info);
    --warning-color:   var(--c-warning);
    --danger-color:    var(--c-danger);
    --bs-nav-link-font-size: 13px;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    --shadow-xs:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md:  0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.05);
    --shadow-lg:  0 20px 48px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);

    --t-fast:  150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base:  250ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow:  400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset / Base ───────────────────────────────────────────── */

html {
    scroll-behavior: smooth;
}

*:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

body {
    font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #0e1117;
    background-color: var(--c-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

/* ─── Navbar ──────────────────────────────────────────────────── */

.navbar {
    position: relative;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--c-border);
    box-shadow: none;
    transition: box-shadow var(--t-base);
}

.navbar.scrolled,
.navbar:hover {
    box-shadow: var(--shadow-xs);
}

.navbar-brand,
.navbar-brand * {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: var(--c-ink) !important;
}

.navbar .nav-link,
.navbar .navbar-nav .nav-link {
    font-size: 13px !important;
    font-weight: 500;
    color: var(--c-ink-2) !important;
    padding: 0.4rem 0.75rem !important;
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background var(--t-fast);
}

.navbar .nav-link:hover,
.navbar .nav-link.active,
.navbar .navbar-nav .nav-link:hover {
    color: var(--c-accent) !important;
    background: var(--c-accent-light);
}

.dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
}

.dropdown-item {
    font-size: 13px;
    font-weight: 400;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    color: var(--c-ink-2) !important;
    transition: background var(--t-fast), color var(--t-fast);
}

.dropdown-item:hover {
    background: var(--c-accent-light);
    color: var(--c-accent) !important;
}

/* ─── Hero ────────────────────────────────────────────────────── */

.hero-section {
    position: relative;
    z-index: 1;
    padding: 3rem 0;
    background: var(--c-ink);
    border-radius: var(--radius-xl);
    color: white;
    margin-bottom: 3rem;
    overflow: hidden;
    isolation: isolate;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(37,99,235,0.35) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99,102,241,0.25) 0%, transparent 40%);
    z-index: -1;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 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.025'%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");
    z-index: -1;
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    text-shadow: none;
}

.hero-section p {
    color: rgba(255,255,255,0.80); /* Contraste légèrement augmenté pour le texte du Hero */
    font-weight: 300;
}

/* ─── Cards ───────────────────────────────────────────────────── */

/* Forcer l'isolation complète du fond blanc sur les cartes (Correction Lighthouse) */
div.card.hover-card,
div.card,
.card {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    animation: fadeUp 0.4s ease both;
    color: #0e1117 !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.hover-card {
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
    cursor: pointer;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
    border-color: var(--c-border-md);
}

/* Forcer le contraste des typographies à l'intérieur des cartes */
.card .card-title,
.card h3.card-title.h5,
h3.card-title.h5 {
    color: #0e1117 !important; 
    font-weight: 600 !important;
}

.card .card-text,
.card p.card-text,
p.card-text {
    color: #222 !important; 
}

/* Variantes colorées de cartes (uniquement si utilisées explicitement) */
.card.bg-primary  { background: var(--c-accent)   !important; border: none; color: #fff !important; }
.card.bg-success  { background: var(--c-success)  !important; border: none; color: #fff !important; }
.card.bg-info     { background: var(--c-info)     !important; border: none; color: #fff !important; }
.card.bg-warning  { background: var(--c-warning)  !important; border: none; color: #fff !important; }
.card.bg-danger   { background: var(--c-danger)   !important; border: none; color: #fff !important; }
.card.bg-secondary{ background: var(--c-ink-2)    !important; border: none; color: #fff !important; }

.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning,
.card.bg-danger,
.card.bg-secondary {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base);
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-info:hover,
.card.bg-warning:hover,
.card.bg-danger:hover,
.card.bg-secondary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-md);
}

/* ─── Boutons ─────────────────────────────────────────────────── */

.btn {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-md);
    padding: 0.5rem 1.25rem;
    border: 1px solid transparent;
    transition:
        transform var(--t-fast),
        box-shadow var(--t-fast),
        background var(--t-fast),
        color var(--t-fast),
        border-color var(--t-fast);
    letter-spacing: 0.01em;
}

.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none !important; }

/* Correction du bouton primaire pour obtenir un contraste > 5.5:1 avec le texte blanc */
a.btn.btn-primary,
.btn-primary {
    background-color: #1e40af !important;
    background: #1e40af !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(30,64,175,0.3);
}

a.btn.btn-primary:hover,
.btn-primary:hover {
    background-color: #172554 !important;
    background: #172554 !important;
    border-color: #172554 !important;
    box-shadow: 0 4px 12px rgba(23,37,84,0.35);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--c-border-md);
    color: var(--c-ink);
}

.btn-outline-primary:hover {
    background: var(--c-accent-light);
    border-color: var(--c-accent);
    color: var(--c-accent);
    box-shadow: 0 2px 8px rgba(30,64,175,0.12);
}

/* ─── Formulaires ─────────────────────────────────────────────── */

textarea.form-control,
input.form-control,
select.form-control,
.form-control {
    font-family: 'DM Mono', 'Courier New', monospace;
    font-size: 13.5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--c-border-md);
    background: var(--c-surface);
    color: var(--c-ink);
    padding: 0.6rem 0.9rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    box-shadow: var(--shadow-xs);
}

textarea.form-control:hover,
input.form-control:hover {
    border-color: rgba(0,0,0,0.2);
}

textarea.form-control:focus,
input.form-control:focus,
.form-control:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.12);
    outline: none;
}

/* ─── Alerts ──────────────────────────────────────────────────── */

.alert {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    padding: 0.875rem 1.125rem;
}

.alert-info    { background: var(--c-info-bg);    border-color: rgba(3,105,161,0.15);   color: #034d74; }
.alert-success { background: var(--c-success-bg); border-color: rgba(5,150,105,0.15);   color: #065f46; }
.alert-warning { background: var(--c-warning-bg); border-color: rgba(180,83,9,0.15);    color: #78350f; }
.alert-danger  { background: var(--c-danger-bg);  border-color: rgba(220,38,38,0.15);   color: #991b1b; }

/* ─── Icônes ──────────────────────────────────────────────────── */

.tool-icon,
.feature-icon {
    font-size: 2.5rem;
    text-align: center;
    line-height: 1;
}

/* ─── Badge "Nouveau" ─────────────────────────────────────────── */

.badge-new {
    display: inline-flex;
    align-items: center;
    background: #fee2e2;
    color: #b91c1c;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ─── Footer ──────────────────────────────────────────────────── */

footer {
    margin-top: auto;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-ink-2);
    font-size: 13px;
}

/* ─── Animations ──────────────────────────────────────────────── */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.row > *:nth-child(1) .card { animation-delay:   0ms; }
.row > *:nth-child(2) .card { animation-delay:  60ms; }
.row > *:nth-child(3) .card { animation-delay: 120ms; }
.row > *:nth-child(4) .card { animation-delay: 180ms; }
.row > *:nth-child(5) .card { animation-delay: 240ms; }
.row > *:nth-child(6) .card { animation-delay: 300ms; }

/* ─── Loading button ──────────────────────────────────────────── */

.btn.loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    top: 50%;
    left: 50%;
    margin: -7.5px 0 0 -7.5px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.55s linear infinite;
}

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

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero-section {
        border-radius: var(--radius-lg);
        padding: 2rem 0;
    }

    .hero-section h1 { font-size: 1.85rem; }

    .tool-icon,
    .feature-icon   { font-size: 2rem; }

    .display-4      { font-size: 2rem; }

    .btn            { padding: 0.45rem 1rem; }
}

/* ─── Utilitaires ─────────────────────────────────────────────── */

.divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--c-ink-3);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--c-border-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--c-ink-2);
    background: var(--c-surface);
    transition: border-color var(--t-fast), background var(--t-fast);
}

.chip:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
    background: var(--c-accent-light);
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-ink-3);
    margin-bottom: 0.75rem;
}

/* ─── Navbar toggler (mobile) ─────────────────────────────────── */

.navbar-toggler {
    border-color: var(--c-border-md) !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%230e1117' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}