:root {
    --background: #f5f7fb;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --text: #172033;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --radius: 16px;
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px;
    margin: auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.location-select {
    min-width: 260px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 35px 24px 60px;
}

.hero {
    margin-bottom: 28px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 34px;
}

.hero p {
    color: var(--muted);
    margin: 0;
}

.site-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 10px;
    border-radius: 20px;
    background: #e8f0ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 22px 24px 10px;
}

.card-header h2 {
    margin: 0;
    font-size: 21px;
}

.card-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.card-body {
    padding: 20px 24px 24px;
}

/* =========================================================
   SPEED TEST
   ========================================================= */

.speed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding-bottom: 22px;
}

.speed-start-button {
    flex: 0 0 auto;
    min-width: 150px;
    padding: 13px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.speed-start-button:hover {
    background: var(--primary-dark);
}

.speed-start-button:active {
    transform: scale(0.98);
}

.speed-start-button.running {
    background: #dc2626;
}

.speedtest-widget {
    padding: 10px 24px 24px;
}

.speed-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.speed-result {
    text-align: center;
    padding: 30px 15px;
    border-right: 1px solid var(--border);
}

.speed-result:last-child {
    border-right: 0;
}

.speed-result-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.speed-result-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.speed-result-unit {
    margin-left: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.speedtest-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

.speedtest-info strong {
    color: var(--text);
}

.speed-status {
    font-weight: 600;
}

/* =========================================================
   NETWORK TOOLS + DOWNLOAD FILES
   ========================================================= */

/*
 * Compatible avec les deux noms :
 * - .grid       : si ton index.html actuel utilise encore cette classe
 * - .tools-grid : nom plus explicite si tu veux le changer plus tard
 */
.grid,
.tools-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.grid > .card,
.tools-grid > .card {
    height: 100%;
    margin-bottom: 0;
}

.tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: 0.2s ease;
}

.tool-button:hover {
    background: var(--primary-dark);
}

.download-list {
    display: grid;
    gap: 10px;
}

.download {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: 0.2s ease;
}

.download:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.download-name {
    font-weight: 600;
}

.download-description {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.download-arrow {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 20px;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 35px;
}

/* =========================================================
   BEHOSTINGS LOGO
   ========================================================= */

.site-logo {
    display: block;
    width: 220px;
    max-width: 70%;
    height: auto;
    margin: 0 auto 24px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .location-select {
        width: 100%;
        min-width: 0;
    }

    .grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 28px;
    }
}

@media (max-width: 700px) {
    .speed-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .speed-start-button {
        width: 100%;
    }

    .speed-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .speed-result:nth-child(2) {
        border-right: 0;
    }

    .speed-result:nth-child(1),
    .speed-result:nth-child(2) {
        border-bottom: 1px solid var(--border);
    }

    .speedtest-info {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   HERO / LOCATION HEADER
   ========================================================= */

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 18px;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.hero-brand .site-logo {
    width: 260px;
    max-width: 42vw;
    margin: 0;
    flex: 0 0 auto;
}

.hero-brand h1 {
    margin: 0;
    white-space: nowrap;
}

.location-box {
    flex: 0 0 auto;
    min-width: 320px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.location-label {
    margin-bottom: 7px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.location-select {
    width: 100%;
    min-width: 290px;
    padding: 13px 42px 13px 15px;
    border: 2px solid #94a3b8;
    border-radius: 10px;
    background-color: #ffffff;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.location-select:hover,
.location-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

@media (max-width: 900px) {
    .hero-top {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-brand {
        justify-content: flex-start;
    }

    .hero-brand .site-logo {
        width: 220px;
        max-width: 52vw;
    }

    .location-box {
        min-width: 0;
    }

    .location-select {
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .hero-brand {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .hero-brand .site-logo {
        max-width: 80%;
    }

    .hero-brand h1 {
        white-space: normal;
    }
}
