/* ==========================================================================
   prénom-chien.com — feuille de style
   Mobile first, légère, sans dépendance externe.
   ========================================================================== */

:root {
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-darker: #c2410c;
  --cream: #fff7ed;
  --cream-2: #ffedd5;
  --ink: #431407;
  --text: #3f3f46;
  --text-muted: #78716c;
  --surface: #ffffff;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --green-bg: #dcfce7;
  --green-text: #166534;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Variante utilisée par la page /embed : fond transparent, sans marges */
body.embed {
  background: transparent;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --------------------------------------------------------------- En-tête */
.site-header {
  text-align: center;
  padding: 28px 16px 8px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.logo svg { width: 28px; height: 28px; }
.tagline {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ Générateur */
.generator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 18px 0;
}
body.embed .generator {
  margin: 0;
  box-shadow: none;
}

.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 0; }

.label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.label .opt { font-weight: 400; color: var(--text-muted); }
.req { color: var(--danger); }

/* Boutons sexe */
.sex-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sex-btn {
  height: 48px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.12s ease;
}
.sex-btn:hover { border-color: var(--orange); }
.sex-btn[aria-pressed="true"] {
  background: var(--cream-2);
  border-color: var(--orange);
  color: var(--orange-darker);
}
.sex-btn svg { width: 18px; height: 18px; }

/* Menus déroulants */
select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select:focus { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }

.badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green-text);
  padding: 3px 9px;
  border-radius: 20px;
}

/* Bouton principal */
.btn-primary {
  width: 100%;
  height: 54px;
  margin-top: 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:active { transform: scale(0.99); }

/* Zone résultat */
.result {
  margin-top: 18px;
  min-height: 104px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.result.filled { border-style: solid; border-color: var(--cream-2); background: var(--cream); }
.result .hint { font-size: 14px; color: var(--text-muted); }
.result .err { font-size: 14px; color: var(--danger); font-weight: 500; }
.result .sex-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange-darker);
  font-weight: 600;
}
.result .name {
  font-size: 40px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-top: 2px;
  word-break: break-word;
}

/* Grille des 4 prénoms proposés */
.names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  list-style: none;
  padding: 0;
}
.name-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 12px 8px;
  border: 1.5px solid var(--cream-2);
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.name-item span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.name-item:hover { border-color: var(--orange); background: #fff; }
.name-item .copy-ico { width: 15px; height: 15px; color: var(--text-muted); flex: none; }
.name-item:hover .copy-ico { color: var(--orange); }
.copy-hint { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }

/* Actions secondaires : Copier (gauche) / Un autre (droite, principal) */
.actions {
  display: none;
  gap: 10px;
  margin-top: 12px;
}
.actions.show { display: flex; }
.btn-secondary {
  flex: 1;
  height: 46px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-secondary:hover { border-color: var(--orange); }
.btn-secondary svg { width: 16px; height: 16px; }

/* « Un autre » : bouton d'action mis en avant, à droite */
.btn-again {
  flex: 1.6;
  height: 46px;
  border: none;
  border-radius: var(--radius);
  background: var(--cream-2);
  color: var(--orange-darker);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-again:hover { background: var(--orange); color: #fff; }
.btn-again svg { width: 18px; height: 18px; }

/* --------------------------------------------------------- Emplacements pub */
.ad-slot {
  margin: 20px 0;
  min-height: 100px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
}

/* -------------------------------------------------------------- Intégrer */
.embed-tools { margin-top: 14px; text-align: center; }
.link-btn {
  background: none;
  border: none;
  color: var(--orange-dark);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.embed-box {
  display: none;
  margin-top: 12px;
  text-align: left;
}
.embed-box.show { display: block; }
.embed-box textarea {
  width: 100%;
  height: 84px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  resize: vertical;
  color: var(--text);
  background: var(--surface);
}

/* ---------------------------------------------------------------- Contenu */
.content { padding: 8px 0 40px; }
.content h2 { font-size: 20px; color: var(--ink); margin: 28px 0 10px; }
.content h3 { font-size: 16px; color: var(--ink); margin: 20px 0 6px; }
.content p { margin: 0 0 12px; font-size: 15px; }
.content ul { padding-left: 20px; }
.content li { margin-bottom: 6px; font-size: 15px; }

/* ------------------------------------------------------------- Pied de page */
.site-footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--orange-dark); text-decoration: none; }

/* Lien retour discret dans la version embed */
/* ------------------------------------------------- Embed customizer */
.embed-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.embed-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.embed-colors > legend { grid-column: 1 / -1; }
.color-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.color-field span {
  flex: 1;
  min-width: 0;
}
.color-field input[type="color"] {
  width: 36px;
  height: 32px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: var(--surface);
}
.embed-preview-wrap {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f4f4f5;
}
.embed-preview {
  width: 100%;
  height: 540px;
  border: 0;
  display: block;
}

.embed-credit {
  text-align: center;
  padding: 10px 0 2px;
  font-size: 12px;
}
.embed-credit a { color: var(--orange-dark); text-decoration: none; font-weight: 500; }

/* Petit toast « copié » */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; }

/* ========================================================================
   Bannière de consentement cookies
   ======================================================================== */
.pc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pc-consent-root[hidden] { display: none; }

.pc-consent-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pc-consent-overlay {
  position: absolute;
  inset: 0;
  background: rgba(67, 20, 7, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.pc-consent-modal {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.22);
  padding: clamp(20px, 4vw, 32px);
  font-family: var(--font);
}

.pc-consent-modal:focus { outline: none; }

.pc-consent-title {
  font-size: clamp(20px, 3.5vw, 26px);
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink);
}

.pc-consent-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.pc-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.pc-consent-actions--prefs {
  margin-top: 8px;
  margin-bottom: 0;
}

.pc-btn {
  appearance: none;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
  flex: 1 1 auto;
  min-height: 44px;
}

.pc-btn:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.pc-btn:active { transform: translateY(1px); }

.pc-btn-primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.pc-btn-primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

.pc-btn-outline {
  background: transparent;
  color: var(--orange);
  border-color: var(--orange);
}
.pc-btn-outline:hover {
  background: rgba(249, 115, 22, 0.08);
}

.pc-consent-reject {
  appearance: none;
  background: none;
  border: none;
  padding: 6px 4px;
  margin: 4px 0 0;
  font: inherit;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  display: inline-block;
}
.pc-consent-reject:hover { color: var(--text); }
.pc-consent-reject:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

.pc-consent-cats {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pc-consent-cat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--cream);
}

.pc-consent-cat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.pc-consent-cat-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  flex: 1;
}

.pc-consent-cat-state {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.pc-consent-cat-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Toggle switch */
.pc-consent-toggle {
  appearance: none;
  border: none;
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  padding: 0;
  transition: background-color .15s ease;
  flex-shrink: 0;
}
.pc-consent-toggle:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
.pc-consent-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.pc-consent-toggle[aria-checked="true"] {
  background: var(--orange);
}
.pc-consent-toggle[aria-checked="true"] .pc-consent-toggle-knob {
  transform: translateX(20px);
}
.pc-consent-toggle--locked {
  background: var(--green-text);
  cursor: not-allowed;
  opacity: 0.85;
}
.pc-consent-toggle--locked .pc-consent-toggle-knob {
  transform: translateX(20px);
}

@media (max-width: 480px) {
  .pc-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-consent-toggle-knob,
  .pc-btn { transition: none; }
}
