:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #2c3e50;
  --muted: #7f8c9a;
  --line: #e4e9ee;
  --brand: #2d8cf0;
  --ok: #27ae60;
  --warn: #e67e22;
  --fail: #c0392b;
  --info: #7f8c9a;
  --radius: 12px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar {
  max-width: 980px; margin: 0 auto; padding: .6rem 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand { font-weight: 700; color: var(--brand); font-size: 1.15rem; cursor: pointer; }
.mainnav { display: flex; gap: .25rem; }
.nav-link {
  border: none; background: none; color: var(--muted); cursor: pointer;
  padding: .4rem .7rem; border-radius: 6px; font-size: .92rem;
}
.nav-link.active { color: var(--brand); font-weight: 600; background: var(--bg); }
.account-area { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.account-email { font-size: .85rem; color: var(--ink); }
.quota-badge {
  background: #eef6ff; color: var(--brand); border: 1px solid #cfe4fb;
  border-radius: 20px; padding: .2rem .7rem; font-size: .8rem; font-weight: 600;
}
.ghost-btn, .solid-btn {
  border-radius: 6px; padding: .4rem .8rem; cursor: pointer; font-size: .85rem; border: 1px solid var(--brand);
}
.ghost-btn { background: none; color: var(--brand); }
.solid-btn { background: var(--brand); color: #fff; }
.solid-btn.full { width: 100%; padding: .6rem; font-size: .95rem; }

.hero { text-align: center; padding: 2rem 1rem 1.5rem; }
.site-header h1 { margin: 0; font-size: 2rem; color: var(--brand); }
.tagline { color: var(--muted); margin: .4rem 0 0; }

.lang-switch button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 6px; padding: .2rem .5rem; cursor: pointer; margin-left: .2rem; font-size: .78rem;
}
.lang-switch button.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* ---- Modale auth ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--card); border-radius: var(--radius); padding: 1.75rem;
  width: 100%; max-width: 380px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal-close {
  position: absolute; top: .6rem; right: .8rem; border: none; background: none;
  font-size: 1.5rem; color: var(--muted); cursor: pointer; line-height: 1;
}
.auth-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.auth-tab {
  flex: 1; border: none; background: var(--bg); color: var(--muted);
  padding: .5rem; border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.auth-tab.active { background: var(--brand); color: #fff; font-weight: 600; }
#auth-form { display: flex; flex-direction: column; }
#auth-form label { font-size: .82rem; color: var(--muted); margin: .5rem 0 .2rem; }
#auth-form input {
  border: 1px solid var(--line); border-radius: 6px; padding: .55rem; font-size: .95rem;
}
.auth-error { color: var(--fail); font-size: .85rem; margin: .7rem 0 0; }
#auth-submit { margin-top: 1rem; }

/* ---- Tarifs ---- */
.pricing-card { text-align: center; }
.billing-toggle {
  display: inline-flex; background: var(--bg); border-radius: 8px; padding: .25rem; margin: 1rem 0 1.5rem;
}
.toggle-btn {
  border: none; background: none; color: var(--muted); padding: .45rem 1.1rem;
  border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.toggle-btn.active { background: var(--card); color: var(--brand); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.plan {
  border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem 1rem; position: relative;
  display: flex; flex-direction: column; gap: .4rem;
}
.plan.popular { border-color: var(--brand); box-shadow: 0 2px 12px rgba(45,140,240,.15); }
.plan-badge {
  position: absolute; top: -.7rem; left: 50%; transform: translateX(-50%);
  background: var(--ok); color: #fff; font-size: .7rem; font-weight: 700;
  padding: .15rem .6rem; border-radius: 20px;
}
.plan-tests { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.plan-tests small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.plan-price { font-size: 1.9rem; font-weight: 800; color: var(--brand); }
.plan-price small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.plan-per { color: var(--muted); font-size: .8rem; margin-bottom: .5rem; }
.center { text-align: center; }

/* ---- Mur de quota ---- */
.quota-wall { text-align: center; border-color: var(--warn); }
.quota-wall h2 { color: var(--warn); }

main { max-width: 760px; margin: 0 auto; padding: 0 1rem 3rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.hint { color: var(--muted); font-size: .92rem; margin: .25rem 0 1rem; }

.address-box {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg); border: 1px dashed var(--line);
  border-radius: 8px; padding: .6rem .8rem;
}
.address-box code { font-size: 1.1rem; font-weight: 600; flex: 1; word-break: break-all; }
.address-box button, .link-btn {
  border: none; background: var(--brand); color: #fff;
  border-radius: 6px; padding: .45rem .9rem; cursor: pointer; font-size: .9rem;
}
.link-btn { background: none; color: var(--brand); padding: .4rem 0; margin-top: .6rem; }

/* ---- Hero test (style mail-tester) ---- */
.test-hero { text-align: center; padding: 2rem 1.5rem; }
.test-hero h2 { font-size: 1.3rem; margin-bottom: 1.2rem; }
.test-hero .address-box { max-width: 460px; margin: 0 auto 1.2rem; }
.big-check {
  font-size: 1.05rem; padding: .85rem 2rem; border-radius: 8px;
  display: inline-block; margin-bottom: 1rem;
}
.test-hero .hint { max-width: 460px; margin: .5rem auto 0; }
#new-btn { display: block; margin: .8rem auto 0; }
.waiting-addr { margin: .6rem 0; }
.waiting-addr code { background: var(--bg); padding: .3rem .6rem; border-radius: 6px; font-size: .9rem; }
#back-btn { margin-bottom: .5rem; }

.waiting { text-align: center; padding: 1.5rem 0; }
.spinner {
  width: 32px; height: 32px; margin: 0 auto 1rem;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none; }

.score-wrap { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.score-circle {
  width: 100px; height: 100px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.score-circle span { font-size: 2rem; font-weight: 700; line-height: 1; }
.score-circle small { opacity: .85; font-size: .75rem; }
.score-meta strong { display: block; font-size: 1.05rem; }
.sender-info { color: var(--muted); font-size: .85rem; margin-top: .3rem; }

.check {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .7rem 0; border-top: 1px solid var(--line);
}
.check:first-child { border-top: none; }
.badge {
  flex-shrink: 0; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; font-weight: 700; margin-top: .1rem;
}
.badge.pass { background: var(--ok); }
.badge.fail { background: var(--fail); }
.badge.warn { background: var(--warn); }
.badge.info { background: var(--info); }
.check-text { flex: 1; }
.check-delta { color: var(--muted); font-size: .8rem; }

.spam-rule .check-text { font-size: .88rem; color: var(--muted); }
.spam-rule .check-text strong { color: var(--ink); font-family: monospace; }

.group-title {
  margin: 1.5rem 0 .25rem; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}

footer { text-align: center; color: var(--muted); padding: 1rem; }
