/* ==========================================================================
   selchhost — feuille de style unique
   ========================================================================== */

:root {
  --bg:        #f7f8fc;
  --bg-soft:   #eef0f8;
  --surface:   #ffffff;
  --surface-2: #f9fafd;
  --border:    #e3e6f0;
  --border-2:  #d3d8e8;
  --text:      #171a26;
  --text-2:    #565d78;
  --text-3:    #858ba6;
  --accent:    #4453d6;
  --accent-2:  #5b68e8;
  --accent-3:  #eceefc;
  --success:   #12855c;
  --success-bg:#e4f6ee;
  --warning:   #9a6410;
  --warning-bg:#fdf1dd;
  --danger:    #c02a37;
  --danger-bg: #fdeaec;
  --info:      #1c6fa8;
  --info-bg:   #e5f2fb;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(20,25,50,.05), 0 8px 24px rgba(20,25,50,.06);
  --shadow-lg: 0 2px 6px rgba(20,25,50,.06), 0 20px 50px rgba(20,25,50,.10);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #10121b;
    --bg-soft:   #161927;
    --surface:   #191d2b;
    --surface-2: #1f2434;
    --border:    #2b3145;
    --border-2:  #3a4159;
    --text:      #eef0f7;
    --text-2:    #a7aec8;
    --text-3:    #7b8299;
    --accent:    #7b88ff;
    --accent-2:  #96a1ff;
    --accent-3:  #232842;
    --success:   #4dd4a0;
    --success-bg:#14312a;
    --warning:   #e5b25c;
    --warning-bg:#332816;
    --danger:    #ff7b88;
    --danger-bg: #351b21;
    --info:      #6cc0f0;
    --info-bg:   #16293a;
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 20px 50px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

code, kbd, pre { font-family: var(--mono); font-size: .875em; }
code { background: var(--bg-soft); padding: .15em .4em; border-radius: 5px; }
pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; margin: 0 0 1rem;
}
pre code { background: none; padding: 0; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---------------------------------------------------------------- layout -- */
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 1.25rem; }
.wrap-sm { max-width: 720px; }
.wrap-xs { max-width: 460px; }
main { flex: 1 0 auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-tight { padding: 2.5rem 0; }

/* ------------------------------------------------------------------ nav --- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; gap: 1.5rem; height: 62px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--text); font-size: 1.05rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800;
}
.nav-links { display: flex; gap: 1.35rem; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text-2); font-size: .93rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; margin-left: auto; }

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem 1.25rem 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-links form { padding: .6rem 0; }
  .nav-links .btn { margin-top: .5rem; text-align: center; }
}

/* ---------------------------------------------------------------- boutons - */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.3rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: background .15s, transform .06s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-2); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-lg { padding: .95rem 1.8rem; font-size: 1.02rem; }
.btn-sm { padding: .42rem .8rem; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger); filter: brightness(1.1); }
.btn-block { display: flex; width: 100%; }

/* ---------------------------------------------------------------- cartes -- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow);
}
.card-pad-lg { padding: 2.2rem; }
.card h3 { margin-bottom: .4rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ------------------------------------------------------------------ hero -- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); text-align: center; }
.hero p.lead { font-size: clamp(1.05rem, 2.2vw, 1.28rem); color: var(--text-2); max-width: 40rem; margin: 0 auto 2rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.2rem;
  padding: .35rem .9rem; border-radius: 999px; background: var(--accent-3);
  color: var(--accent); font-size: .84rem; font-weight: 600; border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 1rem; font-size: .88rem; color: var(--text-3); }

/* ------------------------------------------------- champ nom de domaine --- */
.domain-field {
  display: flex; align-items: stretch; max-width: 34rem; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--border-2);
  border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.domain-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-3); }
.domain-field input {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--text);
  padding: .9rem 1rem; font: inherit; font-size: 1.02rem; outline: none;
}
.domain-suffix {
  display: flex; align-items: center; padding: 0 .9rem; background: var(--bg-soft);
  color: var(--text-2); font-weight: 600; font-size: .95rem; border-left: 1px solid var(--border);
}
.domain-status { min-height: 1.6rem; margin-top: .7rem; font-size: .9rem; font-weight: 500; text-align: center; }
.domain-status.ok   { color: var(--success); }
.domain-status.ko   { color: var(--danger); }
.domain-status.busy { color: var(--text-3); }
.suggestions { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; margin-top: .6rem; }
.suggestions button {
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2);
  padding: .3rem .7rem; border-radius: 999px; font: inherit; font-size: .82rem; cursor: pointer;
}
.suggestions button:hover { border-color: var(--accent); color: var(--accent); }

/* -------------------------------------------------------------- étapes ---- */
.steps { counter-reset: s; }
.step { position: relative; padding-left: 3.2rem; }
.step::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: .1rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--accent-3); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}

