/* Q'Bounce — design system appliqué au moteur Card */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-paper: #f4f5ee;
  --color-paper-2: #eaede0;
  --color-ink: #0a1613;
  --color-ink-soft: #16251f;
  --color-muted: #5c6963;
  --color-line: #dee2d4;
  --color-lime: #c9f75b;
  --color-lime-soft: #e9fbc4;
  --color-forest: #10382c;
  --color-teal: #0e7a66;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Inter", ui-sans-serif, system-ui, sans-serif;

  --radius-card: 22px;
  --radius-panel: 30px;
  --shadow-sm: 0 1px 2px rgba(10, 22, 19, 0.05);
  --shadow-md: 0 16px 40px rgba(10, 22, 19, 0.08);

  --display: var(--font-display);
  --muted: var(--color-muted);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(620px 420px at 82% -8%, rgba(201, 247, 91, 0.38), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(10, 22, 19, 0.06) 1px, transparent 0);
  background-size: auto, 24px 24px;
  mask-image: linear-gradient(180deg, #000 0%, #000 32%, transparent 62%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 32%, transparent 62%);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0;
}

p {
  margin: 0;
}

code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  font-size: 0.92em;
  background: var(--color-paper-2);
  border-radius: 6px;
  padding: 1px 6px;
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
  border-radius: 8px;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 245, 238, 0.82);
  border-bottom: 1px solid var(--color-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  flex-wrap: wrap;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tag {
  border-radius: 999px;
  background: var(--color-lime);
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--color-ink);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted);
  flex: none;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-teal);
  box-shadow: 0 0 0 4px rgba(14, 122, 102, 0.14);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.tab:hover {
  color: var(--color-ink);
}

.tab.active {
  background: var(--color-ink);
  color: var(--color-paper);
}

.tab svg {
  flex: none;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding: 54px 0 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-lime);
  box-shadow: 0 0 0 4px rgba(201, 247, 91, 0.35);
}

.hero h1 {
  margin-top: 16px;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 640px;
}

.hero .lede {
  margin-top: 16px;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.62;
  color: var(--color-muted);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 12px;
}

.stat {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat .k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.stat .v {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.value-ok {
  color: #0e7a5f !important;
}

.value-bad {
  color: #b23b32 !important;
}

.value-teal {
  color: var(--color-teal) !important;
}

/* ---------- Cards & layout ---------- */
.card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  margin-bottom: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

section[data-panel] {
  padding-bottom: 26px;
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 8px;
}

input[type="email"],
input[type="text"],
input[type="file"],
textarea {
  width: 100%;
  border: 1px solid var(--color-line);
  background: #fff;
  color: var(--color-ink);
  border-radius: 14px;
  padding: 0 16px;
  height: 52px;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  height: auto;
  min-height: 150px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.6;
  font-size: 14px;
}

input::placeholder,
textarea::placeholder {
  color: #99a39d;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-ink);
  box-shadow: 0 0 0 4px rgba(10, 22, 19, 0.07);
}

input[type="file"] {
  height: auto;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--color-muted);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-muted);
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-forest);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 21px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--color-ink);
  color: var(--color-paper) !important;
}

.btn-primary:hover {
  background: var(--color-forest);
  color: var(--color-paper);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(10, 22, 19, 0.18);
  color: var(--color-ink);
}

.btn-ghost:hover {
  background: #fff;
}

.btn-sm {
  height: 38px;
  padding: 0 15px;
  font-size: 12.5px;
}

/* ---------- Badges ---------- */
.badge-valid,
.st-valid {
  --st: #0e7a5f;
  --st-soft: #e4f6ef;
  --st-line: #bce7d8;
}

.badge-invalid,
.st-invalid {
  --st: #b23b32;
  --st-soft: #fbe9e6;
  --st-line: #f1cbc5;
}

.badge-risky,
.st-risky {
  --st: #9a5b00;
  --st-soft: #fdf2de;
  --st-line: #f0dab2;
}

.badge-catch_all,
.st-catch_all {
  --st: #3b55a0;
  --st-soft: #eaeefa;
  --st-line: #cbd4f0;
}

.badge-disposable,
.st-disposable {
  --st: #7a3f8f;
  --st-soft: #f4ecf7;
  --st-line: #e2d0e9;
}

