/* ============================================================
   style.css — Numericatous — Feuille de styles partagée
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables de couleurs ── */
:root {
  --bg:        #f5f4f0;
  --surface:   #ffffff;
  --surface2:  #f1f0ec;
  --border:    rgba(0,0,0,0.10);
  --border2:   rgba(0,0,0,0.18);
  --text:      #1a1a18;
  --muted:     #5a5a56;
  --hint:      #5e5e5a;
  --radius:    12px;
  --radius-sm: 8px;
  --accent:    #1a6fb5;
  --accent-hover: #155a96;

  --amber-bg:  #faeeda; --amber-tx: #633806;
  --blue-bg:   #e6f1fb; --blue-tx:  #0c447c;
  --teal-bg:   #e1f5ee; --teal-tx:  #085041;
  --green-bg:  #eaf3de; --green-tx: #27500a;
  --gray-bg:   #f1efe8; --gray-tx:  #444441;
  --red-bg:    #fcebeb; --red-tx:   #791f1f;
  --ok-bg:     #e1f5ee; --ok-tx:    #085041;
  --warn-bg:   #faeeda; --warn-tx:  #633806;
  --bad-bg:    #fcebeb; --bad-tx:   #791f1f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #1c1c1a;
    --surface:  #252523;
    --surface2: #2e2e2c;
    --border:   rgba(255,255,255,0.10);
    --border2:  rgba(255,255,255,0.18);
    --text:     #e8e8e4;
    --muted:    #a8a8a4;
    --hint:     #9e9e9a;
    --accent:   #5aade0;
    --accent-hover: #7cc0ea;

    --amber-bg: #633806; --amber-tx: #fac775;
    --blue-bg:  #0c447c; --blue-tx:  #b5d4f4;
    --teal-bg:  #085041; --teal-tx:  #9fe1cb;
    --green-bg: #27500a; --green-tx: #c0dd97;
    --gray-bg:  #444441; --gray-tx:  #d3d1c7;
    --red-bg:   #791f1f; --red-tx:   #f7c1c1;
    --ok-bg:    #085041; --ok-tx:    #9fe1cb;
    --warn-bg:  #633806; --warn-tx:  #fac775;
    --bad-bg:   #791f1f; --bad-tx:   #f7c1c1;
  }
}

/* ── Base ── */
html { font-size: 16px; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ── */
.page-wrapper {
  flex: 1;
  padding: 2rem 1rem 3rem;
}
.container {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ── Navigation entre pages ── */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border2);
  padding: 0 1rem;
}
.site-nav-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-nav-inner::-webkit-scrollbar { display: none; }
.site-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ── En-tête de page ── */
.header { text-align: center; margin-bottom: 2rem; padding-top: 0.5rem; }
.header h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.header p { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; max-width: 560px; margin-left: auto; margin-right: auto; }

.header-disclaimer {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Formulaire de recherche ── */
.search-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 2rem; }
.search-form input {
  width: 100%; padding: 0.8rem 1rem;
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 1rem;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,111,181,0.2);
}
.search-form button {
  width: 100%; padding: 0.85rem 1rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background 0.15s; touch-action: manipulation;
}
.search-form button:hover   { background: var(--accent-hover); }
.search-form button:active  { opacity: 0.8; }
.search-form button:disabled { opacity: 0.4; cursor: not-allowed; }
.search-form button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 500px) {
  .search-form { flex-direction: row; }
  .search-form input { flex: 1; width: auto; }
  .search-form button { width: auto; flex-shrink: 0; padding: 0.75rem 1.4rem; font-size: 0.95rem; }
}

/* ── Loader ── */
.loader { display: none; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; padding: 0.75rem 0; }
.loader.active { display: flex; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border2); border-top-color: var(--muted); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Boîte d'erreur ── */
.error-box {
  display: none; background: var(--bad-bg); color: var(--bad-tx);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  font-size: 0.9rem; margin-bottom: 1rem;
  border: 1px solid var(--red-tx);
}

/* ── Score global ── */
.grade-row {
  display: flex; align-items: center; gap: 16px;
  padding: 1rem 1.25rem; border-radius: var(--radius-sm);
  margin-bottom: 12px; background: var(--surface);
  border: 1px solid var(--border); flex-wrap: wrap;
}
.grade-circle {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: #fff; flex-shrink: 0;
}

