* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 16px;
  background: #faf9f8;
  color: #323130;
  font-size: 14px;
  line-height: 1.4;
}

header h1 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #0078d4;
}

#status {
  padding: 12px;
  background: #fff;
  border-radius: 4px;
  margin-bottom: 16px;
  border: 1px solid #edebe9;
}

#status-msg {
  margin: 0;
  color: #605e5c;
}

button {
  background: #0078d4;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  margin-top: 8px;
  transition: background 0.15s;
}

button:hover:not(:disabled) { background: #106ebe; }
button:active:not(:disabled) { background: #005a9e; }
button:disabled { background: #a19f9d; cursor: not-allowed; }

button.secondary {
  background: white;
  color: #0078d4;
  border: 1px solid #0078d4;
}
button.secondary:hover:not(:disabled) {
  background: #eff6fc;
}

#result {
  margin-top: 20px;
}

#result h2 {
  font-size: 15px;
  color: #323130;
  margin: 0 0 8px 0;
}

#response-preview {
  background: white;
  padding: 12px;
  border: 1px solid #edebe9;
  border-radius: 4px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  margin: 8px 0;
  outline: none;
}

#response-preview:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

#response-preview p { margin: 0 0 8px 0; }

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.actions button {
  flex: 1;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

/* Bouton icône seule (ex: Régénérer) — largeur fixe compacte */
.actions button.icon-only {
  flex: 0 0 auto;
  width: 40px;
  padding: 8px;
}

.actions button:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-icon {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.btn-label {
  display: inline-block;
}

/* Bouton Copier — état "copié" */
#copy-btn.copied {
  background: #107c10;
  border-color: #107c10;
  color: #fff;
}
#copy-btn.copied:hover:not(:disabled) {
  background: #0e6d0e;
}
#copy-btn.copied .icon-copy {
  display: none !important;
}
#copy-btn.copied .icon-check {
  display: inline-block !important;
  animation: pop-in 0.25s ease-out;
}

@keyframes pop-in {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#error {
  margin-top: 16px;
  padding: 12px;
  background: #fef5e7;
  border-left: 4px solid #c0392b;
  border-radius: 4px;
}

.error-msg { color: #c0392b; margin: 0; }

footer {
  margin-top: 24px;
  text-align: center;
  color: #a19f9d;
}
