:root {
  --ink: #121212;
  --muted: #5a5a5a;
  --line: #e4e2dc;
  --bg: #f3f1eb;
  --card: #fffcf7;
  --accent: #1f4b3f;
  --danger: #9b1c1c;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --pad: max(1rem, env(safe-area-inset-left));
  --pad-r: max(1rem, env(safe-area-inset-right));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100svh;
  font-size: 16px;
  line-height: 1.45;
}
.app {
  width: min(560px, calc(100% - var(--pad) - var(--pad-r)));
  margin: 0 auto;
  padding: 1.25rem 0 calc(2.5rem + env(safe-area-inset-bottom));
}
.top { margin-bottom: 1.1rem; }
.brand {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.sub { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.92rem; }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 1.1rem;
}
.steps li {
  text-align: center;
  padding: 0.55rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--card);
}
.steps li.on {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem;
}
h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 5.8vw, 1.7rem);
  line-height: 1.2;
}
.lead { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }

.field { margin-top: 0.95rem; }
.field-label, label.field-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.field-help {
  margin: -0.15rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}
input, textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 96px; resize: vertical; }

.checks { display: grid; gap: 0.45rem; }
.check {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 500;
}
.check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
}
.check:has(input:checked) {
  border-color: var(--accent);
  background: #f1f7f4;
}

button, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 1.15rem;
  padding: 0.85rem 1.1rem;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
button:disabled { opacity: 0.55; cursor: wait; }
button.back {
  width: auto;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  margin-top: 0;
  margin-bottom: 0.85rem;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
}
.actions {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.actions .primary, .actions button { width: 100%; margin-top: 0; }
.status {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.status.err { color: var(--danger); }
.req { color: var(--danger); }
iframe {
  width: 100%;
  height: min(70svh, 640px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

/* Modale confirmation */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: color-mix(in srgb, #0c1a14 55%, transparent);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}
.overlay[hidden] { display: none !important; }
.modal {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 1.35rem 1.25rem 1.2rem;
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px color-mix(in srgb, #000 18%, transparent);
  animation: riseIn 0.28s ease;
}
.modal-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.modal h2 {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
  line-height: 1.25;
}
.modal-body {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.98rem;
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.55rem;
}
.modal-actions button {
  margin-top: 0;
  min-height: 48px;
}
.modal-cancel {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.modal-ok { background: var(--accent); }

/* Loader création site */
.loader-overlay {
  background: color-mix(in srgb, #0c1a14 72%, transparent);
}
.loader-card {
  width: min(320px, 100%);
  text-align: center;
  color: #f6f4ef;
  padding: 1.5rem 1.25rem;
}
.loader-ring {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, #fff 22%, transparent);
  border-top-color: #7dcea0;
  animation: spin 0.85s linear infinite;
}
.loader-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.loader-sub {
  margin: 0;
  font-size: 0.92rem;
  color: color-mix(in srgb, #fff 72%, transparent);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 720px) {
  .app { padding-top: 2rem; }
  .actions { grid-template-columns: 1fr; }
}