.grade-info { flex: 1; min-width: 0; }
.grade-label { font-size: 1rem; font-weight: 600; }
.grade-sub   { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.score-bar-wrap { background: var(--surface2); border-radius: 6px; height: 10px; overflow: hidden; margin-top: 6px; max-width: 360px; }
.score-bar      { height: 100%; border-radius: 6px; transition: width .6s; min-width: 4px; }

/* ── Score cards ── */
.score-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; margin-bottom: 14px; }
.score-card  {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.sc-icon  { font-size: 1.3rem; }
.sc-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.sc-pts   { font-size: 0.77rem; color: var(--muted); }
.sc-note  { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.sc-bar   { height: 5px; border-radius: 3px; margin-top: 4px; }

/* ── Blocs alertes ── */
.alert-block {
  border-left: 4px solid; border-radius: 0 8px 8px 0;
  padding: 11px 15px; margin-bottom: 9px;
  font-size: 0.88rem; line-height: 1.5;
}
.alert-block.critical { background: var(--bad-bg);   border-color: #c0392b; color: var(--bad-tx); }
.alert-block.high     { background: var(--warn-bg);  border-color: #d68910; color: var(--warn-tx); }
.alert-block.ok       { background: var(--ok-bg);    border-color: #1d9e75; color: var(--ok-tx); }
.alert-block.info     { background: var(--surface2); border-color: var(--muted); color: var(--text); }
.alert-block .fix     { font-size: 0.8rem; color: var(--muted); margin-top: 5px; }
.alert-block .fix strong { color: #1d9e75; }
.alert-block--mt { margin-top: 4px; }

/* ── Titre de section ── */
.section-title {
  margin: 22px 0 9px; font-size: 1rem; font-weight: 600;
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; min-width: 360px; }
.data-table th {
  background: var(--surface2); font-weight: 600;
  padding: 7px 10px; text-align: left;
  border-bottom: 2px solid var(--border2);
}
.data-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr.row-fail td { background: var(--bad-bg); }
.data-table tr.row-warn td { background: var(--warn-bg); }
.data-table .note-cell { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.cell-center  { text-align: center; }
.cell-muted   { font-size: 0.81rem; color: var(--muted); }
.pts-na { color: var(--hint); }
.table-mt { margin-top: 10px; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; margin: 1px 2px;
}
.b-ok   { background: var(--ok-bg);   color: var(--ok-tx); }
.b-fail { background: var(--bad-bg);  color: var(--bad-tx); }
.b-warn { background: var(--warn-bg); color: var(--warn-tx); }
.b-info { background: var(--blue-bg); color: var(--blue-tx); }
.b-neu  { background: var(--surface2); color: var(--muted); }
.badge--sm { font-size: 0.74rem; }

/* ── Grille DNS ── */
.dns-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.dns-item { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 8px; font-size: 0.83rem; font-weight: 500; }
.dns-ok   { background: var(--ok-bg);  border: 1px solid #1d9e75; color: var(--ok-tx); }
.dns-fail { background: var(--bad-bg); border: 1px solid #c0392b; color: var(--bad-tx); }
.dns-neu  { background: var(--surface2); border: 1px solid var(--border2); color: var(--muted); }

/* ── SSL grid ── */
.ssl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.ssl-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); }
.ssl-card.ok   { border-color: #1d9e75; background: var(--ok-bg); }
.ssl-card.fail { border-color: #c0392b; background: var(--bad-bg); }
.ssl-card.warn { border-color: #d68910; background: var(--warn-bg); }
.ssl-card--full { grid-column: 1 / -1; }
.ssl-label { font-size: 0.74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ssl-value { font-size: 0.88rem; font-weight: 500; word-break: break-all; }
.ssl-value--sm  { font-size: 0.81rem; }
.ssl-value--xs  { font-size: 0.79rem; display: block; }
.ssl-value-muted { color: var(--muted); }

/* ── Redirect chain ── */
.redirect-chain { font-size: 0.81rem; color: var(--muted); padding: 7px 12px; background: var(--surface2); border-left: 3px solid var(--border2); border-radius: 0 6px 6px 0; margin-bottom: 10px; }

/* ── Sensitive files — statuts ── */
.res-critical td { background: var(--bad-bg) !important; }
.status-info     { color: var(--muted); }
.status-critical { color: #c0392b; font-weight: 600; }
.status-warn     { color: #d68910; font-weight: 600; }
.status-ok       { color: #1d9e75; }

/* ── Info card générique ── */
.info-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px;
}
.info-card .ic-label { font-size: 0.74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.info-card .ic-value { font-size: 0.95rem; font-weight: 500; margin-top: 2px; word-break: break-word; }

/* ── Tech pill ── */
.tech-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0; }
.tech-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 20px; font-size: 0.8rem; font-weight: 500;
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text);
}
.tech-pill.eu  { background: var(--teal-bg); border-color: #1d9e75; color: var(--teal-tx); }
.tech-pill.usa { background: var(--warn-bg); border-color: #d68910; color: var(--warn-tx); }
.tech-pill.bad { background: var(--bad-bg);  border-color: #c0392b; color: var(--bad-tx); }

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border2);
  padding: 1rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── Résultats cachés ── */
#results { display: none; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .score-cards { grid-template-columns: 1fr 1fr; }
  .ssl-grid    { grid-template-columns: 1fr; }
  .ssl-card--full { grid-column: 1; }
  .header h1   { font-size: 1.3rem; }
  .page-wrapper { padding: 1.5rem 0.85rem 2.5rem; }
}
@media (max-width: 380px) {
  .score-cards { grid-template-columns: 1fr; }
  .site-nav a  { padding: 0.75rem 0.75rem; font-size: 0.82rem; }
}

/* ── Focus visible global (accessibilité) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
