/* Formulaire d'onboarding (référentiel §4) — interface utilitaire, volontairement sobre, comme
   apps/backoffice/styles.css : ce n'est pas le site vitrine (pas de polices ni de design par
   réglages ici), seulement le formulaire qui permet d'en créer un. */

:root {
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #fafaf9;
  --panel: #ffffff;
  --brand: #1e40af;
  --brand-soft: #eff2fb;
  --danger: #b91c1c;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Écran de choix du design (référentiel §4 bis) : plus large, pour laisser respirer les 3 aperçus. */
.page.wide {
  max-width: 1100px;
}

header.hero {
  margin-bottom: 2rem;
}

header.hero h1 {
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
}

header.hero p {
  color: var(--muted);
  margin: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

fieldset legend {
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding: 0;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.field .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
}

.spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.design-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.design-card.chosen {
  border-color: var(--brand);
}

.design-preview-frame {
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.design-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  /* Le site rendu occupe une page pleine largeur ; on le réduit ici pour tenir dans la carte. */
  transform: scale(0.5);
  transform-origin: top left;
  width: 200%;
  height: 200%;
}

.design-preview-footer {
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.design-preview-footer strong {
  display: block;
}

.design-preview-footer .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.design-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.design-preview-actions .btn {
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
}