.badge-unknown,
.st-unknown {
  --st: #53625c;
  --st-soft: #edf0e9;
  --st-line: #d6dcd1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--st-soft, #edf0e9);
  color: var(--st, #53625c);
  border: 1px solid var(--st-line, #d6dcd1);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

/* ---------- Result hero ---------- */
.result-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 4px;
}

.widget {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.widget .title {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.email-line {
  margin-top: 12px;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  font-size: 15px;
  font-weight: 500;
  word-break: break-all;
}

.mbox {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mbox strong {
  font-size: 15px;
}

.orb {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
}

.orb.yes {
  background: #e4f6ef;
  color: #0e7a5f;
}

.orb.no {
  background: #fbe9e6;
  color: #b23b32;
}

.orb.maybe {
  background: #edf0e9;
  color: #53625c;
}

.score-ring {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--st, var(--color-forest)) calc(var(--s) * 1%), var(--color-paper-2) 0);
  flex: none;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: #fff;
}

.score-ring span {
  position: relative;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

/* ---------- Checks list ---------- */
.checks {
  display: flex;
  flex-direction: column;
}

.check-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(222, 226, 212, 0.7);
}

.check-item:last-child {
  border-bottom: 0;
}

.check-item .ico {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.check-item .ico.ok {
  background: #e4f6ef;
  color: #0e7a5f;
}

.check-item .ico.warn {
  background: #fdf2de;
  color: #9a5b00;
}

.check-item .ico.bad {
  background: #fbe9e6;
  color: #b23b32;
}

.check-item .ico.muted {
  background: #edf0e9;
  color: #53625c;
}

.check-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.check-item p {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-muted);
  margin-top: 1px;
}

/* ---------- Pills ---------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-paper);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-muted);
}

/* ---------- AI panel ---------- */
.ai-box {
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

.card ul {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.6;
}

.card ul li + li {
  margin-top: 4px;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

thead th {
  padding: 14px 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-line);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(222, 226, 212, 0.6);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(244, 245, 238, 0.6);
}

tbody td strong {
  font-weight: 600;
}

.card.table-wrap h3,
.card.table-wrap > p {
  padding-inline: 20px;
}

.card.table-wrap > h3 {
  padding-top: 20px;
}

.table-wrap .row {
  padding: 20px 20px 0;
  margin-top: 0;
}

.me-1 {
  margin-right: 6px;
  vertical-align: -2px;
}

.file-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #0e7a5f;
}

/* ---------- Flash ---------- */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 13px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
}

.flash.ok {
  background: #e4f6ef;
  border-color: #bce7d8;
  color: #0e7a5f;
}

.flash.error {
  background: #fbe9e6;
  border-color: #f1cbc5;
  color: #b23b32;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.footer-note {
  margin: 26px 0 0;
  padding: 22px 0 4px;
  border-top: 1px solid var(--color-line);
  font-size: 11.5px;
  color: var(--color-muted);
  text-align: center;
}

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 46px;
  background: var(--color-ink);
  color: var(--color-paper);
}

.site-footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-block: 30px;
}

.site-footer .brand-word {
  color: var(--color-paper);
}

.site-footer p {
  font-size: 12px;
  color: rgba(244, 245, 238, 0.55);
  max-width: 52ch;
}

.site-footer .foot-links {
  display: flex;
  gap: 18px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(244, 245, 238, 0.8);
}

.site-footer .foot-links a:hover {
  color: var(--color-lime);
}

/* ---------- Overlay ---------- */
.hidden {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  background: rgba(244, 245, 238, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay.active {
  display: grid;
}

.loader {
  width: min(380px, calc(100% - 40px));
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  padding: 24px;
  text-align: center;
}

.loader strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.loader .bar {
  margin-top: 16px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-paper-2);
  overflow: hidden;
}

.loader .bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: var(--color-lime);
  animation: qb-load 1.1s ease-in-out infinite;
}

@keyframes qb-load {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(260%);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .result-hero {
    grid-template-columns: 1fr 1fr;
  }

  .result-hero .widget:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 38px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .header-inner {
    justify-content: space-between;
  }

  .tabs {
    order: 3;
    width: 100%;
  }

  .live {
    display: none;
  }
}

@media (max-width: 640px) {
  .shell {
    width: calc(100% - 32px);
  }

  .tabs {
    flex-wrap: wrap;
    overflow: visible;
    border-radius: 22px;
  }

  .tab {
    flex: 1 1 auto;
    justify-content: center;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-hero {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px;
  }

  .loader {
    padding: 20px;
  }
}