/* --------------------------------------------------------------- tarifs --- */
.price-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.price-card { position: relative; }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.price-badge {
  position: absolute; top: -.75rem; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .74rem; font-weight: 700;
  padding: .28rem .8rem; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase;
}
.price-amount { font-size: 2.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.price-amount small { font-size: .95rem; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.check-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.check-list li { position: relative; padding-left: 1.7rem; margin-bottom: .55rem; color: var(--text-2); font-size: .95rem; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: -1px;
  color: var(--success); font-weight: 800;
}
.check-list li.no::before { content: "—"; color: var(--text-3); }

/* ------------------------------------------------------------------ FAQ --- */
details.faq {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 1rem 1.2rem; margin-bottom: .7rem;
}
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; float: right; color: var(--text-3); font-weight: 400; font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq p:last-child { margin-bottom: 0; }
details.faq > *:not(summary) { margin-top: .8rem; color: var(--text-2); }

/* --------------------------------------------------------------- forms ---- */
.field { margin-bottom: 1.25rem; }
.field label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.hint { font-size: .84rem; color: var(--text-3); margin-top: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: .7rem .85rem; font: inherit; font-size: .97rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-3); }
textarea { resize: vertical; min-height: 8rem; line-height: 1.6; }
.input-err { border-color: var(--danger) !important; }
.err-msg { color: var(--danger); font-size: .85rem; margin-top: .3rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; margin: 0 0 1.5rem; }
legend { padding: 0 .5rem; font-weight: 700; font-size: .95rem; }

.file-drop {
  border: 2px dashed var(--border-2); border-radius: var(--radius-sm);
  padding: 1.1rem; text-align: center; background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.over { border-color: var(--accent); background: var(--accent-3); }
.file-drop input { display: none; }
.file-drop .fname { font-size: .87rem; color: var(--text-2); margin-top: .4rem; word-break: break-all; }
.file-preview { max-width: 100%; max-height: 90px; border-radius: 6px; margin-top: .5rem; }

.counter { font-size: .82rem; color: var(--text-3); text-align: right; margin-top: .3rem; }
.counter.warn { color: var(--warning); }
.counter.over { color: var(--danger); font-weight: 600; }

/* ------------------------------------------------------------- messages --- */
.alert {
  border-radius: var(--radius-sm); padding: .85rem 1.1rem; margin-bottom: 1rem;
  font-size: .93rem; border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* -------------------------------------------------------------- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--bg-soft); color: var(--text-2); white-space: nowrap;
}
.badge-live      { background: var(--success-bg); color: var(--success); }
.badge-building  { background: var(--info-bg);    color: var(--info); }
.badge-queued    { background: var(--bg-soft);    color: var(--text-2); }
.badge-failed    { background: var(--danger-bg);  color: var(--danger); }
.badge-suspended { background: var(--warning-bg); color: var(--warning); }
.badge-deleted   { background: var(--bg-soft);    color: var(--text-3); }
.badge-draft     { background: var(--bg-soft);    color: var(--text-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* -------------------------------------------------------------- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .91rem; }
table.data th, table.data td { padding: .72rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { background: var(--surface-2); font-weight: 600; font-size: .82rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--text-3); }

/* ---------------------------------------------------------------- stats --- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.stat .k { font-size: .78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .v { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .82rem; color: var(--text-2); margin-top: .1rem; }

/* -------------------------------------------------------------- timeline -- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.6rem; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: .45rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--border-2);
  border: 2px solid var(--bg);
}
.timeline li.success::before { background: var(--success); }
.timeline li.error::before   { background: var(--danger); }
.timeline li.warning::before { background: var(--warning); }
.timeline li.info::before    { background: var(--info); }
.timeline .t { font-size: .78rem; color: var(--text-3); }

/* ---------------------------------------------------------------- admin --- */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 62px); }
.admin-side { border-right: 1px solid var(--border); background: var(--surface); padding: 1.25rem 0; }
.admin-side .group { padding: .4rem 1.25rem; font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-top: .8rem; }
.admin-side a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem 1.25rem; color: var(--text-2); font-size: .92rem; font-weight: 500; }
.admin-side a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.admin-side a.active { background: var(--accent-3); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.admin-side .pill { background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; }
.admin-main { padding: 1.75rem 2rem 4rem; min-width: 0; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--border); display: flex; gap: .25rem; overflow-x: auto; padding: .5rem; }
  .admin-side .group { display: none; }
  .admin-side a { white-space: nowrap; border-radius: var(--radius-sm); }
  .admin-side a.active { box-shadow: none; }
  .admin-main { padding: 1.25rem; }
}

.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head .sub { color: var(--text-2); font-size: .93rem; margin-top: .2rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.flags { display: flex; flex-wrap: wrap; gap: .35rem; }
.flag { font-size: .74rem; padding: .15rem .55rem; border-radius: 5px; background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.flag.soft { background: var(--warning-bg); color: var(--warning); }

.prompt-box {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem; white-space: pre-wrap; word-break: break-word;
  font-size: .9rem; line-height: 1.65; max-height: 32rem; overflow: auto;
}
.prompt-box.blocked { border-left-color: var(--danger); }

.rule-editor textarea { min-height: 15rem; font-family: var(--mono); font-size: .86rem; line-height: 1.6; }
.locked-core {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--text-3);
  border-radius: var(--radius-sm); padding: 1rem; white-space: pre-wrap;
  font-family: var(--mono); font-size: .78rem; line-height: 1.6; color: var(--text-2);
  max-height: 20rem; overflow: auto;
}

/* --------------------------------------------------------------- footer --- */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 0; margin-top: 3rem; font-size: .9rem; color: var(--text-2); }
.footer-in { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* ------------------------------------------------------------ utilitaires - */
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: .87rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.75rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.75rem; }
.flex { display: flex; gap: .75rem; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-sm { gap: .4rem; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.progress { height: 6px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
